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?

C#
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.
10,469 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,423 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 43,361 Reputation points Microsoft Employee
    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