Skip to content

Conversation

@elliotb
Copy link
Contributor

@elliotb elliotb commented Sep 27, 2024

When using a newer model variant such as gemini-1.5-pro-002, we occasionally receive empty text parts in the response, which was causing the validation of ContentParts to fail.

This PR filters those before creating the content part.

Copy link
Owner

@brainlid brainlid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks!

❤️💛💙💜

@brainlid brainlid merged commit c2ee679 into brainlid:main Sep 29, 2024
1 check passed
@elliotb elliotb deleted the google-empty-text branch September 30, 2024 14:49
brainlid added a commit that referenced this pull request Oct 28, 2024
* 'main' of github.com:brainlid/langchain:
  Add AWS Bedrock support to ChatAnthropic (#154)
  Handle functions with no parameters for Google AI (#183)
  Handle missing token usage fields for Google AI (#184)
  Handle empty text parts from GoogleAI responses (#181)
  Support system instructions for Google AI (#182)
  feat: add OpenAI's new structured output API (#180)
  Support strict mode for tools (#173)
  Do not duplicate tool call parameters if they are identical (#174)
  🐛 cast tool_calls arguments correctly inside message_deltas (#175)
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