Skip to content

Conversation

@hellovai
Copy link
Contributor

Pull Request Template

Thanks for taking the time to fill out this pull request!

Issue Reference

Please link to any related issues

  • This PR fixes/closes #[issue number]

Changes

Please describe the changes proposed in this pull request

This PR fixes a bug where the client_response_type option was incorrectly sent to the Vertex AI API, causing a 400 "Invalid JSON payload" error.

Specifically:

  • Added client_response_type to UnresolvedVertex and ResolvedVertex structs.
  • Modified UnresolvedVertex::create_from to consume client_response_type from the client properties, preventing it from being included in the API request body.
  • Implemented a get_response_type method in VertexClient to correctly determine the response parsing strategy:
    1. Prioritizes an explicitly set client_response_type.
    2. Falls back to ResponseType::Anthropic if anthropic_version is configured.
    3. Defaults to ResponseType::Vertex.
  • Updated chat() and stream_chat() methods in VertexClient to use this new get_response_type method.

Testing

Please describe how you tested these changes

  • Unit tests added/updated
  • Manual testing performed (verified the fix addresses the 400 error and allows client_response_type: "openai" to parse responses from Vertex AI models like gpt-oss-120b-maas)
  • Tested in [environment]

Screenshots

If applicable, add screenshots to help explain your changes

[Add screenshots here...]

PR Checklist

Please ensure you've completed these items

  • I have read and followed the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Additional Notes

Add any other context about the PR here

This change allows users to configure client_response_type: "openai" for Vertex AI clients, enabling BAML to correctly parse responses from models that return OpenAI-compatible formats via Vertex AI's Model Garden.


Slack Thread

Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Dec 19, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Dec 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
promptfiddle Ready Ready Preview, Comment Dec 24, 2025 7:24pm

@cursor cursor bot temporarily deployed to boundary-tools-dev December 19, 2025 22:52 Inactive
@cursor cursor bot temporarily deployed to boundary-tools-dev December 19, 2025 22:52 Inactive
@cursor cursor bot temporarily deployed to boundary-tools-dev December 19, 2025 22:52 Inactive
@github-actions
Copy link

@github-actions
Copy link

@hellovai hellovai temporarily deployed to boundary-tools-dev December 24, 2025 19:07 — with GitHub Actions Inactive
@hellovai hellovai temporarily deployed to boundary-tools-dev December 24, 2025 19:07 — with GitHub Actions Inactive
@hellovai hellovai temporarily deployed to boundary-tools-dev December 24, 2025 19:07 — with GitHub Actions Inactive
@github-actions
Copy link

@github-actions
Copy link

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.

3 participants