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 have searched Google & GitHub for similar requests and couldn't find anything
I have read and followed the docs and still think this feature is missing
Description
LLM plugin Frameworks like Langchain require model to genearte a function call which is basically a json string, include fields like function_name, params, so that LLMs can extent their abilities to real world applications. However, LLMs generate the json string without any constraint related to the json schema of function definition, which cases some challenges to this LLM plugin idea. for example , LLMs may call a function that doesn't exist !
Projects like clownfish provides a stream json parser which can constrain LLMs to follow given JSON schema during generating the JSON string. However this project only supports very few features in pydantic and I deeply doubt it's perfermance. And I do believe you are the best to provide with this feature! I do believe this can be a great contribution to LLM community.
@samuelcolvin has implemented this in pydantic-core, and this should be released with 2.7, our upcoming minor release 🚀. Thus, marking this as closed :).
Initial Checks
Description
LLM plugin Frameworks like Langchain require model to genearte a function call which is basically a json string, include fields like function_name, params, so that LLMs can extent their abilities to real world applications. However, LLMs generate the json string without any constraint related to the json schema of function definition, which cases some challenges to this LLM plugin idea. for example , LLMs may call a function that doesn't exist !
Projects like clownfish provides a stream json parser which can constrain LLMs to follow given JSON schema during generating the JSON string. However this project only supports very few features in pydantic and I deeply doubt it's perfermance. And I do believe you are the best to provide with this feature! I do believe this can be a great contribution to LLM community.
Affected Components
.model_dump()
and.model_dump_json()
model_construct()
, pickling, private attributes, ORM modeThe text was updated successfully, but these errors were encountered: