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 bugs related to combining tools and output conformance #542

Merged
merged 8 commits into from
Jul 8, 2024

Conversation

mbleigh
Copy link
Collaborator

@mbleigh mbleigh commented Jul 4, 2024

Before, combining a tool call with output conformance could result in two different errors:

  1. Vertex response generation failed: ClientError: [VertexAI.ClientError]: Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.
  2. A schema validation error.

The first was caused by the output conformance middleware appending instructions to the last message instead of the last user role message.

The second was caused by the output schema validation trying to validate all candidates, even if the message returned contained no text or data part (e.g. a tool request).

Checklist (if applicable):

  • Tested (manually, unit tested, etc.)

js/ai/src/generate.ts Outdated Show resolved Hide resolved
@mbleigh mbleigh merged commit 8c5751c into main Jul 8, 2024
4 checks passed
@mbleigh mbleigh deleted the tool-and-output branch July 8, 2024 19:06
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