Skip to content

Instantly share code, notes, and snippets.

@vman
Last active September 22, 2024 08:55
Show Gist options
  • Save vman/04d46f62b4d4bf4b08cc5e0ae26441c6 to your computer and use it in GitHub Desktop.
Save vman/04d46f62b4d4bf4b08cc5e0ae26441c6 to your computer and use it in GitHub Desktop.
var chatClient = openAiClient.GetChatClient(deploymentName);
List<ChatMessage> messages = [
new UserChatMessage(
ChatMessageContentPart.CreateImageMessageContentPart(BinaryData.FromStream(File.OpenRead("C:\\images\\ROBOT ASTRONAUT .png")), "image/jpg" ,
ImageChatMessageContentPartDetail.High)
),
new UserChatMessage("What is in this image?")
];
ChatCompletion chatCompletion = chatClient.CompleteChat(messages);
Console.WriteLine($"[ASSISTANT]: {chatCompletion}");

[ASSISTANT]: The image depicts a futuristic humanoid robot standing in an alien landscape. The robot has a detailed, intricate design with visible mechanical components and a spacesuit-like exterior. In the background, a colorful cosmic scene with stars, a luminous nebula, and a distant planet can be seen, creating a sci-fi atmosphere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment