This example assumes using DeepInfra; is in scope and apiKey contains your DeepInfra API key.
1 2 3 4 5 6 7 8 9101112
usingvarclient=GetAuthenticatedOpenAiClient();Meai.IChatClientchatClient=client;varresponse=awaitchatClient.GetResponseAsync([ new Meai.ChatMessage(Meai.ChatRole.System, "You always respond with exactly one word."), new Meai.ChatMessage(Meai.ChatRole.User, "What color is the sky?"), ],newMeai.ChatOptions{ModelId=DeepInfraModel});vartext=response.Messages[0].Text;Console.WriteLine(text);