Visual Studio pro 2022でChatMessageがエラーになってしまう。

Anonymous
2024-01-12T04:03:42+00:00

Visual Studio Professional 2022 を用いてAzureOpenAIのチャット機能を利用したいと考えております。

以下コードのように単純な回答をさせたいのですが、

ChatMessageでエラーになってしまします。(CS0246)

何が原因か、解決方法を教えて頂きたいです。

 ※"dotnet add package Azure.AI.OpenAI --prerelease" をパッケージマネージャーコンソールで実施済みです。

using Azure.AI.OpenAI;
using Azure;

ーーーー一部省略ーーーーー

Console.Write("prompt:");
string prompt = Console.ReadLine() ?? "Hello.";

var response = client.GetChatCompletions( MODEL_NAME,
    new ChatCompletionsOptions()
    {
        Messages = {
            new ChatMessage(ChatRole.User,prompt),
        },
    });

Windows Windows Client for IT Pros ID およびアクセス管理

ロックされた質問。 This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 件のコメント コメントはありません
{count} 件の投票

2 件の回答

並べ替え方法: 最も役に立つ
  1. Anonymous
    2024-01-12T04:26:11+00:00

    こちらのフォーラムは IT プロフェッショナル向け(管理運用)となっていますので、開発関連の質問は(Azure Open AI Service であれば)以下に投稿してください。

    Azure OpenAI Service - Microsoft Q&A

    0 件のコメント コメントはありません
  2. Anonymous
    2024-01-12T04:42:46+00:00

    ご連絡ありがとうございます。

    大変申し訳ございません。

    頂いたサイトにて投稿いたします。

    0 件のコメント コメントはありません