Decision Engine
The Decision Engine helps you make complex decisions based on specific criteria and constraints.
const decisionResponse = await exnest.structuredDecision( [ { role: "user", content: "Should we migrate our database to NoSQL?" } ], { decisionType: "technical_architecture", criteria: ["scalability", "maintainability", "cost"], constraints: ["must be open source", "budget < $500/month"] });
console.log(decisionResponse.choices[0].message.content);from exnestai import EBCDecisionContext
# Performs structured analysis based on decision contextdecision_context = EBCDecisionContext( decisionType="technical_architecture", criteria=["scalability", "maintainability", "cost"], constraints=["must be open source", "budget < $500/month"])
decision_response = await client.structured_decision( messages=[ExnestMessage(role="user", content="Should we migrate our database to NoSQL?")], context=decision_context)
if not decision_response.error: print(f"\nStructured Decision: {decision_response.choices[0].message.content}")Raw HTTP API
Section titled “Raw HTTP API”curl -X POST https://api.exnest.app/v1/ebc/structured-decision \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": "Help me choose between job offers from Google and Microsoft" } ], "context": { "decisionType": "career_choice", "criteria": [ "salary_comparison", "growth_opportunities", "work_life_balance", "company_culture", "learning_opportunities" ], "timeframe": "immediate", "priority": "high", "constraints": [ "must_relocate", "family_considerations" ], "preferences": { "risk_tolerance": "medium", "career_stage": "mid-level", "work_style": "collaborative" } }, "max_tokens": 2000, "exnest_metadata": true }'