You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm able to hit my azure openai general chat stuff just fine using SK. But when I add the extension config to search on my own data, I get a 404. I've got index search for my own data working fine via REST requests, so I assume everything is set up correctly on the azure side. My suspicion is I'm doing something wrong with the endpoints (given the error messages I'm getting). I've tried all sorts of different variations, getting either 400 or 404 errors depending on the variation used.
For the general chat, my builder looks something like this: var builder = Kernel.CreateBuilder().AddAzureOpenAIChatCompletion(_settings.ModelId, "https://{super-secret}.openai.azure.com", _settings.OpenAiApiKey);
And my simple settings look something like this: var openAiPromptExecutionSettings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions, };
And that works just fine when I call GetChatMessageContentAsync.
To get the search to work on my own data, I make the following changes to my settings: var azureSearchExtensionConfiguration = new AzureSearchChatExtensionConfiguration { Authentication = new OnYourDataApiKeyAuthenticationOptions(_settings.SearchResourceKey), SearchEndpoint = new Uri("https://{super-secret}.search.windows.net"), IndexName = "{super-secret}" }; var chatExtensionsOptions = new AzureChatExtensionsOptions { Extensions = { azureSearchExtensionConfiguration } }; var openAiPromptExecutionSettings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions, AzureChatExtensionsOptions = chatExtensionsOptions };
And that gets me a 404.
I notice that when I put together my REST request, I have to add a resource to the primary chat completion endpoint, and that looks like this: var restClient = new RestClient("https://{super-secret}.openai.azure.com"); var restRequest = new RestRequest("openai/deployments/{super-secret}/chat/completions?api-version=2024-05-01-preview", Method.Post);
And in the body of the request is where I add the search endpoint: var requestBody = new IndexSearchRequest { DataSources = [ new DataSource { Type = "azure_search", Parameters = new Parameters { Endpoint = "https://{super-secret}.search.windows.net", IndexName = "{super-secret}", ...
And that works just fine.
So I figure that means I'd need to append the resource (shown in the restRequest) to the primary chat completion endpoint in the kernel builder, but that doesn't help. What am I doing wrong?
Edit: Working now, not sure what I was doing wrong initially. 🤦♂️
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm able to hit my azure openai general chat stuff just fine using SK. But when I add the extension config to search on my own data, I get a 404. I've got index search for my own data working fine via REST requests, so I assume everything is set up correctly on the azure side. My suspicion is I'm doing something wrong with the endpoints (given the error messages I'm getting). I've tried all sorts of different variations, getting either 400 or 404 errors depending on the variation used.
For the general chat, my builder looks something like this:
var builder = Kernel.CreateBuilder().AddAzureOpenAIChatCompletion(_settings.ModelId, "https://{super-secret}.openai.azure.com", _settings.OpenAiApiKey);
And my simple settings look something like this:
var openAiPromptExecutionSettings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions, };
And that works just fine when I call GetChatMessageContentAsync.
To get the search to work on my own data, I make the following changes to my settings:
var azureSearchExtensionConfiguration = new AzureSearchChatExtensionConfiguration { Authentication = new OnYourDataApiKeyAuthenticationOptions(_settings.SearchResourceKey), SearchEndpoint = new Uri("https://{super-secret}.search.windows.net"), IndexName = "{super-secret}" }; var chatExtensionsOptions = new AzureChatExtensionsOptions { Extensions = { azureSearchExtensionConfiguration } }; var openAiPromptExecutionSettings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions, AzureChatExtensionsOptions = chatExtensionsOptions };
And that gets me a 404.
I notice that when I put together my REST request, I have to add a resource to the primary chat completion endpoint, and that looks like this:
var restClient = new RestClient("https://{super-secret}.openai.azure.com"); var restRequest = new RestRequest("openai/deployments/{super-secret}/chat/completions?api-version=2024-05-01-preview", Method.Post);
And in the body of the request is where I add the search endpoint:
var requestBody = new IndexSearchRequest { DataSources = [ new DataSource { Type = "azure_search", Parameters = new Parameters { Endpoint = "https://{super-secret}.search.windows.net", IndexName = "{super-secret}", ...
And that works just fine.
So I figure that means I'd need to append the resource (shown in the restRequest) to the primary chat completion endpoint in the kernel builder, but that doesn't help. What am I doing wrong?
Edit: Working now, not sure what I was doing wrong initially. 🤦♂️
Beta Was this translation helpful? Give feedback.
All reactions