Table of Contents

Class OpenAISettings

Namespace
OpenAI
Assembly
OpenAI-DotNet.dll

The client settings for configuring Azure OpenAI or custom domain.

public sealed class OpenAISettings
Inheritance
OpenAISettings
Inherited Members

Constructors

OpenAISettings()

Creates a new instance of OpenAISettings for use with OpenAI.

public OpenAISettings()

OpenAISettings(string, string)

Creates a new instance of OpenAISettings for use with OpenAI.

public OpenAISettings(string domain, string apiVersion = "v1")

Parameters

domain string

Base api domain.

apiVersion string

The version of the OpenAI api you want to use.

OpenAISettings(string, string, string, bool, string)

Creates a new instance of the OpenAISettings for use with Azure OpenAI.
https://learn.microsoft.com/en-us/azure/cognitive-services/openai/

public OpenAISettings(string resourceName, string deploymentId, string apiVersion = "2024-10-21", bool useActiveDirectoryAuthentication = false, string azureDomain = "openai.azure.com")

Parameters

resourceName string

The name of your Azure OpenAI Resource.

deploymentId string

The name of your model deployment. You're required to first deploy a model before you can make calls.

apiVersion string

Optional, defaults to 2024-10-21.

useActiveDirectoryAuthentication bool

Optional, set to true if you want to use Azure Active Directory for Authentication.

azureDomain string

Optional, defaults to "openai.azure.com".

Properties

ApiVersion

public string ApiVersion { get; }

Property Value

string

BaseRequest

public string BaseRequest { get; }

Property Value

string

Default

public static OpenAISettings Default { get; }

Property Value

OpenAISettings

DeploymentId

public string DeploymentId { get; }

Property Value

string

IsAzureOpenAI

public bool IsAzureOpenAI { get; }

Property Value

bool

ResourceName

public string ResourceName { get; }

Property Value

string