Model
Waldiez model model.
WaldiezModel ¶
Bases: WaldiezBase
Waldiez Model class.
Attributes:
Name | Type | Description |
---|---|---|
id | str | The ID of the model. |
name | str | The name of the model. |
description | str | The description of the model. |
tags | list[str] | The tags of the model. |
requirements | list[str] | The requirements of the model. |
created_at | str | The date and time when the model was created. |
updated_at | str | The date and time when the model was last updated. |
data | WaldiezModelData | The data of the model. See |
api_key property
¶
api_key: str
Get the model's api key.
Either from the model's data or from the environment variables:
- openai: 'OPENAI_API_KEY',
- azure: 'AZURE_API_KEY',
- deepseek: 'DEEPSEEK_API_KEY',
- google: 'GOOGLE_GEMINI_API_KEY',
- anthropic: 'ANTHROPIC_API_KEY',
- mistral: 'MISTRAL_API_KEY',
- groq: 'GROQ_API_KEY',
- together: 'TOGETHER_API_KEY',
- nim: 'NIM_API_KEY',
- cohere: 'COHERE_API_KEY',
- other: 'OPENAI_API_KEY'
api_key_env_key property
¶
api_key_env_key: str
Get the model's api key environment key to check.
- openai: 'OPENAI_API_KEY',
- azure: 'AZURE_API_KEY',
- deepseek: 'DEEPSEEK_API_KEY',
- google: 'GOOGLE_GEMINI_API_KEY',
- anthropic: 'ANTHROPIC_API_KEY',
- mistral: 'MISTRAL_API_KEY',
- groq: 'GROQ_API_KEY',
- together: 'TOGETHER_API_KEY',
- nim: 'NIM_API_KEY',
- cohere: 'COHERE_API_KEY',
- other: 'OPENAI_API_KEY'
get_llm_config ¶
Get the model's llm config.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
skip_price | bool | Whether to skip the price, by default, False | False |
Returns:
Type | Description |
---|---|
dict[str, Any] | The model's llm config dictionary. |
Source code in waldiez/models/model/model.py
set_bedrock_aws_config ¶
set_bedrock_aws_config(
llm_config: dict[str, Any],
aws_config: Optional[WaldiezModelAWS],
) -> dict[str, Any]
Set the AWS config for Bedrock.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
llm_config | dict[str, Any] | The llm config dictionary. | required |
aws_config | Optional[WaldiezModelAWS] | The passed aws config if any. | required |
Returns:
Type | Description |
---|---|
dict[str, Any] | The llm config dictionary with the AWS config set. |
Source code in waldiez/models/model/model.py
set_default_base_url ¶
set_default_base_url(
llm_config: dict[str, Any],
api_type: WaldiezModelAPIType,
) -> dict[str, Any]
Set the default base url if not provided.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
llm_config | dict[str, Any] | The llm config dictionary. | required |
api_type | str | The api type. | required |
Returns:
Type | Description |
---|---|
dict[str, Any] | The llm config dictionary with the default base url set. |
Source code in waldiez/models/model/model.py
Waldiez Model Data.
WaldiezModelAPIType module-attribute
¶
WaldiezModelAPIType = Literal[
"openai",
"azure",
"deepseek",
"google",
"anthropic",
"mistral",
"groq",
"together",
"nim",
"cohere",
"bedrock",
"other",
]
Possible API types for the model.
WaldiezModelAWS ¶
Bases: WaldiezBase
AWS related parameters.
Attributes:
Name | Type | Description |
---|---|---|
region | Optional[str] | The AWS region, by default None. |
access_key | Optional[str] | The AWS access key, by default None. |
secret_key | Optional[str] | The AWS secret access key, by default None. |
session_token | Optional[str] | The AWS session token, by default None. |
profile_name | Optional[str] | The AWS profile name, by default Nonde. |
WaldiezModelData ¶
Bases: WaldiezBase
Waldiez Model Data.
Attributes:
Name | Type | Description |
---|---|---|
base_url | Optional[str] | The base url of the model, by default None. |
api_key | Optional[str] | The api key to use with the model, by default None. |
api_type | WaldiezModelAPIType | The api type of the model. |
api_version | Optional[str] | The api version of the model, by default None. |
temperature | Optional[float] | The temperature of the model, by default None. |
top_p | Optional[float] | The top p of the model, by default None. |
max_tokens | Optional[int] | The max tokens of the model, by default None. |
aws | Optional[WaldiezModelAWS] | |
extras | dict[str, str] | Any extra attributes to include in the LLM Config. |
default_headers | dict[str, str] | The default headers of the model. |
price | Optional[WaldiezModelPrice] | The price of the model, by default None. |
WaldiezModelPrice ¶
Bases: WaldiezBase
Model Price.
Attributes:
Name | Type | Description |
---|---|---|
prompt_price_per_1k | float | The prompt price per 1k tokens. |
completion_token_price_per_1k | float | The completion token price per 1k tokens. |