Skip to content

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

Merged
TonsOfFun merged 1 commit into
activeagents:mainfrom
qlarity:fix/openai-chat-document-shorthand
May 7, 2026
Merged

Fix handling of :document shorthand in OpenAI Chat transforms (PDF Attachements)#332
TonsOfFun merged 1 commit into
activeagents: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
@TonsOfFun TonsOfFun merged commit faafeff into activeagents:main May 7, 2026
9 checks passed
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

2 participants