Skip to content

Commit

Permalink
genai: workaround of GenerateContentRequest.tools[0].function_declara…
Browse files Browse the repository at this point in the history
…tions[0].parameters.properties[punchline].type: must be specified
  • Loading branch information
nobu007 committed Sep 22, 2024
1 parent 9212f29 commit 030ee52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/genai/langchain_google_genai/_function_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def _get_type_from_schema(schema: Dict[str, Any]) -> int:
types = [_get_type_from_schema(sub_schema) for sub_schema in schema["anyOf"]]
types = [t for t in types if t is not None] # Remove None values
if types:
return types[-1] # TODO: update FunctionDeclaration and pass all types?
return types[0] # TODO: update FunctionDeclaration and pass all types?
else:
pass
elif "type" in schema:
Expand Down

0 comments on commit 030ee52

Please sign in to comment.