Skip to content

Fix handling of :document shorthand in OpenAI Chat transforms (PDF Attachements)#332

Open
TheRealNeil wants to merge 1 commit intoactiveagents:mainfrom
qlarity:fix/openai-chat-document-shorthand
Open

Fix handling of :document shorthand in OpenAI Chat transforms (PDF Attachements)#332
TheRealNeil wants to merge 1 commit intoactiveagents:mainfrom
qlarity:fix/openai-chat-document-shorthand

Conversation

@TheRealNeil
Copy link
Copy Markdown
Contributor

The normalize_message method in OpenAI Chat transforms handled :image shorthand but not :document. When { document: "data:..." } was passed, the document data was silently dropped and leaked as an extra param.

Changes:

  • Add :document handling with URL and data URI support
  • Add :document to extra_params.except() to prevent leaking
  • Add build_file_content helper for file content blocks
  • Add 4 tests covering document shorthand scenarios

Fixes #331

The normalize_message method in OpenAI Chat transforms handled :image
shorthand but not :document. When { document: "data:..." } was passed,
the document data was silently dropped and leaked as an extra param.

Changes:
- Add :document handling with URL and data URI support
- Add :document to extra_params.except() to prevent leaking
- Add build_file_content helper for file content blocks
- Add 4 tests covering document shorthand scenarios

Fixes activeagents#331
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.

OpenAI Chat transforms silently drops :document shorthand

1 participant