orkes.services.LLMConfig#
- class orkes.services.LLMConfig(api_key, base_url, model, extra_headers=None, default_params=None)[source]#
A universal configuration object for any LLM connection.
This class holds the necessary configuration parameters to connect to an LLM provider, such as API keys, base URLs, and model names. It also allows for custom headers and default parameters to be set for all requests.
- Parameters:
api_key (str)
base_url (str)
model (str)
extra_headers (Dict[str, str] | None)
default_params (Dict[str, Any] | None)
- api_key#
The API key for the LLM provider.
- Type:
str
- base_url#
The base URL of the LLM provider’s API.
- Type:
str
- model#
The name of the model to use.
- Type:
str
- headers#
A dictionary of extra headers to send with each request.
- Type:
Dict[str, str]
- default_params#
A dictionary of default parameters to use for all requests, such as temperature and max_tokens.
- Type:
Dict[str, Any]
- __init__(api_key, base_url, model, extra_headers=None, default_params=None)[source]#
Initializes the LLMConfig object.
- Parameters:
api_key (str) – The API key for the LLM provider.
base_url (str) – The base URL of the LLM provider’s API.
model (str) – The name of the model to use.
extra_headers (Optional[Dict[str, str]], optional) – A dictionary of extra headers to send with each request. Defaults to None.
default_params (Optional[Dict[str, Any]], optional) – A dictionary of default parameters to use for all requests. Defaults to a standard set of parameters.
Methods
__init__(api_key, base_url, model[, ...])Initializes the LLMConfig object.