Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does "Key '$defs' is not supported in schema, ignoring" mean? #659

Open
pinkponk opened this issue Dec 19, 2024 · 1 comment
Open

Comments

@pinkponk
Copy link

pinkponk commented Dec 19, 2024

I keep getting Key '$defs' is not supported in schema, ignoring when I use gemini flash 1.5 with structured output but I can't seem to understand what the warning means. Cannot find anything on the web. Anyone knows? I think it might have something to do with nested pydantic models

I use the langchain-google-vertexai pkg at version 2.0.9

@RobSisson
Copy link

I've hit the same issue when doing the Langgraph Academy course in module 5 - I believe it occurs for me when using a nested schema in Trustcall with gemini-1.5-flash.

Not sure if this is gemini / vertex ai related, as I've hit some other bugs throughout the course when running the provided notebooks without changing anything other than the model.

One which I'll highlight is another one which I've not been able to solve and also relates to using Trustcall.

Error: 'Key 'examples' is not supported in schema, ignoring'

Circumstance: Using gemini-1.5-flash to update an existing collection using Trustcall

# Invoke the extractor with our updated conversation and existing memories result = trustcall_extractor.invoke({"messages": updated_conversation, "existing": existing_memories})

Schema:
`from pydantic import BaseModel, Field

class Memory(BaseModel):
content: str = Field(description="The main content of the memory. For example: User expressed interest in learning about French.")

class MemoryCollection(BaseModel):
memories: list[Memory] = Field(description="A list of memories about the user.")`

Unsolved: I think it is relating to gemini struggling to respond when the with_structured_output function, and it continuously generates the "example" field value which trustcall can't deal with.

I've tried changing the trustcall prompt and putting the temperature to 0, both with no luck.

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

No branches or pull requests

2 participants