assembly version mismatch when using OpenAIClient

akhil5895
Observer
Observer

assembly version mismatch when using OpenAIClient

akhil5895
Observer
Observer

Im trying to get response from openAI by sending prompt in class library, I have downloaded azure.AI.OpenAI package then Im unable to create client but same code is working fine when Im using winforms project template without any error

here is the code:

private async void button1_Click(object sender, EventArgs e)
{

OpenAIClient client = new OpenAIClient(new Uri( "my uri"), new AzureKeyCredential("my key"));

var chatCompletionsOptions = new ChatCompletionsOptions()
{
DeploymentName = "my deployment name", //This must match the custom deployment name you chose for your model
Messages =
{
new ChatRequestSystemMessage("You are a helpful assistant."),

new ChatRequestUserMessage("please translate 'BUILDING FINAL DETAILS TO BE CONFIRMED BY A SUPPLIER IN THE NEXT PROJECT PHASE.' to spanish."),
new ChatRequestAssistantMessage(""),
},
MaxTokens = 100
};

Response<ChatCompletions> response = client.GetChatCompletions(chatCompletionsOptions);

Console.WriteLine(response.Value.Choices[0].Message.Content.Split('"')[1]);

Console.WriteLine();

}

0 Likes
Reply
178 Views
1 Reply
Reply (1)

jeremy_tammik
Autodesk
Autodesk

Afaik, assembly version mismatch is a simple warning, not an error. So, you may be able to simply ignore it. Alternatively, you can suppress it, as I often did in the past for the Revit API assemblies:

 

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes