Skip to content

feat: Implement OCR and native vision support for Doc Event file attachments#257

Open
Sanjusha-tridz wants to merge 4 commits into
developfrom
feat/file-attach-trigger
Open

feat: Implement OCR and native vision support for Doc Event file attachments#257
Sanjusha-tridz wants to merge 4 commits into
developfrom
feat/file-attach-trigger

Conversation

@Sanjusha-tridz
Copy link
Copy Markdown
Collaborator

No description provided.

- Added 'files=None' to the 'run_agent_sync' function signature to resolve a 'TypeError' when triggered by Doc Events.
- Included the 'files' array in the execution 'context' dictionary so that attachment metadata correctly propagates downstream to the AI provider context runner.
- Added logic to dynamically extract attached file URLs from specified 'DocField' or
'Child Table Field' sources.
- Implemented MIME type checking to differentiate between image and non-image document attachments.
- Integrated 'handle_ocr_document' via an asyncio event loop to automatically perform OCR on non-image files (like PDFs) and seamlessly prepend the extracted text to the agent's prompt context.
- Updated 'run' and 'run_stream' methods to extract 'files' from the execution context.
- Implemented logic to automatically filter files by 'is_image' and append them directly to the 'user_content' payload as 'image_url' blocks.
- This ensures multi-modal image support is natively handled for LLMs when files are attached during Doc Events.
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.

1 participant