Skip to main content

Endpoint

POST /loopos_ai_decision Makes a decision based on a prompt and options using AI analysis.

Request

language
string
default:"PT-PT"
Language code for the request
prompt
string
required
The decision prompt/question to be answered
options
array or string
required
List of options to choose from (can be comma-separated string)
item_context
string
required
Context about the item for the decision
context
string
Additional context for the decision
loopos_core_context
string
Business context for the AI agent

Response

decision
string
required
The selected option (guaranteed to be one of the provided options)
reasoning
string
required
Explanation of why this decision was made

Example Request

{
  "language": "PT-PT",
  "prompt": "What condition best describes this item?",
  "options": ["Excellent", "Good", "Fair", "Poor"],
  "item_context": "iPhone 12 with minor scratches",
  "context": "Assessing item condition for marketplace listing"
}

Example Response

{
  "decision": "Good",
  "reasoning": "Based on the description of minor scratches, the item is in good condition. While not excellent, it shows only light wear and remains fully functional."
}