Join a webinar on April 30th: Unlocking Your Data using AI with Box Extract & MCP Server. Register here
curl -i -L POST "https://api.box.com/2.0/ai/text_gen" \
-H "content-type: application/json" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"prompt": "Write a social media post about protein powder.",
"items": [
{
"id": "12345678",
"type": "file",
"content": "More information about protein powders"
},
],
"dialogue_history": [
{
"prompt": "Can you add some more information?",
"answer": "Public API schemas provide necessary information to integrate with APIs...",
"created_at": "2013-12-12T11:20:43-08:00"
}
],
"ai_agent": {
"type": "ai_agent_text_gen",
"basic_gen": {
"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"
}
}サポートされている大規模言語モデル (LLM) にAIリクエストを送信し、提供されたプロンプトに基づいて生成されたテキストを返します。
curl -i -L POST "https://api.box.com/2.0/ai/text_gen" \
-H "content-type: application/json" \
-H "authorization: Bearer <ACCESS_TOKEN>" \
-d '{
"prompt": "Write a social media post about protein powder.",
"items": [
{
"id": "12345678",
"type": "file",
"content": "More information about protein powders"
},
],
"dialogue_history": [
{
"prompt": "Can you add some more information?",
"answer": "Public API schemas provide necessary information to integrate with APIs...",
"created_at": "2013-12-12T11:20:43-08:00"
}
],
"ai_agent": {
"type": "ai_agent_text_gen",
"basic_gen": {
"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"
}
}The access token received from the authorization server in the OAuth 2.0 flow.
AIへのテキスト生成リクエストオブジェクト。
LLMが回答するようにクライアントが提供するプロンプト。プロンプトの長さは10000文字に制限されています。
"Write an email to a client about the importance of public APIs."
LLMで処理する項目 (多くの場合はファイル)。この配列に含めることができる要素は1つだけです。
注: Box AIは、最大1 MBのテキストレプリゼンテーションを含むドキュメントを処理します。ファイルサイズが1 MBを超えた場合は、テキストレプリゼンテーションの最初の1 MBが処理されます。
1 elementShow child attributes
これまでにLLMに渡されたプロンプトおよび回答の履歴。このパラメータにより、レスポンスの生成時にLLMに追加のコンテキストが提供されます。
Show child attributes
テキストの生成に使用されるAIエージェント。
Show child attributes
LLMからの回答を含む成功したレスポンス。
AIの応答。
LLMから提供された回答。
"Public APIs are important because of key and important reasons."
プロンプトに対する回答が作成された時点のISO日付形式のタイムスタンプ。
"2012-12-12T10:53:43-08:00"
応答が終了した理由。
"done"
リクエストで使用されるモデルおよびプロセッサに関する情報。
Show child attributes
このページは役に立ちましたか?