Ω
Send scenarios to /api/v2/judge
| 1 | import { OmegaClient, type OmegaDecisionResponse } from "@omegaengine/sdk"; |
| 2 | |
| 3 | const omega = new OmegaClient({ |
| 4 | baseUrl: "https://omegaengine.ai", |
| 5 | apiKey: "YOUR_API_KEY_HERE", |
| 6 | }); |
| 7 | |
| 8 | const result: OmegaDecisionResponse = await omega.decide({ |
| 9 | "scenario": "I'm thinking about quitting my job to start a business.", |
| 10 | "context": "I have 6 months of savings and no dependents.", |
| 11 | "domain": "LIFE", |
| 12 | "riskTolerance": "MEDIUM", |
| 13 | "mode": "DECISION", |
| 14 | "explain": true |
| 15 | }); |
| 16 | |
| 17 | if (result.decision?.riskLevel === "CRITICAL") { |
| 18 | throw new Error(`Action blocked: ${result.decision.summary}`); |
| 19 | } |