# AnthropicLLMConfigEntry

## `autogen.oai.anthropic.AnthropicLLMConfigEntry`

Bases: `LLMConfigEntry`

### `api_type`
```python
api_type = 'anthropic'
```

### `max_tokens`
```python
max_tokens = Field(default=4096, ge=1)
```

### `temperature`
```python
temperature = Field(default=None, ge=0.0, le=1.0)
```

### `top_p`
```python
top_p = Field(default=None, ge=0.0, le=1.0)
```

### `timeout`
```python
timeout = Field(default=None, ge=1)
```

### `top_k`
```python
top_k = Field(default=None, ge=1)
```

### `stop_sequences`
```python
stop_sequences = None
```

### `stream`
```python
stream = False
```

### `price`
```python
price = Field(default=None, min_length=2, max_length=2)
```

### `tool_choice`
```python
tool_choice = None
```

### `thinking`
```python
thinking = None
```

### `gcp_project_id`
```python
gcp_project_id = None
```

### `gcp_region`
```python
gcp_region = None
```

### `gcp_auth_token`
```python
gcp_auth_token = None
```

### `model`
```python
model = Field(..., min_length=1)
```

### `api_key`
```python
api_key = None
```

### `api_version`
```python
api_version = None
```

### `base_url`
```python
base_url = None
```

### `http_client`
```python
http_client = None
```

### `voice`
```python
voice = None
```

### `model_client_cls`
```python
model_client_cls = None
```

### `response_format`
```python
response_format = None
```

### `default_headers`
```python
default_headers = None
```

### `tags`
```python
tags = Field(default_factory=list)
```

### `model_config`
```python
model_config = ConfigDict(extra='allow', arbitrary_types_allowed=True)
```

### `create_client`
```python
create_client()
```

#### Source code in `autogen/oai/anthropic.py`
```python
373
374

def create_client(self):
    raise NotImplementedError("AnthropicLLMConfigEntry.create_client is not implemented.")
```

### `apply_application_config`
```python
apply_application_config(application_config)
```

Apply application level configurations.

#### Source code in `autogen/llm_config/entry.py`
```python
def apply_application_config(self, application_config: ApplicationConfig) -> Self:
    """Apply application level configurations."""
    new_entry = self.model_copy()
    new_entry.max_tokens = new_entry.max_tokens or application_config.max_tokens
    new_entry.top_p = new_entry.top_p or application_config.top_p
    new_entry.temperature = new_entry.temperature or application_config.temperature
    return new_entry
```

### `check_base_url`
```python
check_base_url(v, info)
```

#### Source code in `autogen/llm_config/entry.py`
```python
@field_validator("base_url", mode="before")
@classmethod
def check_base_url(cls, v: HttpUrl | str | None, info: ValidationInfo) -> str | None:
    if v is None:  # Handle None case explicitly
        return None
    # Allow WebSocket URLs as well as HTTP(S)
    if not str(v).startswith(("https://", "http://", "wss://", "ws://")):
        return f"http://{str(v)}"
    return str(v)
```

### `serialize_base_url`
```python
serialize_base_url(v)
```

#### Source code in `autogen/llm_config/entry.py`
```python
@field_serializer("base_url", when_used="unless-none")  # Ensure serializer also respects None

def serialize_base_url(self, v: HttpUrl | None) -> str | None:
    return str(v) if v is not None else None
```

### `serialize_api_key`
```python
serialize_api_key(v)
```

#### Source code in `autogen/llm_config/entry.py`
```python
@field_serializer("api_key", when_used="unless-none")
def serialize_api_key(self, v: SecretStr) -> str:
    return v.get_secret_value()
```

### `model_dump`
```python
model_dump(*args, exclude_none=True, **kwargs)
```

#### Source code in `autogen/llm_config/entry.py`
```python
def model_dump(self, *args: Any, exclude_none: bool = True, **kwargs: Any) -> dict[str, Any]:
    return BaseModel.model_dump(self, exclude_none=exclude_none, *args, **kwargs)
```

### `model_dump_json`
```python
model_dump_json(*args, exclude_none=True, **kwargs)
```

#### Source code in `autogen/llm_config/entry.py`
```python
def model_dump_json(self, *args: Any, exclude_none: bool = True, **kwargs: Any) -> str:
    return BaseModel.model_dump_json(self, exclude_none=exclude_none, *args, **kwargs)
```

### `get`
```python
get(key, default=None)
```

#### Source code in `autogen/llm_config/entry.py`
```python
def get(self, key: str, default: Any | None = None) -> Any:
    val = getattr(self, key, default)
    if isinstance(val, SecretStr):
        return val.get_secret_value()
    return val
```

### `items`
```python
items()
```

#### Source code in `autogen/llm_config/entry.py`
```python
def items(self) -> Iterable[tuple[str, Any]]:
    d = self.model_dump()
    return d.items()
```

### `keys`
```python
keys()
```

#### Source code in `autogen/llm_config/entry.py`
```python
def keys(self) -> Iterable[str]:
    d = self.model_dump()
    return d.keys()
```

### `values`
```python
values()
```

#### Source code in `autogen/llm_config/entry.py`
```python
def values(self) -> Iterable[Any]:
    d = self.model_dump()
    return d.values()
```
