HTTP 400 (InvalidRequest). Развернутая модель GPT не поддерживает Vision Enhancement и On Your Data (OYD) с изображениями.
Код: Выделить всё
#pragma warning disable AOAI001
public async Task 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();
}
}
Буду признателен за вашу помощь в этом вопросе!
Цель метода — ответить на запрос пользователя, используя определенный индекс.
Подробнее здесь: https://stackoverflow.com/questions/787 ... s-not-supp