feat: support parametersJsonSchema on function declarations
Some checks failed
Rust / build (pull_request) Has been cancelled

FunctionDeclaration.parameters becomes Option<Value>, and the new
parameters_json_schema field sends the schema as JSON Schema. Vertex
rejects many JSON Schema keywords in parameters ($schema, $ref/$defs,
const, type arrays) but accepts them in parametersJsonSchema. Both
fields are skipped when None, since Vertex rejects a declaration that
sets both.
This commit is contained in:
2026-10-18 08:34:56 +01:00
parent 69532ad110
commit 43cf7933fc
2 changed files with 38 additions and 3 deletions

View File

@@ -45,7 +45,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
function_declarations: Some(vec![FunctionDeclaration {
name: "take_snapshot".to_string(),
description: "Takes a snapshot of the camera and returns it as an image.".to_string(),
parameters: json!({"type": "object", "properties": {}}),
parameters: Some(json!({"type": "object", "properties": {}})),
parameters_json_schema: None,
}]),
..Default::default()
}];