Skip to content

Conversation

@JeanMertz
Copy link
Contributor

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
pub name: String,
pub description: String,
pub parameters: Option<FunctionParameters>,
pub parameters_json_schema: Option<serde_json::Value>,
Copy link
Contributor

Choose a reason for hiding this comment

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

works fine from my tests but if parameters is set it will error as parameters_json_schema can not be set when parameters is set / present in the json. You'll get an api error from gemini. though parameters can be null but not set when using parameters_json_schema

API call failed: API Error: {"context":null,"message":{"error":{"code":400,"message":"* GenerateContentRequest.tools[0].function_declarations[0].parameters_json_schema: parameters_json_schema must not be set when parameters is set.\n","status":"INVALID_ARGUMENT"}},"status":400}

so just add this and all good
#[serde(skip_serializing_if = "Option::is_none")]

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