phasellm.configurations#
Module Contents#
Classes#
Helper class that provides a standard way to create an ABC using |
|
Initializes the OpenAI API configuration. |
|
Initializes the Azure API configuration. |
|
Initializes the Azure Active Directory API configuration. |
|
Initializes the VertexAI API configuration. |
- class phasellm.configurations.APIConfiguration(model: str = 'gpt-3.5-turbo')#
Bases:
abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- abstract __call__()#
Abstract method to initialize the API configuration. Should set the client attribute.
Returns:
- abstract get_base_api_kwargs()#
Abstract method for the base API kwargs for the API configuration.
Returns:
- class phasellm.configurations.OpenAIConfiguration(api_key: str, organization: str = None, model: str = 'gpt-3.5-turbo')#
Bases:
APIConfigurationInitializes the OpenAI API configuration.
- Parameters:
api_key – The OpenAI API key.
organization – The OpenAI organization.
model – The model to use.
- name = 'openai'#
- __call__()#
Calls the OpenAI API configuration to initialize the OpenAI API.
Returns:
- get_base_api_kwargs()#
Returns the base API kwargs for the OpenAI API configuration.
- Returns:
A Dict of the base API kwargs for the OpenAI API configuration.
- class phasellm.configurations.AzureAPIConfiguration(api_key: str, base_url: str = None, api_version: str = '2023-05-15', deployment_id: str = 'gpt-3.5-turbo', api_base: str = None)#
Bases:
APIConfigurationInitializes the Azure API configuration.
- Parameters:
api_key – The Azure API key.
base_url – The Azure API base URL.
api_version – The Azure API version.
deployment_id – The model deployment ID.
api_base – (DEPRECATED) The Azure API base.
- name = 'azure'#
- __call__()#
Calls the Azure API configuration to initialize the Azure API.
Returns:
- get_base_api_kwargs()#
Returns the base API kwargs for the Azure API configuration.
- Returns:
A Dict of the base API kwargs for the Azure API configuration.
- class phasellm.configurations.AzureActiveDirectoryConfiguration(base_url: str, api_version: str = '2023-05-15', deployment_id: str = 'gpt-3.5-turbo', api_base: str = None)#
Initializes the Azure Active Directory API configuration.
- Parameters:
base_url – The Azure Active Directory API base.
api_version – The API version. https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
deployment_id – The model deployment ID
api_base – (DEPRECATED) The Azure Active Directory API base.
- name = 'azure_ad'#
- __call__()#
Calls the Azure Active Directory API configuration to initialize the Azure Active Directory API.
Returns:
- get_base_api_kwargs()#
Returns the base API kwargs for the Azure Active Directory API configuration.
- Returns:
A Dict containing the base API kwargs for the Azure Active Directory API configuration.
- class phasellm.configurations.VertexAIConfiguration(model: str, project: str | None = None, location: str | None = None, experiment: str | None = None, experiment_description: str | None = None, credentials: str | None = None)#
Bases:
APIConfigurationInitializes the VertexAI API configuration.
- Parameters:
model – The model to use.
project – Google Cloud project ID or number. Environment default used if not provided.
location – Vertext AI region. Defaults to us-central1.
experiment – The VertexAI experiment.
experiment_description – The VertexAI experiment description.
credentials – Custom google.auth.credentials.Credentials. Defaults to environment default credentials.
- name = 'vertex_ai'#
- __call__()#
Calls the VertexAI API configuration to initialize the VertexAI API.
- get_base_api_kwargs()#
Abstract method for the base API kwargs for the API configuration.
Returns: