AI
Generate text
Changed onSends an AI request to supported Large Language Models (LLMs) and returns generated text based on the provided prompt.
post/ai/text_gen
Request
- Base URLhttps://api.box.com/2.0
- URLhttps://api.box.com/2.0/ai/text_gen
- AuthOAuth 2Authorization code: https://account.box.com/api/oauth2/authorizeToken URL: https://api.box.com/oauth2/token
Request body
Example request
{
"prompt": "Write an email to a client about the importance of public APIs.",
"items": [
{
"id": "123",
"type": "file",
"content": "This is file content that is relevant to the text gen request."
}
],
"dialogue_history": [
{
"prompt": "Make my email about public APIs sound more professional.",
"answer": "Here is the first draft of your professional email about public APIs.",
"created_at": "2012-12-12T10:53:43-08:00"
}
],
"ai_agent": {
"type": "ai_agent_id",
"id": "14031"
}
}Response
A successful response including the answer from the LLM.
Example response
{
"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"
}
}Changes
- warning
added the new
unprocessable_entityenum value to theresponse property for the response status - warning
added the new
unprocessable_entityenum value to theresponse property for the response status
- warning