Fix Unit Test Failures in OpenAI, Anthropic, and Google Gemini Resolvers #1537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed all errors in #1536
This pull request addresses multiple failures in the unit tests for the libraries used in OpenAI Assistants, Anthropic, and Google. Here are the key changes made to resolve these issues:
Bug Description:
Anthropic Library:
ContentBlock
has been updated to a Union type which cannot be instantiated. It now represents bothTextBlock
andToolUseBlock
.ContentBlock
withTextBlock
in the relevant sections of the code.OpenAI Library:
retrieval
tool renamed tofile_search
assistant.file_ids
parameter changed totool_resources
message.file_ids
parameter changed toattachments
Gemini Library:
Issue: An error exists in the Gemini library where it incorrectly parses a protobuf object as a dictionary.
Fix: Implemented a workaround to avoid this parsing bug.
Reference:
response.text
is no longer directly accessible -TypeError: argument of type 'Part' is not iterable
google-gemini/generative-ai-python#288To Reproduce:
Run the unit tests for version 3.0.1 to observe the failures.
Changes Made:
ContentBlock
withTextBlock
in the Anthropic library code.Environment:
This pull request ensures that all unit tests pass successfully, and the libraries are compatible with the latest updates and changes.