In Azure OpenAI I have added my own Data Source and it’s working fine if I ask question within my train data but if I ask something outside of my train data it does not give answer and It’s looks like GPT model does not know anything about that question but when I remove my own data source then it gives me good answer.
Here is my ChatCompletionsOptions
var chatCompletionOptions = new ChatCompletionsOptions
{
Temperature = 0.7f,
MaxTokens = 800,
NucleusSamplingFactor = 0.95f,
FrequencyPenalty = 0,
PresencePenalty = 0,
DeploymentName = _configuration["AzureAi:DeploymentName"]
};
chatCompletionOptions.AzureExtensionsOptions = new AzureChatExtensionsOptions
{
Extensions = {
new AzureSearchChatExtensionConfiguration
{
SearchEndpoint = new Uri(_configuration["AzureSearch:Endpoint"]),
VectorizationSource = new OnYourDataDeploymentNameVectorizationSource("text-embedding-ada-002"),
IndexName = _configuration["AzureSearch:IndexName"],
Authentication = new OnYourDataApiKeyAuthenticationOptions(_configuration["AzureSearch:ApiKey"]),
QueryType = AzureSearchQueryType.VectorSimpleHybrid,
ShouldRestrictResultScope = false
}
}
};
// Add the user query
chatCompletionOptions.Messages.Add(new ChatMessage(ChatRole.User, "Create a console application that can print 'Hello World'"));
// Get the response from ChatGPT which includes the Azure Search results
var response = await _openAIClient.ChatCompletionAsync(chatCompletionOptions);
return response.Choices.FirstOrDefault()?.Message.Content;
GPT response is :
I’m sorry, but I couldn’t find any information related to creating a console application that can print ‘Hello World’ in the retrieved documents . Could you please provide more context or information about what you’re looking for?
But if I ask the same question without AzureSearchChatExtensionConfiguration
then I get good result.
My question is how can I add my data on top of Model knowledge in azure OpenAI? or am I missing anything.
- Model: gpt-35-turbo (0301)
- Model: text-embedding-ada-002 (2)
- SDK : Azure.AI.OpenAI (1.0.0-beta.17)
Thanks in advance.