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:
ContentBlockhas been updated to a Union type which cannot be instantiated. It now represents bothTextBlockandToolUseBlock.ContentBlockwithTextBlockin the relevant sections of the code.OpenAI Library:
retrievaltool renamed tofile_searchassistant.file_idsparameter changed totool_resourcesmessage.file_idsparameter changed toattachmentsGemini 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.textis no longer directly accessible -TypeError: argument of type 'Part' is not iterablegoogle-gemini/deprecated-generative-ai-python#288To Reproduce:
Run the unit tests for version 3.0.1 to observe the failures.
Changes Made:
ContentBlockwithTextBlockin 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.