Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.09k stars 1.21k forks source link

Unable to get citation when define Functions and Azure Search Extension options #30422

Closed rosdyana closed 4 months ago

rosdyana commented 4 months ago

Describe the bug Remember the following text:

If you define 'azure_search' under azureExtensionOptions and functions for GetChatCompletionsOptions, it will cause citations to disappear. My situation is that I am using my own data source from Azure Search and also defining a custom function to generate a PowerPoint slide file (PPTX). Is it possible to do that?

To Reproduce Steps to reproduce the behavior:

  1. Define 'azure_search' extensions under azureExtensionOptions.
  2. Define functionCalls to 'auto' and also define the custom function under 'function'.
  3. Try to get a response from getChatCompletions.
  4. No citations defined and it seems it doesn't use the data from azure_search.

Expected behavior When the prompt is not related to generating a file, it should respond with output from the azure_search data. When the prompt is to generate a file with output from azure_search, it will create the file.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

minhanh-phan commented 4 months ago

Hi @rosdyana, thank you for raising the issue. If I understand correctly, you are trying to use function call with Azure search extension. This is a service behavior documented here that data source will be ignored when tool choice is defined.

For more context, there are similar issues such as this and this. Since this is not an SDK issue, I'll go ahead and close this, but please feel free to reach out if you have more questions.

rosdyana commented 4 months ago

Hi @rosdyana, thank you for raising the issue. If I understand correctly, you are trying to use function call with Azure search extension. This is a service behavior documented here that data source will be ignored when tool choice is defined.

For more context, there are similar issues such as this and this. Since this is not an SDK issue, I'll go ahead and close this, but please feel free to reach out if you have more questions.

Yes, that's exactly what we want to do. It's good to know, thank you so much, @minhanh-phan. I appreciate it.