C# call Azure OpenAI gpt-35-turbo and set Message dynamically

진세훈 DX팀(YA) 0 Reputation points
2023-04-26T00:37:17.49+00:00

i use Azure.AI.OpenAI and use function( client.GetChatCompletionsAsync ) for call the OpenAI API like that1

it work well.

so, i want to change the Messages to variables List User's image

but that is not work, Because the Messages provide readonly. do you know how?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 49,096 Reputation points Microsoft Employee Moderator
    2023-04-26T11:10:20.7733333+00:00

    @진세훈 DX팀(YA) I think the same question is answered by the SDK team on the dotnet SDK github repo. Please see this thread for details. It looks like by design, all list-based members of models in the Azure SDK libraries are read-only.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.