microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.49k stars 3.17k forks source link

Keep user intent in current language for Azure Search query #1410

Closed methodidacte closed 1 year ago

methodidacte commented 1 year ago

I am working with a french imported document, using Azure Search for memory. I can see in the prompt that the document isn't used for the bot's answer. Looking at the search query, I discover that the user intent is translated in english and the queryLanguage is en-US (default value of the API).

?api-version=2021-04-30-Preview&searchMode=Any&search=User intent: According to best practices, is it always necessary to use the administrator account?&queryType=Semantic&queryLanguage=en-us&$top=100

Could it be possible to keep the intent in the current language spoken by the bot and adapt the queryLanguage parameter ? I try to find where this search query is build but don't find it in the code.

methodidacte commented 1 year ago

image

The parameter is in the file https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.Memory.AzureCognitiveSearch/AzureCognitiveSearchMemory.cs. I don't know how to identify the correct culture from the chat and change the value dynamicly.

JadynWong commented 1 year ago

Based on PR #1174 and #1439, I think this package(semantic search) may be deprecated, and eventually implemented by embedding vector search.

alexchaomander commented 1 year ago

@dluc can you comment on whether the semantic search package is going to be replaced with Azure Cognitive Search?

nacharya1 commented 1 year ago

@dluc - can you provide some more details to help on this question.

lemillermicrosoft commented 1 year ago

Latest code does not hardcode en-us https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Connectors/Connectors.Memory.AzureCognitiveSearch/AzureCognitiveSearchMemoryStore.cs