Fix Gemini Live w/Vertex AI not being able to handle an empty list provided for "function_declarations"
This commit is contained in:
@@ -87,9 +87,11 @@ class GeminiLLMAdapter(BaseLLMAdapter[GeminiLLMInvocationParams]):
|
|||||||
Includes both converted standard tools and any custom Gemini-specific tools.
|
Includes both converted standard tools and any custom Gemini-specific tools.
|
||||||
"""
|
"""
|
||||||
functions_schema = tools_schema.standard_tools
|
functions_schema = tools_schema.standard_tools
|
||||||
formatted_standard_tools = [
|
formatted_standard_tools = (
|
||||||
{"function_declarations": [func.to_default_dict() for func in functions_schema]}
|
[{"function_declarations": [func.to_default_dict() for func in functions_schema]}]
|
||||||
]
|
if functions_schema
|
||||||
|
else []
|
||||||
|
)
|
||||||
custom_gemini_tools = []
|
custom_gemini_tools = []
|
||||||
if tools_schema.custom_tools:
|
if tools_schema.custom_tools:
|
||||||
custom_gemini_tools = tools_schema.custom_tools.get(AdapterType.GEMINI, [])
|
custom_gemini_tools = tools_schema.custom_tools.get(AdapterType.GEMINI, [])
|
||||||
|
|||||||
Reference in New Issue
Block a user