サポートされている大規模言語モデル (LLM) にAIリクエストを送信し、提供されたプロンプトに基づいて生成されたテキストを返します。
テキストの生成に使用されるAIエージェント。
これまでにLLMに渡されたプロンプトおよび回答の履歴。このパラメータにより、レスポンスの生成時にLLMに追加のコンテキストが提供されます。
"Here is the first draft of your professional email about public APIs."
以前にLLMから提供された回答。
"2012-12-12T10:53:43-08:00"
プロンプトに対する前回の回答が作成された時点のISO日付形式のタイムスタンプ。
"Make my email about public APIs sound more professional."
以前にクライアントによって提供され、LLMが回答したプロンプト。
LLMで処理する項目 (多くの場合はファイル)。この配列に含めることができる要素は1つだけです。
注: Box AIは、最大1 MBのテキストレプリゼンテーションを含むドキュメントを処理します。ファイルサイズが1 MBを超えた場合は、テキストレプリゼンテーションの最初の1 MBが処理されます。
"123"
項目のID。
"file"
項目のタイプ。
次の値に固定: file
"This is file content that is relevant to the text gen request."
新規テキストを生成したり既存テキストを編集したりする場合にコンテキストとして使用するコンテンツ。
"Write an email to a client about the importance of public APIs."
LLMが回答するようにクライアントが提供するプロンプト。プロンプトの長さは10000文字に制限されています。
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"
}
}
}'
{
"ai_agent_info": {
"models": [
{
"name": "azure__openai__text_embedding_ada_002",
"provider": "azure",
"supported_purpose": "embedding"
}
],
"processor": "basic_text"
},
"answer": "Public APIs are important because of key and important reasons.",
"completion_reason": "done",
"created_at": "2012-12-12T10:53:43-08:00"
}