Open dayglo opened 5 hours ago
Hey, @dayglo! I'm here to help you with any bugs or questions you have. Let's tackle this together!
The error you're encountering seems to be related to the to_gemini_tools
function in the VertexAI integration of the LlamaIndex library. This function is responsible for converting tool specifications into a format compatible with the Gemini model in VertexAI. The error message indicates that the Schema
type in google.cloud.aiplatform.v1beta1
does not have a field named $defs
, which suggests that the parameters
field in your FunctionDeclaration
might be incorrectly structured or contains unexpected fields.
To resolve this issue, you should ensure that the parameters
field in your FunctionDeclaration
is correctly formatted according to the expected schema. The parameters
should match the available fields in the Schema
type, such as type
, format
, title
, description
, nullable
, default
, items
, minItems
, maxItems
, enum
, properties
, propertyOrdering
, required
, minProperties
, maxProperties
, minimum
, maximum
, minLength
, maxLength
, pattern
, example
, and anyOf
.
Review the structure of the parameters
you are passing to ensure it aligns with these fields and does not include any unsupported fields like $defs
. This should help in resolving the ParseError
you are experiencing.
To continue talking to Dosu, mention @dosu.
Bug Description
Im having a bit of trouble with wrapping a VertexAI llm as a structured LLM. It works fine with openai.
I set it up with
sllm = llm.as_structured_llm(output_cls=MyClass)
But then when calling it, I get
I had a look through the issues on here and noticed that someone is getting a similar error message(
google.protobuf.json_format.ParseError: Message type "google.cloud.aiplatform.v1beta1.Schema" has no field named "$defs" at "Schema".
), but their use case is with function calling, not structured output.Version
llama-index 0.11.21
Steps to Reproduce
As above
Relevant Logs/Tracbacks
No response