AI
Extract metadata (freeform)
Changed onSends an AI request to supported Large Language Models (LLMs) and extracts metadata in form of key-value pairs. In this request, both the prompt and the output can be freeform. Metadata template setup before sending the request is not required.
post/ai/extract
Request
- Base URLhttps://api.box.com/2.0
- URLhttps://api.box.com/2.0/ai/extract
- AuthOAuth 2Authorization code: https://account.box.com/api/oauth2/authorizeToken URL: https://api.box.com/oauth2/token
Request body
Example request
{
"prompt": "\\\"fields\\\":[{\\\"type\\\":\\\"string\\\",\\\"key\\\":\\\"name\\\",\\\"displayName\\\":\\\"Name\\\",\\\"description\\\":\\\"The customer name\\\",\\\"prompt\\\":\\\"Name is always the first word in the document\\\"},{\\\"type\\\":\\\"date\\\",\\\"key\\\":\\\"last_contacted_at\\\",\\\"displayName\\\":\\\"Last Contacted At\\\",\\\"description\\\":\\\"When this customer was last contacted at\\\"}]",
"items": [
{
"id": "123",
"type": "file",
"content": "This is file content."
}
],
"ai_agent": {
"type": "ai_agent_id",
"id": "14031"
}
}Response
A 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 - info
added the non-success response with the status
- warning