Azure OpenAI: using functions and bring your own data in parallel doesn't work

GuenterR 5 Reputation points
2024-01-30T06:02:35.44+00:00

We have an Azure OpenAI instance with uploaded data (bring your own data). Using the OpenAIClient from azure-sdk-for-js it is possible to chat with the instance and get answers composed from the uploaded data. This is described in https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/openai/openai/samples/v1-beta/javascript/bringYourOwnData.js and it works as expected. In addition we want to retrieve dynamic data from a database via function calls. This is described in https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/openai/openai/samples/v1-beta/javascript/functions.js it also works well. When I add the parameters for both in getChatCompletions only function calls are working. Access to uploaded data is not possible. API Versions: 2023-12-01-preview, 2023-08-01-preview. I checked the behavior with direct http-Rest requests to OpenAI using Postman and got the same result. BYOD and functions work when called in different requests but not together in one request.

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,191 questions
{count} vote

2 answers

Sort by: Most helpful
  1. SchildmannDominik-3228 5 Reputation points
    2024-02-07T15:05:55.78+00:00

    NOTE: The concurrent use of Chat Functions and Azure Chat Extensions on a single request is not yet supported. Supplying both will result in the Chat Functions information being ignored and the operation behaving as if only the Azure Chat Extensions were provided. To address this limitation, consider separating the evaluation of Chat Functions and Azure Chat Extensions across multiple requests in your solution design.

    From https://learn.microsoft.com/en-us/dotnet/api/overview/azure/ai.openai-readme?view=azure-dotnet-preview Assuming it's similar in the JavaScript SDK, although I'm not sure why it's the other way around for you.

    1 person found this answer helpful.
    0 comments No comments

  2. GuenterR 5 Reputation points
    2024-02-08T06:54:42.58+00:00

    Hi Dominik, Thanks for your answer. This note is missing on the Javascript SDK site. I already tried to separate functions and cognitive search in different requests but this didn't work well.
    Today I've changed the option parameters from "functions" (still works) to "tools". Now cognitive search is performed and functions in tools are ignored when both are sent in options.