> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ag2.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# autogen.LLMConfig

<h2 id="autogen.LLMConfig" class="doc doc-heading">
  <code class="doc-symbol doc-symbol-heading doc-symbol-class" />

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

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

<b>Parameters:</b>

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

### Static Methods

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

#### from\_json

```python theme={null}
from_json(
    *,
    env: str | None = None,
    path: str | Path | None = None,
    file_location: str | None = None,
    **kwargs: Any
) -> LLMConfig
```

<b>Parameters:</b>

| Name            | Description                                                        |
| --------------- | ------------------------------------------------------------------ |
| `env`           | **Type:** str \| None<br /><br />**Default:** None                 |
| `path`          | **Type:** str \| pathlib.Path \| None<br /><br />**Default:** None |
| `file_location` | **Type:** str \| None<br /><br />**Default:** None                 |
| `**kwargs`      | **Type:** Any                                                      |

<br />

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

#### get\_current\_llm\_config

```python theme={null}
get_current_llm_config(llm_config: Optional[LLMConfig] = None) -> LLMConfig | None
```

<b>Parameters:</b>

| Name         | Description                                                                                          |
| ------------ | ---------------------------------------------------------------------------------------------------- |
| `llm_config` | **Type:** Optional\[[LLMConfig](/docs/api-reference/autogen/LLMConfig)]<br /><br />**Default:** None |

<br />

### Instance Methods

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

#### copy

```python theme={null}
copy(self) -> LLMConfig
```

<br />

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

#### deepcopy

```python theme={null}
deepcopy(self, memo: dict[int, Any] | None = None) -> LLMConfig
```

<b>Parameters:</b>

| Name   | Description                                                           |
| ------ | --------------------------------------------------------------------- |
| `memo` | **Type:** dict\[int, typing.Any] \| None<br /><br />**Default:** None |

<br />

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

#### get

```python theme={null}
get(
    self,
    key: str,
    default: Any | None = None
) -> Any
```

<b>Parameters:</b>

| Name      | Description                                        |
| --------- | -------------------------------------------------- |
| `key`     | **Type:** str                                      |
| `default` | **Type:** Any \| None<br /><br />**Default:** None |

<br />

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

#### items

```python theme={null}
items(self) -> Iterable[tuple[str, Any]]
```

<br />

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

#### keys

```python theme={null}
keys(self) -> Iterable[str]
```

<br />

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

#### model\_dump

```python theme={null}
model_dump(
    self,
    *args: Any,
    exclude_none: bool = True,
    **kwargs: Any
) -> dict[str, Any]
```

<b>Parameters:</b>

| Name           | Description                                 |
| -------------- | ------------------------------------------- |
| `*args`        | **Type:** Any                               |
| `exclude_none` | **Type:** bool<br /><br />**Default:** True |
| `**kwargs`     | **Type:** Any                               |

<br />

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

#### model\_dump\_json

```python theme={null}
model_dump_json(
    self,
    *args: Any,
    exclude_none: bool = True,
    **kwargs: Any
) -> str
```

<b>Parameters:</b>

| Name           | Description                                 |
| -------------- | ------------------------------------------- |
| `*args`        | **Type:** Any                               |
| `exclude_none` | **Type:** bool<br /><br />**Default:** True |
| `**kwargs`     | **Type:** Any                               |

<br />

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

#### model\_validate

```python theme={null}
model_validate(
    self,
    *args: Any,
    **kwargs: Any
) -> Any
```

<b>Parameters:</b>

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

<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/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" />

#### values

```python theme={null}
values(self) -> Iterable[Any]
```

<br />

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

#### where

```python theme={null}
where(
    self,
    *,
    exclude: bool = False,
    **kwargs: Any
) -> LLMConfig
```

<b>Parameters:</b>

| Name       | Description                                  |
| ---------- | -------------------------------------------- |
| `exclude`  | **Type:** bool<br /><br />**Default:** False |
| `**kwargs` | **Type:** Any                                |

<br />
