You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using ChatGoogleGenerativeAI within the latest version of the package (2.0.8). with_structured_output results in me getting this full issue:
google.api_core.exceptions.BadRequest: 400 POST https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent?%24alt=json%3Benum-encoding%3Dint: * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[overlap_classification].type: must be specified when not using one_of
2025-01-09T03:39:45.455541804Z * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[similiar_requirements].items.properties[reuse_classification].type: must be specified when not using one_of
And here is the Pydantic model that is used as the schema:
classOverlapEnum(str, Enum):
no_overlap="No-Overlap"clear_overlap="Overlap"some_overlap="Some-Overlap"classSimiliarRequirementExplanationModel(BaseModel):
id: str=Field(..., description="ID of the similar requirement")
description: str=Field(..., description="The text description of the similar requirement")
reuse_classification: OverlapEnum=Field(..., description="Classification of the similar requirement")
explanation: str=Field(..., description="Explanation of the reuse determination")
classInternalReuseModel(BaseModel):
overlap_classification: OverlapEnum=Field(
..., description="Overall classification of the requirement's overlap across the comparision groups"
)
similiar_requirements: list[SimiliarRequirementExplanationModel] =Field(
..., description="List of similar requirements and their reuse classification"
)
Can anyone help me understand this error and what I need to fix in my code?
The text was updated successfully, but these errors were encountered:
Hi all,
I am using ChatGoogleGenerativeAI within the latest version of the package (2.0.8). with_structured_output results in me getting this full issue:
google.api_core.exceptions.BadRequest: 400 POST https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent?%24alt=json%3Benum-encoding%3Dint: * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[overlap_classification].type: must be specified when not using one_of
2025-01-09T03:39:45.455541804Z * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[similiar_requirements].items.properties[reuse_classification].type: must be specified when not using one_of
And here is the Pydantic model that is used as the schema:
Can anyone help me understand this error and what I need to fix in my code?
The text was updated successfully, but these errors were encountered: