AIエージェントのデフォルト構成の取得

ガイド Box AI AIエージェントのデフォルト構成の取得

AIエージェントのデフォルト構成の取得

Box AIのPlatform APIは、現在ベータ版のため、利用可能な機能が変更される可能性があります。Box AIのPlatform APIは、Enterprise Plusをご利用のすべてのお客様が利用できます。

GET /2.0/ai_agent_defaultエンドポイントを使用すると、AIサービスのデフォルト構成を取得できます。構成の詳細を取得したら、POST /2.0/ai/askおよびPOST /2.0/ai/text_genリクエストで利用可能なai_agentパラメータを使用して構成を上書きできます。

上書きの例を以下に示します。

  • 組織のニーズに基づいて、デフォルトのLLMをカスタムのLLMに置き換える。
  • ベースとなるプロンプトを微調整し、よりカスタマイズされたユーザーエクスペリエンスを実現する。
  • temperatureなどのパラメータを変更して、結果の創造性を調整する。

リクエストの送信

リクエストを送信するには、GET /2.0/ai_agent_defaultエンドポイントを使用します。

cURL
curl -L GET "https://api.box.com/2.0/ai_agent_default?mode=text_gen" \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
TypeScript Gen
await client.ai.getAiAgentDefaultConfig({
  mode: 'text_gen' as GetAiAgentDefaultConfigQueryParamsModeField,
  language: 'en-US',
} satisfies GetAiAgentDefaultConfigQueryParams);
Python Gen
client.ai.get_ai_agent_default_config(
    GetAiAgentDefaultConfigMode.TEXT_GEN.value, language="en-US"
)
.NET Gen
await client.Ai.GetAiAgentDefaultConfigAsync(queryParams: new GetAiAgentDefaultConfigQueryParams(mode: GetAiAgentDefaultConfigQueryParamsModeField.TextGen) { Language = "en-US" });
Java
BoxAIAgentConfig config = BoxAI.getAiAgentDefaultConfig(
    api,
    BoxAIAgent.Mode.ASK,
    "en",
    "openai__gpt_3_5_turbo"
);
Python
config = client.get_ai_agent_default_config(
    mode='text_gen',
    language='en',
    model='openai__gpt_3_5_turbo'
)
print(config)
Node
client.ai.getAiAgentDefaultConfig({
    mode: 'ask',
    language: 'en',
    model:'openai__gpt_3_5_turbo'
}).then(response => {
    /* response -> {
        "type": "ai_agent_ask",
        "basic_text": {
            "llm_endpoint_params": {
            "type": "openai_params",
            "frequency_penalty": 1.5,
            "presence_penalty": 1.5,
            "stop": "<|im_end|>",
            "temperature": 0,
            "top_p": 1
            },
            "model": "openai__gpt_3_5_turbo",
            "num_tokens_for_completion": 8400,
            "prompt_template": "It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. What should I see?",
            "system_message": "You are a helpful travel assistant specialized in budget travel"
        },
        ...
    } */
});

アプリを承認するための開発者トークンを生成済みであることを確認します。詳細については、Box AIを使用するための前提条件を確認してください。

パラメータ

コールを実行するには、以下のパラメータを渡す必要があります。必須のパラメータは太字で示されています。

パラメータ説明
language返されるエージェントの構成の言語コード。その言語がサポートされていない場合は、デフォルト構成が返されます。ja-JP
modeエージェントの構成にフィルタをかけるためのモード。値はaskまたはtext_genになります。ask
model構成を取得する対象となるモデル。選択したモデルがサポートされていることを確認するには、モデルのリストを参照してください。openai__gpt_3_5_turbo