MCPcopy Index your code
hub / github.com/nonebot/nonebot2 / model_dump

Function model_dump

nonebot/compat.py:243–260  ·  view source on GitHub ↗
(
        model: BaseModel,
        include: ModelDumpIncEx = None,
        exclude: ModelDumpIncEx = None,
        by_alias: bool = False,
        exclude_unset: bool = False,
        exclude_defaults: bool = False,
        exclude_none: bool = False,
    )

Source from the content-addressed store, hash-verified

241 return model.model_config
242
243 def model_dump(
244 model: BaseModel,
245 include: ModelDumpIncEx = None,
246 exclude: ModelDumpIncEx = None,
247 by_alias: bool = False,
248 exclude_unset: bool = False,
249 exclude_defaults: bool = False,
250 exclude_none: bool = False,
251 ) -> dict[str, Any]:
252 return model.model_dump(
253 # Nested types cannot be inferred correctly
254 include=cast(Any, include),
255 exclude=cast(Any, exclude),
256 by_alias=by_alias,
257 exclude_unset=exclude_unset,
258 exclude_defaults=exclude_defaults,
259 exclude_none=exclude_none,
260 )
261
262 def type_validate_python(type_: type[T], data: Any) -> T:
263 """Validate data with given type."""

Callers 5

initFunction · 0.90
get_plugin_configFunction · 0.90
__init__Method · 0.90
__init__Method · 0.90
test_model_dumpFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_model_dumpFunction · 0.72