I’m trying to query AzureOpenAI for chat completions, with on my own data (Azure Search), from TypeScript code.
I use packages @azure/[email protected]
and [email protected]
.
I followed the instructions from https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/openai/openai/MIGRATION.md#azure-on-your-data
import "@azure/openai/types";
is properly declared:
The code is as in the documentation:
const response = await client.chat.completions.create({
model: '',
messages,
data_sources: [
{
type: "azure_search",
parameters: {
endpoint: "XXXX",
index_name: "YYYY",
authentication: {
type: "system_assigned_managed_identity",
},
},
},
]
});
End yet, parameter data_source
is not recognized.
The error reads: Object literal may only specify known properties, and 'data_sources' does not exist in type 'ChatCompletionCreateParamsBase'
What am I missing here?
I uninstalled and re-installed both packages openai
and @azure/openai
, I tried different sets of parameters on client.chat.completions.create
.
Also, I cannot find any reference to parameter data_sources
in the node_modules
folder of my project.