Class OpenAI
Represents the OpenAI service with methods to interact with the API.
public class OpenAI : ApiClient<OpenAI, OpenAISettings>, IApiClient
- Inheritance
-
objectRESTClientCRUDClient<OpenAI>OpenAI
- Implements
- Inherited Members
-
CRUDClient<OpenAI>.NameCRUDClient<OpenAI>.VersionCRUDClient<OpenAI>.BetaVersionCRUDClient<OpenAI>.BaseUrlCRUDClient<OpenAI>.CreateClientSettings()CRUDClient<OpenAI>.POSTCreateAsync<TRequestBody, TResponse>(string, CRUDServiceBase<OpenAI>, TRequestBody, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.POSTCreateAsync<TRequestBody, TResponse>(string, CRUDServiceBase<OpenAI>, TRequestBody, params IUriParam[])CRUDClient<OpenAI>.POSTCreateAsync<TRequestBody>(string, CRUDServiceBase<OpenAI>, TRequestBody, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.POSTCreateAsync<TRequestBody>(string, CRUDServiceBase<OpenAI>, TRequestBody, params IUriParam[])CRUDClient<OpenAI>.POSTCreateAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.GETRetrieveAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.POSTUpdateAsync<TRequestBody, TResponse>(string, CRUDServiceBase<OpenAI>, TRequestBody, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.POSTUpdateAsync<TRequestBody, TResponse>(string, CRUDServiceBase<OpenAI>, TRequestBody, params IUriParam[])CRUDClient<OpenAI>.POSTUpdateAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.PATCHUpdateAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.DELETEDeleteAsync<TResponse>(string, CRUDServiceBase<OpenAI>, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.DELETEDeleteAsync<TRequestBody>(string, CRUDServiceBase<OpenAI>, TRequestBody, RESTRequestOptions, params IUriParam[])CRUDClient<OpenAI>.GETListAsync<TQuery, TResponse>(string, CRUDServiceBase<OpenAI>, TQuery, RESTRequestOptions, params IUriParam[])
Constructors
OpenAI()
public OpenAI()
Fields
AssistantsApiHeader
public static RESTHeader AssistantsApiHeader
Field Value
- RESTHeader
RealtimeApiHeader
public static RESTHeader RealtimeApiHeader
Field Value
- RESTHeader
Properties
Audio
Learn how to turn audio into text or text into audio.
public AudioService Audio { get; }
Property Value
Batch
Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount.
public BatchService Batch { get; }
Property Value
Beta
Beta features that are not yet available in the main API.
public BetaService Beta { get; }
Property Value
Chat
Given a list of messages comprising a conversation, the model will return a response.
public ChatService Chat { get; }
Property Value
Embeddings
Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
public EmbeddingService Embeddings { get; }
Property Value
Files
Files are used to upload documents that can be used with features like Assistants, Fine-tuning, and Batch API.
public FileService Files { get; }
Property Value
FineTuning
Manage fine-tuning jobs to tailor a model to your specific training data.
public FineTuningService FineTuning { get; }
Property Value
Images
Given a prompt and/or an input image, the model will generate a new image.
public ImageService Images { get; }
Property Value
Models
List and describe the various models available in the API. You can refer to the Models documentation to understand what models are available and the differences between them.
public ModelService Models { get; }
Property Value
Moderations
Given some input text, outputs if the model classifies it as potentially harmful across several categories.
public ModerationService Moderations { get; }
Property Value
Methods
CreateCRUDClientSettings()
protected override CRUDClientSettings CreateCRUDClientSettings()
Returns
- CRUDClientSettings
CreateJsonSerializerSettingsData()
protected override ApiClient<OpenAI, OpenAISettings>.JsonSerializerSettingsData CreateJsonSerializerSettingsData()
Returns
GetApiKey(string)
public override string GetApiKey(string serviceName = null)
Parameters
serviceNamestring
Returns
- string
IsDeletedPredicate(RESTResponse)
Override this method to handle the status of a Glitch9.IO.Networking.RESTApi.CRUDOperation.Delete operation.
protected override bool IsDeletedPredicate(RESTResponse res)
Parameters
resRESTResponse
Returns
- bool