ChatWithVision

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
using var api = GetAuthenticatedClient();

CreateChatCompletionResponse response = await api.Chat.CreateChatCompletionAsync(
    messages: [
        "Please describe the following image.",
        H.Resources.images_dog_and_cat_png.AsBytes().AsUserMessage(mimeType: "image/png"),
    ],
    model: CreateChatCompletionRequestModel.Gpt4o);

Console.WriteLine("[ASSISTANT]:");
Console.WriteLine($"{response.Choices[0].Message.Content}");