microsoft / semantic-kernel

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

.NET: Missing support for passing the 'user' field part of SK C# ChatCompletionsOptions and CompletionsOptions #4734

Closed slreznit closed 5 months ago

slreznit commented 5 months ago

Describe the bug Azure OpenAI API support passing the 'user' field part of ChatCompletionsOptions SK currently doesn't expose this field in C# and Gen-AI application developers cannot specify this field. I believe SK Java has support here and not sure about SK Python yet. This field is important as it is used to provide security coverage against threats including in Microsoft Azure OpenAI, and we should unblock and encourage Gen-AI & Copilot applications developers to populate this field.

To Reproduce

Steps to reproduce the behavior:

  1. Create app using Azure.AI.OpenAI C# SDK, you are able to populate the user field in ChatCompletionsOptions & CompletionsOptions
  2. Create app using SK C#, there is no such option

Expected behavior Gen-AI app developers should be able to populate the user field per request. This is important to support multi-user applications e.g. a Copilot or Bot that is hosted as a service and used by multiple users that log-in and interact with it. SK Chat-Copilot is a good example for that.

Screenshots https://github.com/microsoft/semantic-kernel/blob/f959256229c7d0d821d1df5c8b112ced10ddd5ac/dotnet/src/Connectors/Connectors.OpenAI/AzureSdk/ClientCore.cs#L717 image

https://github.com/microsoft/semantic-kernel/blob/f959256229c7d0d821d1df5c8b112ced10ddd5ac/dotnet/src/Connectors/Connectors.OpenAI/AzureSdk/ClientCore.cs#L751 image

Platform

Additional context

OpenAI:

slreznit commented 5 months ago

Created PR: https://github.com/microsoft/semantic-kernel/pull/4736

markwallace-microsoft commented 5 months ago

PR has been merged