Skip to content

Commit

Permalink
Documentation update (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcominerva authored Jul 12, 2023
2 parents ef4f891 + 351b833 commit 2c7b80d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/ChatGptNet/ChatGptOptionsBuilderExtensions/UseAzure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Configures Azure OpenAI Service settings.

```csharp
public static ChatGptOptionsBuilder UseAzure(this ChatGptOptionsBuilder builder,
string resourceName, string apiKey, string? apiVersion = "2023-06-01-preview",
string resourceName, string apiKey, string apiVersion = "2023-06-01-preview",
AzureAuthenticationType authenticationType = AzureAuthenticationType.ApiKey)
```

Expand All @@ -24,7 +24,7 @@ A reference to this instance after the operation has completed.

| exception | condition |
| --- | --- |
| ArgumentNullException | *resourceName* or *apiKey* are `null`. |
| ArgumentNullException | *resourceName*, *apiKey* or *apiVersion* are `null`. |

## Remarks

Expand Down
7 changes: 4 additions & 3 deletions src/ChatGptNet/ChatGptOptionsBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,23 @@ public static ChatGptOptionsBuilder UseOpenAI(this ChatGptOptionsBuilder builder
/// <param name="apiVersion">The API version of the Azure OpenAI service</param>
/// <param name="authenticationType">Specify if <paramref name="apiKey"/> is an actual API Key or an Azure Active Directory token.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
/// <exception cref="ArgumentNullException"><paramref name="resourceName"/> or <paramref name="apiKey"/> are <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException"><paramref name="resourceName"/>, <paramref name="apiKey"/> or <paramref name="apiVersion"/> are <see langword="null"/>.</exception>
/// <remarks>
/// See <see href="https://learn.microsoft.com/azure/cognitive-services/openai/reference#authentication">Azure OpenAI Service Authentication</see> and <see href="https://learn.microsoft.com/azure/cognitive-services/openai/how-to/managed-identity">Authenticating with Azure Active Directory</see> for more information about authentication.
/// </remarks>
/// <seealso cref="ChatGptOptionsBuilder"/>
public static ChatGptOptionsBuilder UseAzure(this ChatGptOptionsBuilder builder, string resourceName, string apiKey, string? apiVersion = AzureChatGptServiceConfiguration.DefaultApiVersion, AzureAuthenticationType authenticationType = AzureAuthenticationType.ApiKey)
public static ChatGptOptionsBuilder UseAzure(this ChatGptOptionsBuilder builder, string resourceName, string apiKey, string apiVersion = AzureChatGptServiceConfiguration.DefaultApiVersion, AzureAuthenticationType authenticationType = AzureAuthenticationType.ApiKey)
{
ArgumentNullException.ThrowIfNull(builder);
ArgumentNullException.ThrowIfNull(resourceName);
ArgumentNullException.ThrowIfNull(apiVersion);
ArgumentNullException.ThrowIfNull(apiKey);

builder.ServiceConfiguration = new AzureChatGptServiceConfiguration
{
ResourceName = resourceName,
ApiKey = apiKey,
ApiVersion = apiVersion ?? AzureChatGptServiceConfiguration.DefaultApiVersion,
ApiVersion = apiVersion,
AuthenticationType = authenticationType
};

Expand Down

0 comments on commit 2c7b80d

Please sign in to comment.