So for anyone still looking for this. Going through the playground and hitting "View Code" does not show the correct code that utilizes the new custom datasource. However, I was able to find the documentation on what you need to send in the REST command to get it. If you go here, https://learn.microsoft.com/en-us/azure/cognitive-services/openai/use-your-data-quickstart?source=recommendations&tabs=powershell&pivots=rest-api . This will show you the endpoint, and explain the variables needed, but the body is also incomplete in this example. It doesn't show you how to send the field mapping information. To get that I found it here. https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2023-06-01-preview/inference.json . If you scroll down to line 1139 you can see an example of the full body that you need to send to the new /extensions/chat/completions endpoint. Here is the example
{
"dataSources": [
{
"type": "AzureCognitiveSearch",
"parameters": {
"endpoint": "https://mysearchexample.search.windows.net",
"key": "***(admin key)",
"indexName": "my-chunk-index",
"fieldsMapping": {
"titleField": "productName",
"urlField": "productUrl",
"filepathField": "productFilePath",
"contentFields": [
"productDescription"
],
"contentFieldsSeparator": "\n"
},
"topNDocuments": 5,
"queryType": "semantic",
"semanticConfiguration": "defaultConfiguration",
"inScope": true,
"roleInformation": "roleInformation"
}
}
],
"messages": [
{
"role": "user",
"content": "Where can I find a hiking place in Seattle?"
}
],
"temperature": 0.9
}
I have tested this in my c# app and using postman and it is working.