> ## Documentation Index
> Fetch the complete documentation index at: https://private-04b27de1.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.coding.jupyter.EmbeddedIPythonCodeExecutor

<h2 id="autogen.coding.jupyter.EmbeddedIPythonCodeExecutor" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

  <span class="doc doc-object-name doc-class-name">EmbeddedIPythonCodeExecutor</span>
</h2>

```python theme={null}
EmbeddedIPythonCodeExecutor(**kwargs: Any)
```

(Experimental) A code executor class that executes code statefully using an embedded
IPython kernel managed by this class.<br />**This will execute LLM generated code on the local machine.**

Each execution is stateful and can access variables created from previous
executions in the same session. The kernel must be installed before using
this class. The kernel can be installed using the following command: <br />`python -m ipykernel install --user --name \{kernel_name}`
where `kernel_name` is the name of the kernel to install.<br />Create a new model by parsing and validating input data from keyword arguments.<br />Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.<br />`self` is explicitly positional-only to allow `self` as a field name.

<b>Parameters:</b>

| Name       | Description   |
| ---------- | ------------- |
| `**kwargs` | **Type:** Any |

### Class Attributes

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### kernel\_name

<br />

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### model\_computed\_fields

<br />

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### model\_config

<br />

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### model\_fields

<br />

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### output\_dir

<br />

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### timeout

<br />

<br />

### Instance Attributes

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### code\_extractor

<br />

(Experimental) Export a code extractor that can be used by an agent.

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### model\_extra

<br />

Get extra fields set during validation.<br />Returns: <br />    A dictionary of extra fields, or `None` if `config.extra` is not set to `"allow"`.

<code class="doc-symbol doc-symbol-heading doc-symbol-attribute" />

#### model\_fields\_set

<br />

Returns the set of fields that have been explicitly set on this model instance.<br />Returns: <br />    A set of strings representing the fields that have been set,
i.e. that were not filled from defaults.

### Instance Methods

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### construct

```python theme={null}
construct(**values: Any) -> Self
```

<b>Parameters:</b>

| Name       | Description   |
| ---------- | ------------- |
| `**values` | **Type:** Any |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### copy

```python theme={null}
copy(
    self,
    *,
    include: AbstractSetIntStr | MappingIntStrAny | None = None,
    exclude: AbstractSetIntStr | MappingIntStrAny | None = None,
    update: Dict[str, Any] | None = None,
    deep: bool = False
) -> Self
```

Returns a copy of the model.<br />!!! warning "Deprecated"
This method is now deprecated; use `model_copy` instead.<br />If you need `include` or `exclude`, use:

```python {test="skip" lint="skip"} theme={null}
data = self.model_dump(include=include, exclude=exclude, round_trip=True)
data = \{**data, **(update or \{})}
copied = self.model_validate(data)
```

<b>Parameters:</b>

| Name      | Description                                                                                                                                                                     |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `include` | Optional set or mapping specifying which fields to include in the copied model.<br /><br />**Type:** AbstractSetIntStr \| MappingIntStrAny \| None<br /><br />**Default:** None |
| `exclude` | Optional set or mapping specifying which fields to exclude in the copied model.<br /><br />**Type:** AbstractSetIntStr \| MappingIntStrAny \| None<br /><br />**Default:** None |
| `update`  | Optional dictionary of field-value pairs to override field values in the copied model.<br /><br />**Type:** Dict\[str, Any] \| None<br /><br />**Default:** None                |
| `deep`    | If True, the values of fields that are Pydantic models will be deep-copied.<br /><br />**Type:** bool<br /><br />**Default:** False                                             |

<b>Returns:</b>

| Type | Description                                                                  |
| ---- | ---------------------------------------------------------------------------- |
| Self | A copy of the model with included, excluded and updated fields as specified. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### dict

```python theme={null}
dict(
    self,
    *,
    include: IncEx | None = None,
    exclude: IncEx | None = None,
    by_alias: bool = False,
    exclude_unset: bool = False,
    exclude_defaults: bool = False,
    exclude_none: bool = False
) -> Dict[str, Any]
```

<b>Parameters:</b>

