Skip to content

Instantly share code, notes, and snippets.

@Adolfi
Created June 10, 2024 06:54
Show Gist options
  • Save Adolfi/e11ba7e49d753b6553ccc756d155a4f6 to your computer and use it in GitHub Desktop.
Save Adolfi/e11ba7e49d753b6553ccc756d155a4f6 to your computer and use it in GitHub Desktop.
using Azure;
using Azure.AI.OpenAI;
using OpenAI.Chat;
AzureOpenAIClient azureClient = new(
new Uri("YOUR_API_ENDPOINT"),
new AzureKeyCredential("YOUR_API_KEY"));
ChatCompletion completion = azureClient.GetChatClient("YOUR_DEPLOYMENT_NAME").CompleteChat([
new UserChatMessage("What is the capital of France?"),
]);
Console.WriteLine(completion.Content[0].Text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment