I am currently working on .NET to create a chat bot that accesses data from my Azure AI Search Index. My index is only composed of text and no images. I followed the steps specified in the Azure documentation (link: https://learn.microsoft.com/en-us/azure/ai-services/openai/use-your-data-quickstart?tabs=command-line%2Cpython-new&pivots=programming-language-csharp) And chose the without Streaming option, but I get the following error:
HTTP 400 (InvalidRequest) The deployed GPT model does not support Vision Enhancement and On Your Data (OYD) with images.
#pragma warning disable AOAI001
public async Task<string> SearchIndex(string IndexName, string prompt)
{
_searchClient = _searchIndexClient.GetSearchClient(IndexName);
_options = new();
_options.AddDataSource(new AzureSearchChatDataSource()
{
Endpoint = new Uri(_searchEndpoint),
IndexName = IndexName,
Authentication = DataSourceAuthentication.FromApiKey(_searchKey),
InScope = true,
});
try
{
**ChatCompletion completion = _chatClient.CompleteChat([new UserChatMessage(prompt)], _options);**
AzureChatMessageContext onYourDataContext = completion.GetAzureMessageContext();
if (onYourDataContext?.Intent is not null)
{
Console.WriteLine($"Intent: {onYourDataContext.Intent}");
}
foreach (AzureChatCitation citation in onYourDataContext?.Citations ?? [])
{
Console.WriteLine($"Citation: {citation.Content}");
}
return completion.Content[0].Text;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message.ToString());
return ex.Message.ToString();
}
}
The error originates from the CompleteChat call.
I would appreciate your help on this issue!
The goal of the method is to answer user prompt using a specific index.
Hamza Zouaki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.