diff --git a/pdf-umbenenner-application/src/main/java/de/gecheckt/pdf/umbenenner/application/service/AiRequestComposer.java b/pdf-umbenenner-application/src/main/java/de/gecheckt/pdf/umbenenner/application/service/AiRequestComposer.java index 0a2ce6c..edf11fa 100644 --- a/pdf-umbenenner-application/src/main/java/de/gecheckt/pdf/umbenenner/application/service/AiRequestComposer.java +++ b/pdf-umbenenner-application/src/main/java/de/gecheckt/pdf/umbenenner/application/service/AiRequestComposer.java @@ -15,16 +15,25 @@ import de.gecheckt.pdf.umbenenner.domain.model.PromptIdentifier; *
  • The loaded prompt content (from the external prompt file)
  • *
  • The stable prompt identifier (derived from the prompt source)
  • *
  • The extracted document text (already limited to max characters if needed)
  • + *
  • An explicit JSON-only response format specification
  • *
  • The exact character count that was sent (for traceability)
  • * *

    - * Order and structure: The composition follows a fixed, documented order - * to ensure that another implementation would not need to guess how the prompt and document - * are combined. The prompt is presented first, followed by the document text, with clear - * structural markers to distinguish between them. + * Composition order: The request follows a fixed, documented order: + *

      + *
    1. Prompt content (instruction)
    2. + *
    3. Prompt identifier marker
    4. + *
    5. Document text marker
    6. + *
    7. Document text content
    8. + *
    9. Response format expectation (JSON-only specification)
    10. + *
    *

    - * JSON-only response expectation: The request is constructed with the - * explicit expectation that the AI will respond with a JSON object containing: + * This fixed order ensures reproducibility and allows another implementation to + * understand the request structure without guessing. + *

    + * JSON-only response expectation: The actual composed request includes + * an explicit specification that the AI must respond with a JSON object containing + * exactly these fields: *