Join a webinar on April 30th: Unlocking Your Data using AI with Box Extract & MCP Server. Register here
curl -i -L 'https://api.box.com/2.0/ai/extract_structured' \
-H 'content-type: application/json' \
-H 'authorization: Bearer <ACCESS_TOKEN>' \
-d '{
"items": [
{
"id": "12345678",
"type": "file",
"content": "This is file content."
}
],
"metadata_template": {
"template_key": "",
"type": "metadata_template",
"scope": ""
},
"fields": [
{
"key": "name",
"description": "The name of the person.",
"displayName": "Name",
"prompt": "The name is the first and last name from the email address.",
"type": "string",
"options": [
{
"key": "First Name"
},
{
"key": "Last Name"
}
]
}
],
"ai_agent": {
"type": "ai_agent_extract_structured",
"long_text": {
"model": "azure__openai__gpt_4o_mini"
},
"basic_text": {
"model": "azure__openai__gpt_4o_mini"
}
}
}'{
"answer": {},
"created_at": "2012-12-12T10:53:43-08:00",
"completion_reason": "done",
"confidence_score": {},
"ai_agent_info": {
"models": [
{
"name": "azure__openai__text_embedding_ada_002",
"provider": "azure",
"supported_purpose": "embedding"
}
],
"processor": "basic_text"
}
}サポートされている大規模言語モデル (LLM) にAIリクエストを送信し、抽出されたメタデータを一連のキー/値ペアとして返します。
抽出の構造を定義するには、メタデータテンプレートまたはフィールドのリストを指定します。テンプレート作成の詳細については、メタデータテンプレートのカスタマイズを参照するか、メタデータテンプレートAPIを使用してください。
このエンドポイントは、抽出エージェント (強化) もサポートしています。
サポートされているファイル形式と言語については、ファイルからメタデータを抽出する (構造化) APIガイドを参照してください。
curl -i -L 'https://api.box.com/2.0/ai/extract_structured' \
-H 'content-type: application/json' \
-H 'authorization: Bearer <ACCESS_TOKEN>' \
-d '{
"items": [
{
"id": "12345678",
"type": "file",
"content": "This is file content."
}
],
"metadata_template": {
"template_key": "",
"type": "metadata_template",
"scope": ""
},
"fields": [
{
"key": "name",
"description": "The name of the person.",
"displayName": "Name",
"prompt": "The name is the first and last name from the email address.",
"type": "string",
"options": [
{
"key": "First Name"
},
{
"key": "Last Name"
}
]
}
],
"ai_agent": {
"type": "ai_agent_extract_structured",
"long_text": {
"model": "azure__openai__gpt_4o_mini"
},
"basic_text": {
"model": "azure__openai__gpt_4o_mini"
}
}
}'{
"answer": {},
"created_at": "2012-12-12T10:53:43-08:00",
"completion_reason": "done",
"confidence_score": {},
"ai_agent_info": {
"models": [
{
"name": "azure__openai__text_embedding_ada_002",
"provider": "azure",
"supported_purpose": "embedding"
}
],
"processor": "basic_text"
}
}The access token received from the authorization server in the OAuth 2.0 flow.
AIによる抽出 (構造化) リクエストオブジェクト。
LLMで処理する項目。現在使用できるのはファイルのみです。
1 - 25 elementsShow child attributes
抽出するフィールドを含むメタデータテンプレート。リクエストを機能させるには、metadata_templateまたはfieldsを指定する必要がありますが、両方を指定することはできません。
Show child attributes
指定された項目から抽出するフィールド。リクエストを機能させるには、metadata_templateまたはfieldsを指定する必要がありますが、両方を指定することはできません。
1Show child attributes
抽出された各フィールドの信頼度スコアを返すかどうかを示すフラグ。
true
抽出 (構造化) に使用されるAIエージェント。指定しなかった場合、デフォルトではエージェント (標準) になります。抽出エージェント (強化) を使用する場合の詳細については、抽出エージェント (強化) を参照してください。
Show child attributes
LLMからの回答を含む成功したレスポンス。
AIによる抽出 (構造化) のレスポンス。
AIによる抽出のレスポンス。このレスポンスのコンテンツは、リクエストされた構成に応じて異なる場合があります。
Show child attributes
プロンプトに対する回答が作成された時点のISO日付形式のタイムスタンプ。
"2012-12-12T10:53:43-08:00"
応答が終了した理由。
"done"
JSON形式の辞書として抽出された各フィールドの信頼度スコアレベルと数値。フィールドが抽出されなかった場合は空になります。
Show child attributes
リクエストで使用されるモデルおよびプロセッサに関する情報。
Show child attributes
このページは役に立ちましたか?