feat: support parametersJsonSchema on function declarations
Some checks failed
Rust / build (pull_request) Has been cancelled
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:
@@ -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()
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user