jodendaal/OpenAI.Net

User ID

Closed this issue · 2 comments

I'm using this library in my code and find it very helpful. I have a lot of users and am interested in starting to send the User or UserID optional parameter. Do you have any plans to add this in the requests for images, chats, completions, or maybe an option in the client configuration? Thank you.

Hi,

The property is already available to use on all those places mentioned. It is part of the request that can be set.

 var messages = new List<Message>
            {
                Message.Create(ChatRoleType.User, "Say this is a test")
            };

            var request = new ChatCompletionRequest(messages)
            {
                Model = model,
                User = "User1"
            };

Using extension methods

 var response = await OpenAIService.Chat.Get(messages,o => {
                o.MaxTokens = 1000;
                o.Model = model;
                o.User = "User1";
            });

Excellent, Thank you!