Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Unit Test Failures in OpenAI, Anthropic, and Google Gemini Resolvers #1537

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sakher
Copy link

@sakher sakher commented Jun 24, 2024

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:

  1. Anthropic Library:

    • Issue: The type ContentBlock has been updated to a Union type which cannot be instantiated. It now represents both TextBlock and ToolUseBlock.
      ContentBlock = Annotated[Union[TextBlock, ToolUseBlock], PropertyInfo(discriminator="type")]
    • Fix: Replaced ContentBlock with TextBlock in the relevant sections of the code.
  2. OpenAI Library:

    • Issue: The assistant API has breaking changes:
      • retrieval tool renamed to file_search
      • assistant.file_ids parameter changed to tool_resources
      • message.file_ids parameter changed to attachments
    • Fix: Updated the code to reflect these changes.
  3. Gemini Library:

To Reproduce:
Run the unit tests for version 3.0.1 to observe the failures.

Changes Made:

  • Replaced ContentBlock with TextBlock in the Anthropic library code.
  • Updated the assistant API in the OpenAI library to use the new parameters and tool names.
  • Added a workaround to handle the protobuf parsing issue in the Gemini library.

Environment:

  • OS: macOS
  • Python Version: 3.9.0
  • Library Version: 3.0.1

This pull request ensures that all unit tests pass successfully, and the libraries are compatible with the latest updates and changes.

image

@sakher sakher changed the title Fixed anthropic contentblock Fixed anthropic ContentBlock -> TextBlock Breaking Change Jun 24, 2024
@sakher sakher force-pushed the fixed_anthropic_contentblock branch from f396ebc to d5405cd Compare June 24, 2024 18:58
@sakher sakher force-pushed the fixed_anthropic_contentblock branch from d5405cd to 6e52b4f Compare June 24, 2024 19:27
retrieval -> file_search
assistant.file_ids -> tool_resources
message.file_ids -> attachments
@sakher sakher changed the title Fixed anthropic ContentBlock -> TextBlock Breaking Change Fixed unit test failures Jun 24, 2024
@sakher sakher changed the title Fixed unit test failures Fix Unit Test Failures in OpenAI, Anthropic, and Google Gemini Libraries Jun 24, 2024
@sakher sakher changed the title Fix Unit Test Failures in OpenAI, Anthropic, and Google Gemini Libraries Fix Unit Test Failures in OpenAI, Anthropic, and Google Gemini Resolvers Jun 24, 2024
@sakher
Copy link
Author

sakher commented Jul 7, 2024

F

Hi @ikrnwath sorry but I am not sure what you mean.
Please let me know if I need to make any changes .

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.

2 participants