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 if the input data cannot be parsed to form a valid model.

param api_host: str | None = None#

Host URL

param api_key: SecretStr | None = None#

API key for AI21 API.

Constraints:
  • type = string

  • writeOnly = True

  • format = password

param num_retries: int | None = None#

Maximum number of retries for API requests before giving up.

param timeout_sec: float | None = None#

Timeout in seconds.

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