| Name               | Description                                          |
| ------------------ | ---------------------------------------------------- |
| `include`          | **Type:** IncEx \| None<br /><br />**Default:** None |
| `exclude`          | **Type:** IncEx \| None<br /><br />**Default:** None |
| `by_alias`         | **Type:** bool<br /><br />**Default:** False         |
| `exclude_unset`    | **Type:** bool<br /><br />**Default:** False         |
| `exclude_defaults` | **Type:** bool<br /><br />**Default:** False         |
| `exclude_none`     | **Type:** bool<br /><br />**Default:** False         |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### execute\_code\_blocks

```python theme={null}
execute_code_blocks(self, code_blocks: list[CodeBlock]) -> IPythonCodeResult
```

(Experimental) Execute a list of code blocks and return the result.<br />This method executes a list of code blocks as cells in an IPython kernel
managed by this class.<br />See: [https://jupyter-client.readthedocs.io/en/stable/messaging.html](https://jupyter-client.readthedocs.io/en/stable/messaging.html)
for the message protocol.<br />

<b>Parameters:</b>

| Name          | Description                                                                                                             |
| ------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `code_blocks` | A list of code blocks to execute.<br /><br />**Type:** list\[[CodeBlock](/docs/api-reference/autogen/coding/CodeBlock)] |

<b>Returns:</b>

| Type                                  | Description                                          |
| ------------------------------------- | ---------------------------------------------------- |
| autogen.coding.base.IPythonCodeResult | IPythonCodeResult: The result of the code execution. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### from\_orm

```python theme={null}
from_orm(obj: Any) -> Self
```

<b>Parameters:</b>

| Name  | Description   |
| ----- | ------------- |
| `obj` | **Type:** Any |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### json

```python theme={null}
json(
    self,
    *,
    include: IncEx | None = None,
    exclude: IncEx | None = None,
    by_alias: bool = False,
    exclude_unset: bool = False,
    exclude_defaults: bool = False,
    exclude_none: bool = False,
    encoder: Callable[[Any], Any] | None = PydanticUndefined,
    models_as_dict: bool = PydanticUndefined,
    **dumps_kwargs: Any
) -> str
```

<b>Parameters:</b>

| Name               | Description                                                                        |
| ------------------ | ---------------------------------------------------------------------------------- |
| `include`          | **Type:** IncEx \| None<br /><br />**Default:** None                               |
| `exclude`          | **Type:** IncEx \| None<br /><br />**Default:** None                               |
| `by_alias`         | **Type:** bool<br /><br />**Default:** False                                       |
| `exclude_unset`    | **Type:** bool<br /><br />**Default:** False                                       |
| `exclude_defaults` | **Type:** bool<br /><br />**Default:** False                                       |
| `exclude_none`     | **Type:** bool<br /><br />**Default:** False                                       |
| `encoder`          | **Type:** Callable\[\[Any], Any] \| None<br /><br />**Default:** PydanticUndefined |
| `models_as_dict`   | **Type:** bool<br /><br />**Default:** PydanticUndefined                           |
| `**dumps_kwargs`   | **Type:** Any                                                                      |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_construct

```python theme={null}
model_construct(**values: Any) -> Self
```

Creates a new instance of the `Model` class with validated data.<br />Creates a new model setting `__dict__` and `__pydantic_fields_set__` from trusted or pre-validated data.<br />Default values are respected, but no other validation is performed.<br />!!! note
`model_construct()` generally respects the `model_config.extra` setting on the provided model.<br />    That is, if `model_config.extra == 'allow'`, then all extra passed values are added to the model instance's `__dict__`
and `__pydantic_extra__` fields. If `model_config.extra == 'ignore'` (the default), then all extra passed values are ignored.<br />    Because no validation is performed with a call to `model_construct()`, having `model_config.extra == 'forbid'` does not result in
an error if extra values are passed, but they will be ignored.<br />

<b>Parameters:</b>

| Name       | Description   |
| ---------- | ------------- |
| `**values` | **Type:** Any |

<b>Returns:</b>

| Type | Description                                              |
| ---- | -------------------------------------------------------- |
| Self | A new instance of the `Model` class with validated data. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_copy

```python theme={null}
model_copy(
    self,
    *,
    update: Mapping[str, Any] | None = None,
    deep: bool = False
) -> Self
```

!!! abstract "Usage Documentation"
[`model_copy`](/docs/api-reference/autogen/coding/concepts/serialization#model_copy)

Returns a copy of the model.<br />!!! note
The underlying instance's \[`__dict__`]\[object.**dict**] attribute is copied. This
might have unexpected side effects if you store anything in it, on top of the model
fields (e.g. the value of \[cached properties]\[functools.cached\_property]).<br />

<b>Parameters:</b>

| Name     | Description                                                                                                                                                                                                                          |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `update` | Values to change/add in the new model.<br /><br />Note: the data is not validated before creating the new model.<br /><br />You should trust this data.<br /><br />**Type:** Mapping\[str, Any] \| None<br /><br />**Default:** None |
| `deep`   | Set to `True` to make a deep copy of the model.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                              |

<b>Returns:</b>

| Type | Description         |
| ---- | ------------------- |
| Self | New model instance. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_dump

```python theme={null}
model_dump(
    self,
    *,
    mode: "Literal['json', 'python'] | str" = 'python',
    include: IncEx | None = None,
    exclude: IncEx | None = None,
    context: Any | None = None,
    by_alias: bool | None = None,
    exclude_unset: bool = False,
    exclude_defaults: bool = False,
    exclude_none: bool = False,
    round_trip: bool = False,
    warnings: "bool | Literal['none', 'warn', 'error']" = True,
    fallback: Callable[[Any], Any] | None = None,
    serialize_as_any: bool = False
) -> dict[str, Any]
```

!!! abstract "Usage Documentation"
[`model_dump`](/docs/api-reference/autogen/coding/concepts/serialization#modelmodel_dump)

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.<br />

<b>Parameters:</b>

| Name               | Description                                                                                                                                                                                                                                                                                                          |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mode`             | The mode in which `to_python` should run.<br /><br />If mode is 'json', the output will only contain JSON serializable types.<br /><br />If mode is 'python', the output may contain non-JSON-serializable Python objects.<br /><br />**Type:** "Literal\['json', 'python'] \| str"<br /><br />**Default:** 'python' |
| `include`          | A set of fields to include in the output.<br /><br />**Type:** IncEx \| None<br /><br />**Default:** None                                                                                                                                                                                                            |
| `exclude`          | A set of fields to exclude from the output.<br /><br />**Type:** IncEx \| None<br /><br />**Default:** None                                                                                                                                                                                                          |
| `context`          | Additional context to pass to the serializer.<br /><br />**Type:** Any \| None<br /><br />**Default:** None                                                                                                                                                                                                          |
| `by_alias`         | Whether to use the field's alias in the dictionary key if defined.<br /><br />**Type:** bool \| None<br /><br />**Default:** None                                                                                                                                                                                    |
| `exclude_unset`    | Whether to exclude fields that have not been explicitly set.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                                                 |
| `exclude_defaults` | Whether to exclude fields that are set to their default value.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                                               |
| `exclude_none`     | Whether to exclude fields that have a value of `None`.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                                                       |
| `round_trip`       | If True, dumped values should be valid as input for non-idempotent types such as Json\[T].<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                   |
| `warnings`         | How to handle serialization errors.<br /><br />False/"none" ignores them, True/"warn" logs errors, "error" raises a \[`PydanticSerializationError`]\[pydantic\_core.PydanticSerializationError].<br /><br />**Type:** "bool \| Literal\['none', 'warn', 'error']"<br /><br />**Default:** True                       |
| `fallback`         | A function to call when an unknown value is encountered.<br /><br />If not provided, a \[`PydanticSerializationError`]\[pydantic\_core.PydanticSerializationError] error is raised.<br /><br />**Type:** Callable\[\[Any], Any] \| None<br /><br />**Default:** None                                                 |
| `serialize_as_any` | Whether to serialize fields with duck-typing serialization behavior.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                                         |

<b>Returns:</b>

| Type                   | Description                               |
| ---------------------- | ----------------------------------------- |
| dict\[str, typing.Any] | A dictionary representation of the model. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_dump\_json

```python theme={null}
model_dump_json(
    self,
    *,
    indent: int | None = None,
    include: IncEx | None = None,
    exclude: IncEx | None = None,
    context: Any | None = None,
    by_alias: bool | None = None,
    exclude_unset: bool = False,
    exclude_defaults: bool = False,
    exclude_none: bool = False,
    round_trip: bool = False,
    warnings: "bool | Literal['none', 'warn', 'error']" = True,
    fallback: Callable[[Any], Any] | None = None,
    serialize_as_any: bool = False
) -> str
```

!!! abstract "Usage Documentation"
[`model_dump_json`](/docs/api-reference/autogen/coding/concepts/serialization#modelmodel_dump_json)

Generates a JSON representation of the model using Pydantic's `to_json` method.<br />

<b>Parameters:</b>

| Name               | Description                                                                                                                                                                                                                                                                                    |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `indent`           | Indentation to use in the JSON output.<br /><br />If None is passed, the output will be compact.<br /><br />**Type:** int \| None<br /><br />**Default:** None                                                                                                                                 |
| `include`          | Field(s) to include in the JSON output.<br /><br />**Type:** IncEx \| None<br /><br />**Default:** None                                                                                                                                                                                        |
| `exclude`          | Field(s) to exclude from the JSON output.<br /><br />**Type:** IncEx \| None<br /><br />**Default:** None                                                                                                                                                                                      |
| `context`          | Additional context to pass to the serializer.<br /><br />**Type:** Any \| None<br /><br />**Default:** None                                                                                                                                                                                    |
| `by_alias`         | Whether to serialize using field aliases.<br /><br />**Type:** bool \| None<br /><br />**Default:** None                                                                                                                                                                                       |
| `exclude_unset`    | Whether to exclude fields that have not been explicitly set.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                           |
| `exclude_defaults` | Whether to exclude fields that are set to their default value.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                         |
| `exclude_none`     | Whether to exclude fields that have a value of `None`.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                                 |
| `round_trip`       | If True, dumped values should be valid as input for non-idempotent types such as Json\[T].<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                             |
| `warnings`         | How to handle serialization errors.<br /><br />False/"none" ignores them, True/"warn" logs errors, "error" raises a \[`PydanticSerializationError`]\[pydantic\_core.PydanticSerializationError].<br /><br />**Type:** "bool \| Literal\['none', 'warn', 'error']"<br /><br />**Default:** True |
| `fallback`         | A function to call when an unknown value is encountered.<br /><br />If not provided, a \[`PydanticSerializationError`]\[pydantic\_core.PydanticSerializationError] error is raised.<br /><br />**Type:** Callable\[\[Any], Any] \| None<br /><br />**Default:** None                           |
| `serialize_as_any` | Whether to serialize fields with duck-typing serialization behavior.<br /><br />**Type:** bool<br /><br />**Default:** False                                                                                                                                                                   |

<b>Returns:</b>

| Type | Description                                |
| ---- | ------------------------------------------ |
| str  | A JSON string representation of the model. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_json\_schema

```python theme={null}
model_json_schema(
    by_alias: bool = True,
    ref_template: str = '#/$defs/{model}',
    schema_generator: type[GenerateJsonSchema] = pydantic.json_schema.GenerateJsonSchema,
    mode: JsonSchemaMode = 'validation'
) -> dict[str, Any]
```

Generates a JSON schema for a model class.<br />

<b>Parameters:</b>

| Name               | Description                                                                                                                                                                                                                                   |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `by_alias`         | Whether to use attribute aliases or not.<br /><br />**Type:** bool<br /><br />**Default:** True                                                                                                                                               |
| `ref_template`     | The reference template.<br /><br />**Type:** str<br /><br />**Default:** '#/\$defs/\{model}'                                                                                                                                                  |
| `schema_generator` | To override the logic used to generate the JSON schema, as a subclass of `GenerateJsonSchema` with your desired modifications<br /><br />**Type:** type\[GenerateJsonSchema]<br /><br />**Default:** pydantic.json\_schema.GenerateJsonSchema |
| `mode`             | The mode in which to generate the schema.<br /><br />**Type:** JsonSchemaMode<br /><br />**Default:** 'validation'                                                                                                                            |

<b>Returns:</b>

| Type                   | Description                                |
| ---------------------- | ------------------------------------------ |
| dict\[str, typing.Any] | The JSON schema for the given model class. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_parametrized\_name

```python theme={null}
model_parametrized_name(params: tuple[type[Any], ...]) -> str
```

Compute the class name for parametrizations of generic classes.<br />This method can be overridden to achieve a custom naming scheme for generic BaseModels.<br />

<b>Parameters:</b>

| Name     | Description                                                                                                                                                                                                                          |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `params` | Tuple of types of the class.<br /><br />Given a generic class `Model` with 2 type variables and a concrete model `Model[str, int]`, the value `(str, int)` would be passed to `params`.<br /><br />**Type:** tuple\[type\[Any], ...] |

<b>Returns:</b>

| Type | Description                                                                             |
| ---- | --------------------------------------------------------------------------------------- |
| str  | String representing the new class where `params` are passed to `cls` as type variables. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_post\_init

```python theme={null}
model_post_init(
    self,
    context: Any,
    /
) -> None
```

Override this method to perform additional initialization after `__init__` and `model_construct`.<br />This is useful if you want to do some validation that requires the entire model to be initialized.

<b>Parameters:</b>

| Name      | Description   |
| --------- | ------------- |
| `context` | **Type:** Any |
| `/`       |               |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_rebuild

```python theme={null}
model_rebuild(
    *,
    force: bool = False,
    raise_errors: bool = True
) -> 
```

Try to rebuild the pydantic-core schema for the model.<br />This may be necessary when one of the annotations is a ForwardRef which could not be resolved during
the initial attempt to build the schema, and automatic rebuilding fails.<br />

<b>Parameters:</b>

| Name           | Description                                                                                                                       |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `force`        | Whether to force the rebuilding of the model schema, defaults to `False`.<br /><br />**Type:** bool<br /><br />**Default:** False |
| `raise_errors` | Whether to raise errors, defaults to `True`.<br /><br />**Type:** bool<br /><br />**Default:** True                               |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_validate

```python theme={null}
model_validate(
    obj: Any,
    *,
    strict: bool | None = None,
    from_attributes: bool | None = None,
    context: Any | None = None,
    by_alias: bool | None = None,
    by_name: bool | None = None
) -> Self
```

Validate a pydantic model instance.<br />

<b>Parameters:</b>

| Name              | Description                                                                                                                                      |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `obj`             | The object to validate.<br /><br />**Type:** Any                                                                                                 |
| `strict`          | Whether to enforce types strictly.<br /><br />**Type:** bool \| None<br /><br />**Default:** None                                                |
| `from_attributes` | Whether to extract data from object attributes.<br /><br />**Type:** bool \| None<br /><br />**Default:** None                                   |
| `context`         | Additional context to pass to the validator.<br /><br />**Type:** Any \| None<br /><br />**Default:** None                                       |
| `by_alias`        | Whether to use the field's alias when validating against the provided input data.<br /><br />**Type:** bool \| None<br /><br />**Default:** None |
| `by_name`         | Whether to use the field's name when validating against the provided input data.<br /><br />**Type:** bool \| None<br /><br />**Default:** None  |

<b>Returns:</b>

| Type | Description                   |
| ---- | ----------------------------- |
| Self | The validated model instance. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_validate\_json

```python theme={null}
model_validate_json(
    json_data: str | bytes | bytearray,
    *,
    strict: bool | None = None,
    context: Any | None = None,
    by_alias: bool | None = None,
    by_name: bool | None = None
) -> Self
```

!!! abstract "Usage Documentation"
[JSON Parsing](/docs/api-reference/autogen/coding/concepts/json#json-parsing)

Validate the given JSON data against the Pydantic model.<br />

<b>Parameters:</b>

| Name        | Description                                                                                                                                      |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `json_data` | The JSON data to validate.<br /><br />**Type:** str \| bytes \| bytearray                                                                        |
| `strict`    | Whether to enforce types strictly.<br /><br />**Type:** bool \| None<br /><br />**Default:** None                                                |
| `context`   | Extra variables to pass to the validator.<br /><br />**Type:** Any \| None<br /><br />**Default:** None                                          |
| `by_alias`  | Whether to use the field's alias when validating against the provided input data.<br /><br />**Type:** bool \| None<br /><br />**Default:** None |
| `by_name`   | Whether to use the field's name when validating against the provided input data.<br /><br />**Type:** bool \| None<br /><br />**Default:** None  |

<b>Returns:</b>

| Type | Description                   |
| ---- | ----------------------------- |
| Self | The validated Pydantic model. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### model\_validate\_strings

```python theme={null}
model_validate_strings(
    obj: Any,
    *,
    strict: bool | None = None,
    context: Any | None = None,
    by_alias: bool | None = None,
    by_name: bool | None = None
) -> Self
```

Validate the given object with string data against the Pydantic model.<br />

<b>Parameters:</b>

| Name       | Description                                                                                                                                      |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `obj`      | The object containing string data to validate.<br /><br />**Type:** Any                                                                          |
| `strict`   | Whether to enforce types strictly.<br /><br />**Type:** bool \| None<br /><br />**Default:** None                                                |
| `context`  | Extra variables to pass to the validator.<br /><br />**Type:** Any \| None<br /><br />**Default:** None                                          |
| `by_alias` | Whether to use the field's alias when validating against the provided input data.<br /><br />**Type:** bool \| None<br /><br />**Default:** None |
| `by_name`  | Whether to use the field's name when validating against the provided input data.<br /><br />**Type:** bool \| None<br /><br />**Default:** None  |

<b>Returns:</b>

| Type | Description                   |
| ---- | ----------------------------- |
| Self | The validated Pydantic model. |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### parse\_file

```python theme={null}
parse_file(
    path: str | Path,
    *,
    content_type: str | None = None,
    encoding: str = 'utf8',
    proto: DeprecatedParseProtocol | None = None,
    allow_pickle: bool = False
) -> 
```

<b>Parameters:</b>

| Name           | Description                                                            |
| -------------- | ---------------------------------------------------------------------- |
| `path`         | **Type:** str \| Path                                                  |
| `content_type` | **Type:** str \| None<br /><br />**Default:** None                     |
| `encoding`     | **Type:** str<br /><br />**Default:** 'utf8'                           |
| `proto`        | **Type:** DeprecatedParseProtocol \| None<br /><br />**Default:** None |
| `allow_pickle` | **Type:** bool<br /><br />**Default:** False                           |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### parse\_obj

```python theme={null}
parse_obj(obj: Any) -> Self
```

<b>Parameters:</b>

| Name  | Description   |
| ----- | ------------- |
| `obj` | **Type:** Any |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### parse\_raw

```python theme={null}
parse_raw(
    b: str | bytes,
    *,
    content_type: str | None = None,
    encoding: str = 'utf8',
    proto: DeprecatedParseProtocol | None = None,
    allow_pickle: bool = False
) -> 
```

<b>Parameters:</b>

| Name           | Description                                                            |
| -------------- | ---------------------------------------------------------------------- |
| `b`            | **Type:** str \| bytes                                                 |
| `content_type` | **Type:** str \| None<br /><br />**Default:** None                     |
| `encoding`     | **Type:** str<br /><br />**Default:** 'utf8'                           |
| `proto`        | **Type:** DeprecatedParseProtocol \| None<br /><br />**Default:** None |
| `allow_pickle` | **Type:** bool<br /><br />**Default:** False                           |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### restart

```python theme={null}
restart(self) -> None
```

(Experimental) Restart a new session.

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### schema

```python theme={null}
schema(by_alias: bool = True, ref_template: str = '#/$defs/{model}') -> Dict[str, Any]
```

<b>Parameters:</b>

| Name           | Description                                               |
| -------------- | --------------------------------------------------------- |
| `by_alias`     | **Type:** bool<br /><br />**Default:** True               |
| `ref_template` | **Type:** str<br /><br />**Default:** '#/\$defs/\{model}' |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### schema\_json

```python theme={null}
schema_json(
    *,
    by_alias: bool = True,
    ref_template: str = '#/$defs/{model}',
    **dumps_kwargs: Any
) -> str
```

<b>Parameters:</b>

| Name             | Description                                               |
| ---------------- | --------------------------------------------------------- |
| `by_alias`       | **Type:** bool<br /><br />**Default:** True               |
| `ref_template`   | **Type:** str<br /><br />**Default:** '#/\$defs/\{model}' |
| `**dumps_kwargs` | **Type:** Any                                             |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### update\_forward\_refs

```python theme={null}
update_forward_refs(**localns: Any) -> None
```

<b>Parameters:</b>

| Name        | Description   |
| ----------- | ------------- |
| `**localns` | **Type:** Any |

<br />

<code class="doc-symbol doc-symbol-heading doc-symbol-method" />

#### validate

```python theme={null}
validate(value: Any) -> Self
```

<b>Parameters:</b>

| Name    | Description   |
| ------- | ------------- |
| `value` | **Type:** Any |

<br />
