メインコンテンツへスキップ
POST
/
ai
/
extract
cURL
curl -i -L 'https://api.box.com/2.0/ai/extract' \
     -H 'content-type: application/json' \
     -H 'authorization: Bearer <ACCESS_TOKEN>' \
     -d '{
        "prompt": "Extract data related to contract conditions",
        "items": [
              {
                  "type": "file",
                  "id": "1497741268097"
              }
        ],
        "ai_agent": {
          "type": "ai_agent_extract",
          "long_text": {
            "model": "azure__openai__gpt_4o_mini",
            "prompt_template": "It is `{current_date}`, and I have $8000 and want to spend a week in the Azores. What should I see?",
          },
          "basic_text": {
            "model": "azure__openai__gpt_4o_mini",
          }
        }
      }'
{
  "answer": "Public APIs are important because of key and important reasons.",
  "created_at": "2012-12-12T10:53:43-08:00",
  "completion_reason": "done",
  "ai_agent_info": {
    "models": [
      {
        "name": "azure__openai__text_embedding_ada_002",
        "provider": "azure",
        "supported_purpose": "embedding"
      }
    ],
    "processor": "basic_text"
  }
}
このリソースは、バージョン2024.0のエンドポイントで使用されています。 詳細については、 Box APIのバージョン管理を参照してください。Box SDKのバージョニング戦略について詳しく学ぶ。」

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

AIへのメタデータ抽出 (自由形式) リクエストオブジェクト。

prompt
string
required

リクエストで大規模言語モデル (LLM) に提供されるプロンプト。プロンプトには、最大10,000文字を指定できるほか、XMLまたはJSONスキーマを使用することができます。

Example:

"\\\"fields\\\":[{\\\"type\\\":\\\"string\\\",\\\"key\\\":\\\"name\\\",\\\"displayName\\\":\\\"Name\\\",\\\"description\\\":\\\"The customer name\\\",\\\"prompt\\\":\\\"Name is always the first word in the document\\\"},{\\\"type\\\":\\\"date\\\",\\\"key\\\":\\\"last_contacted_at\\\",\\\"displayName\\\":\\\"Last Contacted At\\\",\\\"description\\\":\\\"When this customer was last contacted at\\\"}]"

items
AI項目 (Base) · object[]
required

LLMで処理される項目。現在使用できるのはファイルのみです。

Required array length: 1 - 25 elements
ai_agent
AIへのメタデータ抽出 (自由形式) リクエストのエージェント · object

抽出に使用されるAIエージェント。

Response

LLMからの回答を含むレスポンス。

AIの応答。

answer
string
required

LLMから提供された回答。

Example:

"Public APIs are important because of key and important reasons."

created_at
string<date-time>
required

プロンプトに対する回答が作成された時点のISO日付形式のタイムスタンプ。

Example:

"2012-12-12T10:53:43-08:00"

completion_reason
string

応答が終了した理由。

Example:

"done"

ai_agent_info
リクエストで使用されるモデルおよびプロセッサに関する情報。 · object

リクエストで使用されるモデルおよびプロセッサに関する情報。