Skip to content

Conversation

@badmonster0
Copy link
Member

No description provided.

@badmonster0 badmonster0 merged commit 7a458ab into main Nov 23, 2025
5 checks passed
**Why does this matter?**
- For Gemini and Anthropic models, BAML can sometimes infer or adjust the prompt structure, so extraction works either way.
- For **OpenAI models** (e.g., GPT-4/GPT-4o), if the PDF is **not** in the user role, the model doesn't see the file content — so extractions will fail or return empty fields.
- This can easily trip you up.If you're using BAML, **always double-check your prompt roles when adding file inputs**—especially for OpenAI backends.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: up.If

missed a whitespace

> This ensures the **PDF content is explicitly included as part of the user message**, rather than the system prompt.

**Why does this matter?**
- For Gemini and Anthropic models, BAML can sometimes infer or adjust the prompt structure, so extraction works either way.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"BAML can sometimes infer or adjust the prompt structure"

Is it how it works? (I'm not sure, may missed something if this is specified somewhere)

I think it's just some subtle request format difference between OpenAI and others, so others tolerate that in the system prompt, while OpenAI doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants