Summarize how the changes in this PR work
- User
Summarize how the changes in this PR work
Assistant
This PR adds in-context document support for Anthropic and Google models by enabling the sending of full documents within the chat context. It supports PDF files for Anthropic models and text, PDF, and audio files for Google models. The changes involve encoding files (primarily using base64) and including them within the chat messages' payloads. For local files, the PR adjusts the file paths used when preparing images for the payload. The upload process now considers the tool resource (e.g., file_search, execute_code) when handling files. Finally, the PR updates the UI to provide more specific upload options depending on the selected endpoint and its capabilities. A limitation exists with token counting for PDFs in Anthropic, as page count cannot be accurately determined without additional dependencies. Agents are not currently supported due to langchain limitations with PDF handling.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.