MCPcopy Create free account
hub / github.com/CaviraOSS/OpenReason / runExample

Function runExample

examples/code/provider-examples.ts:15–24  ·  view source on GitHub ↗
(label: string, cfg: ProviderConfig, query: string)

Source from the content-addressed store, hash-verified

13};
14
15async 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
26async function main() {
27 await runExample("openai", {

Callers 1

mainFunction · 0.85

Calls 1

missingKeyFunction · 0.85

Tested by

no test coverage detected