runceel / AIPasteSampleApp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AIPasteSampleApp

動作方法

  1. Azure OpenAI Service のリソースを作成し gpt 3.5 turbo のモデルを gpt-35-turbo という名前でデプロイします。
  2. SmartPasteApp プロジェクトの appsettings.jsonEndpointApiKey を設定します。
    {
      "Logging": {
        "LogLevel": {
          "Default": "Information",
          "Microsoft.AspNetCore": "Warning"
        }
      },
      "AllowedHosts": "*",
      "SmartPasteOptions": {
        "DeploymentName": "gpt-35-turbo",
        "Endpoint": "https://<<Azure OpenAI Service のリソース名>>.openai.azure.com/",
        "ApiKey":  "<<Azure OpenAI Service の API キー>>"
      }
    }
  3. Visual Studio で SmartPasteApp プロジェクトを開き、デバッグ実行します。
  4. クリップボードにテキストがある状態で Smart Paste ボタンを押してください。

コードのポイント

SmartPasteLib プロジェクトの以下のクラスが Smart paste の実装に関連するクラスになります。

  • SmartPastePlaneFunctionCalling.cs
    • Azure OpenAI Service の Tools の関数呼び出しの機能を使って、Smart Paste を実装しています。
  • SmartPaste.cs
    • Semantic Kernel の FunctionCallingStepwisePlanner を使って、Smart Paste を実装しています。

About

License:MIT License


Languages

Language:C# 52.7%Language:HTML 26.8%Language:CSS 20.5%