View Source ExOpenAI.Models (ex_openai.ex v1.7.0)
Modules for interacting with the models
group of OpenAI APIs
API Reference: https://platform.openai.com/docs/api-reference/models
Summary
Functions
Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
Lists the currently available models, and provides basic information about each one such as the owner and availability.
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
Functions
@spec delete_model(String.t(), base_url: String.t(), openai_organization_key: String.t(), openai_api_key: String.t() ) :: {:ok, ExOpenAI.Components.DeleteModelResponse.t()} | {:error, any()}
Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
Endpoint: https://api.openai.com/v1/models/{model}
Method: DELETE
Docs: https://platform.openai.com/docs/api-reference/models
Required Arguments:
model
Example: ft:gpt-3.5-turbo:acemeco:suffix:abc123
Optional Arguments:
openai_api_key
: OpenAI API key to pass directly. If this is specified, it will override theapi_key
config value.openai_organization_key
: OpenAI API key to pass directly. If this is specified, it will override theorganization_key
config value.base_url
: Which API endpoint to use as base, defaults to https://api.openai.com/v1
@spec list_models( base_url: String.t(), openai_organization_key: String.t(), openai_api_key: String.t() ) :: {:ok, ExOpenAI.Components.ListModelsResponse.t()} | {:error, any()}
Lists the currently available models, and provides basic information about each one such as the owner and availability.
Endpoint: https://api.openai.com/v1/models
Method: GET
Docs: https://platform.openai.com/docs/api-reference/models
Required Arguments:
Optional Arguments:
openai_api_key
: OpenAI API key to pass directly. If this is specified, it will override theapi_key
config value.openai_organization_key
: OpenAI API key to pass directly. If this is specified, it will override theorganization_key
config value.base_url
: Which API endpoint to use as base, defaults to https://api.openai.com/v1
@spec retrieve_model(String.t(), base_url: String.t(), openai_organization_key: String.t(), openai_api_key: String.t() ) :: {:ok, ExOpenAI.Components.Model.t()} | {:error, any()}
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
Endpoint: https://api.openai.com/v1/models/{model}
Method: GET
Docs: https://platform.openai.com/docs/api-reference/models
Required Arguments:
model
Example: gpt-3.5-turbo
Optional Arguments:
openai_api_key
: OpenAI API key to pass directly. If this is specified, it will override theapi_key
config value.openai_organization_key
: OpenAI API key to pass directly. If this is specified, it will override theorganization_key
config value.base_url
: Which API endpoint to use as base, defaults to https://api.openai.com/v1