Skip to content

Commit de8d5a9

Browse files
committed
Moji: Update translations
1 parent 165b602 commit de8d5a9

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed

guides/box-ai/ai-tutorials/extract-metadata-structured.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,70 @@ curl --location 'https://api.box.com/2.0/ai/extract_structured' \
189189
190190
```
191191
192+
### Enhanced Extract Agent
193+
194+
To start using the agent, you need:
195+
196+
* A Box Platform App with enabled `Manage AI` scope.
197+
* The app installed and enabled in your Box instance.
198+
* A file to test with.
199+
200+
Calling an Enhanced Extract Agent works like calling the AI API - set the `type` to `AI Agent ID`, then string to the Enhanced Extract AI agent.
201+
202+
To extract data using the Enhanced Extract Agent you need:
203+
204+
* Inline field definitions created with `agentCreateAiExtractStructuredMetadataTemplate` if your fields change frequently,
205+
* or a metadata template that contains the data about the fields you wish to extract, if your extracted fields stay the same.
206+
207+
See the full sample Python script that demonstrates how to call the Enhanced Extract Agent on a file using the Box AI SDK:
208+
209+
```Python
210+
from box_sdk_gen import (
211+
AiAgentReference,
212+
AiAgentReferenceTypeField,
213+
AiItemBase,
214+
AiItemBaseTypeField,
215+
BoxClient,
216+
BoxCCGAuth,
217+
CCGConfig,
218+
CreateAiExtractStructuredMetadataTemplate
219+
)
220+
221+
# Create your client credentials grant config from the developer console
222+
ccg_config = CCGConfig(
223+
client_id="my_box_client_id", # replace with your client id
224+
client_secret="my_box_client_secret", # replace with your client secret
225+
user_id="my_box_user_id", # replace with the box user id that has access
226+
# to the file you are referencing
227+
)
228+
auth = BoxCCGAuth(config=ccg_config)
229+
client = BoxClient(auth=auth)
230+
# Create the agent config referencing the enhanced extract agent
231+
enhanced_extract_agent_config = AiAgentReference(
232+
id="enhanced_extract_agent",
233+
type=AiAgentReferenceTypeField.AI_AGENT_ID
234+
)
235+
# Use the Box SDK to call the extract_structured endpoint
236+
box_ai_response = client.ai.create_ai_extract_structured(
237+
# Create the items array containing the file information to extract from
238+
items=[
239+
AiItemBase(
240+
id="my_box_file_id", # replace with the file id
241+
type=AiItemBaseTypeField.FILE
242+
)
243+
],
244+
# Reference the Box Metadata template
245+
metadata_template=CreateAiExtractStructuredMetadataTemplate(
246+
template_key="InvoicePO",
247+
scope="enterprise"
248+
),
249+
# Attach the agent config you created earlier
250+
ai_agent=enhanced_extract_agent_config,
251+
)
252+
print(f"box_ai_response: {box_ai_response.answer}")
253+
254+
```
255+
192256
[prereq]: g://box-ai/ai-tutorials/prerequisites
193257
194258
[agent]: e://get_ai_agent_default

guides/box-ai/index.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,18 @@ Box AI APIを使用すると、テキストをゼロから生成したり、Box
5757

5858
[`POST /2.0/ai/extract`][extract]および[`POST /2.0/ai/extract_structured`][extract-structured]エンドポイントを使用すると、指定した入力からデータを抽出し、キー/値ペアの形式で返すことができます。
5959

60-
* `extract_structured`エンドポイントは、メタデータテンプレートから取得したあらかじめ定義された構造、または一連のフィールドに従ってデータを抽出する場合に使用します。
60+
* Use the `extract_structured` endpoint to extract data according to a pre-defined structure obtained from the metadata template, or a set of fields. Use it for shorter documents
61+
* Use the Enhanced Extract Agent for long, complex documents
6162
* `extract`エンドポイントは、プロンプトを使用してファイルからデータを抽出する場合に使用します。プロンプトには、JSONやXMLなどの形式の文字列化バージョン、またはプレーンテキストを含めることができます。
6263

64+
#### Enhanced Extract Agent
65+
66+
The Enhanced Extract Agent is designed to extract key-value pairs from complex documents. It converts the unstructured content into metadata for easier discovery and search.
67+
68+
You can [use the agent][eea-tutorial] through the Box AI API and turn unstructured data into structured output to use in production databases, third party systems, or analytics.
69+
70+
The Enhanced Extract Agent uses Gemini 2.5 Pro to provide a chain-of-thought reasoning and returns both the extracted values and a reasoning behind its answer.
71+
6372
### 構成の上書き
6473

6574
デフォルトのエージェント構成を上書きし、独自のカスタム設定を導入するには、Box AI APIリクエストで利用可能な`ai_agent`パラメータを使用できます。
@@ -102,3 +111,5 @@ Box AIは、英語、日本語、フランス語、スペイン語など、多
102111
[extract]: e://post_ai_extract
103112

104113
[extract-structured]: e://post_ai_extract_structured
114+
115+
[eea-tutorial]: g://box-ai/ai-tutorials/extract-metadata-structured#

0 commit comments

Comments
 (0)