(label: string, cfg: ProviderConfig, query: string)
| 13 | }; |
| 14 | |
| 15 | async function runExample(label: string, cfg: ProviderConfig, query: string) { |
| 16 | if (!cfg.apiKey) { |
| 17 | missingKey(label); |
| 18 | return; |
| 19 | } |
| 20 | console.log(`\n=== ${label} ===`); |
| 21 | openreason.init(cfg); |
| 22 | const result = await openreason.reason(query); |
| 23 | console.log({ verdict: result.verdict, confidence: result.confidence, mode: result.mode, latency: result.latency, domain: result.domain }); |
| 24 | } |
| 25 | |
| 26 | async function main() { |
| 27 | await runExample("openai", { |