Skip to content

Fix vertex endpoint for newer models and responses schema #147

Merged
Ken Jiang (knjiang) merged 4 commits intomainfrom
ken/helpp
Mar 19, 2026
Merged

Fix vertex endpoint for newer models and responses schema #147
Ken Jiang (knjiang) merged 4 commits intomainfrom
ken/helpp

Conversation

@knjiang
Copy link
Contributor

No description provided.

map.insert("tool_choice".into(), Value::String("none".into()));
map.insert("tools".into(), Value::Array(vec![]));
map.insert("parallel_tool_calls".into(), Value::Bool(false));
map.insert("incomplete_details".into(), Value::Null);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

drive-by fix to allow AI SDK

Comment on lines +114 to +128
fn resolve_location(&self, spec: &ModelSpec, default_location: &str) -> String {
// Precedence: model spec locations > secret metadata location > default.
if let Ok(extra) = ::serde_json::from_value::<VertexModelExtra>(
::serde_json::Value::Object(spec.extra.clone()),
) {
if !extra.locations.is_empty() {
let idx = rand::thread_rng().gen_range(0..extra.locations.len());
return extra.locations[idx].clone();
}
}
if !self.config.location.is_empty() {
return self.config.location.clone();
}
default_location.to_string()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this matches the proxy code where we randomly choose location from the locations array for people who specify custom models with a variety of lcoations -> https://github.com/braintrustdata/braintrust-proxy/blob/main/packages/proxy/src/proxy.ts#L2451

@knjiang Ken Jiang (knjiang) merged commit 19ad4a2 into main Mar 19, 2026
5 checks passed
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