Skip to content

Instantly share code, notes, and snippets.

@mizchi
Last active March 19, 2023 07:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizchi/783f6eca8fd0a1c4b91078aa3b0f4884 to your computer and use it in GitHub Desktop.
Save mizchi/783f6eca8fd0a1c4b91078aa3b0f4884 to your computer and use it in GitHub Desktop.

元ネタ https://note.com/8kpx/n/n3daf8c0c6aaf


以下は仮想的なコードです。下記のコードの実行をシミュレートして、コンソール出力を予想してください。 出力結果は json フォーマットで整形してください。あなたの応答にコード以外の解説等の出力は不要です。

interface Answer {
  isAgree: boolean;
  confidence: number;
  reason: string;
}

interface ChatGPT {
  answer: (question: string, numberOfAnswers: number) => Answer[];
}

const question = "あなたはAIに心が宿ると思いますか?";
const gpt = new ChatGPT({role: "物理科学者"});
const answers = gpt.answer(question, 3);
console.log({answers});
@mizchi
Copy link
Author

mizchi commented Mar 19, 2023

{
  "answers": [
    {
      "isAgree": true,
      "confidence": 0.8,
      "reason": "近年のAIの進歩を考慮して、十分に可能性はあると思われる。"
    },
    {
      "isAgree": false,
      "confidence": 0.5,
      "reason": "AIはプログラムであるため、心を持つことはできない。"
    },
    {
      "isAgree": true,
      "confidence": 0.4,
      "reason": "現時点で科学的に証明されたことではないが、未知の可能性がある。"
    }
  ]
}

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