gemseo.core.grammars.pydantic_grammar module#
A grammar based on a Pydantic model.
- class PydanticGrammar(name, model=None, **kwargs)[source]#
Bases:
BaseGrammarA grammar based on a Pydantic model.
The Pydantic model passed to the grammar is used to initialize the grammar defaults. Currently, changing the defaults will not update the model. Changing the descriptions will update the model when accessing
schema.Warning
A name can be prefixed by a namespace. Never add a namespace by any other means than the method
add_namespace().Notes
Contrary to the standard dictionary, the :meth:
.copymethod creates a deep copy.Initialize self. See help(type(self)) for accurate signature.
- Parameters:
name (str) -- The name of the grammar.
model (ModelType | None) -- A Pydantic model. If
None, the model will be empty.**kwargs (Any) -- These arguments are not used.
- Raises:
ValueError -- If the name is empty.
- DATA_CONVERTER_CLASS#
alias of
DataConverter