Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,815 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
My C# project uses the latest Azure OpenAI API nuget and Azure AI Search (ACS) as the data source in the GetChatCompletionsAsync call. However, since yesterday, I've been encountering a validation error when trying to hit the service. Any ideas on how to resolve this issue?
Thanks for the question, This issue has been fixed as confirmed in the following github issue. https://github.com/Azure/azure-sdk-for-net/issues/41138
var client = new OpenAIClient(new Uri(_apiBase), new AzureKeyCredential(_apiKey!));
var primeText = "...";
AzureCognitiveSearchChatExtensionConfiguration searchExtensionConfig = new()
{
SearchEndpoint = new Uri(_searchEndpoint),
IndexName = _searchIndexName,
Authentication = new OnYourDataApiKeyAuthenticationOptions(_searchKey),
DocumentCount = 10,
Strictness = 1,
RoleInformation = primeText
};
var chatCompletionsOptions = new ChatCompletionsOptions()
{
DeploymentName = _deploymentId,
Messages = {
new ChatRequestSystemMessage(primeText)
},
AzureExtensionsOptions = new AzureChatExtensionsOptions()
{
Extensions = { searchExtensionConfig }
},
Temperature = 0.8f
};
var response = await client.GetChatCompletionsAsync(chatCompletionsOptions);