AI21Base#

class langchain_ai21.ai21_base.AI21Base[source]#

Bases: BaseModel

Base class for AI21 models.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param api_host: str [Optional]#

Host URL

param api_key: SecretStr [Optional]#

API key for AI21 API.

param num_retries: int | None = None#

Maximum number of retries for API requests before giving up.

param timeout_sec: float [Optional]#

Timeout in seconds.

If not set, it will default to the value of the environment variable AI21_TIMEOUT_SEC or 300 seconds.