risicare 0.1.5 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/frameworks/instructor.cjs +178 -0
- package/dist/frameworks/instructor.cjs.map +1 -0
- package/dist/frameworks/instructor.d.cts +28 -0
- package/dist/frameworks/instructor.d.ts +28 -0
- package/dist/frameworks/instructor.js +151 -0
- package/dist/frameworks/instructor.js.map +1 -0
- package/dist/frameworks/langchain.cjs +262 -0
- package/dist/frameworks/langchain.cjs.map +1 -0
- package/dist/frameworks/langchain.d.cts +45 -0
- package/dist/frameworks/langchain.d.ts +45 -0
- package/dist/frameworks/langchain.js +235 -0
- package/dist/frameworks/langchain.js.map +1 -0
- package/dist/frameworks/langgraph.cjs +296 -0
- package/dist/frameworks/langgraph.cjs.map +1 -0
- package/dist/frameworks/langgraph.d.cts +28 -0
- package/dist/frameworks/langgraph.d.ts +28 -0
- package/dist/frameworks/langgraph.js +269 -0
- package/dist/frameworks/langgraph.js.map +1 -0
- package/dist/frameworks/llamaindex.cjs +239 -0
- package/dist/frameworks/llamaindex.cjs.map +1 -0
- package/dist/frameworks/llamaindex.d.cts +55 -0
- package/dist/frameworks/llamaindex.d.ts +55 -0
- package/dist/frameworks/llamaindex.js +212 -0
- package/dist/frameworks/llamaindex.js.map +1 -0
- package/dist/index.cjs +425 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +124 -14
- package/dist/index.d.ts +124 -14
- package/dist/index.js +418 -14
- package/dist/index.js.map +1 -1
- package/dist/providers/anthropic/index.cjs +22 -0
- package/dist/providers/anthropic/index.cjs.map +1 -1
- package/dist/providers/anthropic/index.js +22 -0
- package/dist/providers/anthropic/index.js.map +1 -1
- package/dist/providers/bedrock/index.cjs +334 -0
- package/dist/providers/bedrock/index.cjs.map +1 -0
- package/dist/providers/bedrock/index.d.cts +37 -0
- package/dist/providers/bedrock/index.d.ts +37 -0
- package/dist/providers/bedrock/index.js +307 -0
- package/dist/providers/bedrock/index.js.map +1 -0
- package/dist/providers/cerebras/index.cjs +282 -0
- package/dist/providers/cerebras/index.cjs.map +1 -0
- package/dist/providers/cerebras/index.d.cts +24 -0
- package/dist/providers/cerebras/index.d.ts +24 -0
- package/dist/providers/cerebras/index.js +255 -0
- package/dist/providers/cerebras/index.js.map +1 -0
- package/dist/providers/cohere/index.cjs +347 -0
- package/dist/providers/cohere/index.cjs.map +1 -0
- package/dist/providers/cohere/index.d.cts +24 -0
- package/dist/providers/cohere/index.d.ts +24 -0
- package/dist/providers/cohere/index.js +320 -0
- package/dist/providers/cohere/index.js.map +1 -0
- package/dist/providers/google/index.cjs +337 -0
- package/dist/providers/google/index.cjs.map +1 -0
- package/dist/providers/google/index.d.cts +25 -0
- package/dist/providers/google/index.d.ts +25 -0
- package/dist/providers/google/index.js +310 -0
- package/dist/providers/google/index.js.map +1 -0
- package/dist/providers/groq/index.cjs +282 -0
- package/dist/providers/groq/index.cjs.map +1 -0
- package/dist/providers/groq/index.d.cts +23 -0
- package/dist/providers/groq/index.d.ts +23 -0
- package/dist/providers/groq/index.js +255 -0
- package/dist/providers/groq/index.js.map +1 -0
- package/dist/providers/huggingface/index.cjs +289 -0
- package/dist/providers/huggingface/index.cjs.map +1 -0
- package/dist/providers/huggingface/index.d.cts +24 -0
- package/dist/providers/huggingface/index.d.ts +24 -0
- package/dist/providers/huggingface/index.js +262 -0
- package/dist/providers/huggingface/index.js.map +1 -0
- package/dist/providers/mistral/index.cjs +336 -0
- package/dist/providers/mistral/index.cjs.map +1 -0
- package/dist/providers/mistral/index.d.cts +24 -0
- package/dist/providers/mistral/index.d.ts +24 -0
- package/dist/providers/mistral/index.js +309 -0
- package/dist/providers/mistral/index.js.map +1 -0
- package/dist/providers/ollama/index.cjs +376 -0
- package/dist/providers/ollama/index.cjs.map +1 -0
- package/dist/providers/ollama/index.d.cts +28 -0
- package/dist/providers/ollama/index.d.ts +28 -0
- package/dist/providers/ollama/index.js +349 -0
- package/dist/providers/ollama/index.js.map +1 -0
- package/dist/providers/openai/index.cjs +31 -1
- package/dist/providers/openai/index.cjs.map +1 -1
- package/dist/providers/openai/index.js +31 -1
- package/dist/providers/openai/index.js.map +1 -1
- package/dist/providers/together/index.cjs +275 -0
- package/dist/providers/together/index.cjs.map +1 -0
- package/dist/providers/together/index.d.cts +24 -0
- package/dist/providers/together/index.d.ts +24 -0
- package/dist/providers/together/index.js +248 -0
- package/dist/providers/together/index.js.map +1 -0
- package/package.json +124 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export { RisicareCallbackHandler } from './frameworks/langchain.cjs';
|
|
2
|
+
export { instrumentLangGraph } from './frameworks/langgraph.cjs';
|
|
3
|
+
export { patchInstructor } from './frameworks/instructor.cjs';
|
|
4
|
+
export { RisicareLlamaIndexHandler } from './frameworks/llamaindex.cjs';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* SDK configuration with environment variable loading.
|
|
3
8
|
*
|
|
@@ -83,18 +88,38 @@ declare enum SemanticPhase {
|
|
|
83
88
|
declare enum AgentRole {
|
|
84
89
|
ORCHESTRATOR = "orchestrator",
|
|
85
90
|
WORKER = "worker",
|
|
86
|
-
|
|
91
|
+
SUPERVISOR = "supervisor",
|
|
92
|
+
SPECIALIST = "specialist",
|
|
93
|
+
ROUTER = "router",
|
|
94
|
+
AGGREGATOR = "aggregator",
|
|
95
|
+
BROADCASTER = "broadcaster",
|
|
96
|
+
CRITIC = "critic",
|
|
87
97
|
PLANNER = "planner",
|
|
88
98
|
EXECUTOR = "executor",
|
|
89
|
-
|
|
99
|
+
RETRIEVER = "retriever",
|
|
100
|
+
VALIDATOR = "validator",
|
|
101
|
+
REVIEWER = "reviewer",
|
|
90
102
|
CUSTOM = "custom"
|
|
91
103
|
}
|
|
92
104
|
declare enum MessageType {
|
|
93
|
-
|
|
105
|
+
TASK = "task",
|
|
106
|
+
RESULT = "result",
|
|
107
|
+
STATUS = "status",
|
|
108
|
+
ERROR = "error",
|
|
109
|
+
QUERY = "query",
|
|
94
110
|
RESPONSE = "response",
|
|
111
|
+
BROADCAST = "broadcast",
|
|
112
|
+
DIRECT = "direct",
|
|
113
|
+
PROPOSAL = "proposal",
|
|
114
|
+
VOTE = "vote",
|
|
115
|
+
CONSENSUS = "consensus",
|
|
116
|
+
CONFLICT = "conflict",
|
|
117
|
+
HEARTBEAT = "heartbeat",
|
|
118
|
+
SHUTDOWN = "shutdown",
|
|
119
|
+
HANDOFF = "handoff",
|
|
120
|
+
REQUEST = "request",
|
|
95
121
|
DELEGATE = "delegate",
|
|
96
|
-
COORDINATE = "coordinate"
|
|
97
|
-
BROADCAST = "broadcast"
|
|
122
|
+
COORDINATE = "coordinate"
|
|
98
123
|
}
|
|
99
124
|
interface SpanEvent {
|
|
100
125
|
name: string;
|
|
@@ -477,14 +502,34 @@ declare function session<TArgs extends unknown[], TReturn>(optionsOrResolver: Se
|
|
|
477
502
|
* return await llm.invoke(`Decide action: ${analysis}`);
|
|
478
503
|
* });
|
|
479
504
|
*/
|
|
480
|
-
/**
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
505
|
+
/**
|
|
506
|
+
* Wrap a function in a THINK phase context with auto-span.
|
|
507
|
+
*
|
|
508
|
+
* @example traceThink(async () => { ... })
|
|
509
|
+
* @example traceThink("analyze-data", async () => { ... })
|
|
510
|
+
*/
|
|
511
|
+
declare function traceThink<TArgs extends unknown[], TReturn>(fnOrName: ((...args: TArgs) => TReturn) | string, maybeFn?: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
512
|
+
/**
|
|
513
|
+
* Wrap a function in a DECIDE phase context with auto-span.
|
|
514
|
+
*
|
|
515
|
+
* @example traceDecide(async () => { ... })
|
|
516
|
+
* @example traceDecide("choose-action", async () => { ... })
|
|
517
|
+
*/
|
|
518
|
+
declare function traceDecide<TArgs extends unknown[], TReturn>(fnOrName: ((...args: TArgs) => TReturn) | string, maybeFn?: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
519
|
+
/**
|
|
520
|
+
* Wrap a function in an ACT phase context with auto-span.
|
|
521
|
+
*
|
|
522
|
+
* @example traceAct(async () => { ... })
|
|
523
|
+
* @example traceAct("execute-tool", async () => { ... })
|
|
524
|
+
*/
|
|
525
|
+
declare function traceAct<TArgs extends unknown[], TReturn>(fnOrName: ((...args: TArgs) => TReturn) | string, maybeFn?: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
526
|
+
/**
|
|
527
|
+
* Wrap a function in an OBSERVE phase context with auto-span.
|
|
528
|
+
*
|
|
529
|
+
* @example traceObserve(async () => { ... })
|
|
530
|
+
* @example traceObserve("check-result", async () => { ... })
|
|
531
|
+
*/
|
|
532
|
+
declare function traceObserve<TArgs extends unknown[], TReturn>(fnOrName: ((...args: TArgs) => TReturn) | string, maybeFn?: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
488
533
|
|
|
489
534
|
/**
|
|
490
535
|
* Phase context — cognitive phase tracking (THINK/DECIDE/ACT/OBSERVE).
|
|
@@ -618,4 +663,69 @@ declare function registerSpan(span: Span, ttlMs?: number): void;
|
|
|
618
663
|
declare function getSpanById(spanId: string): Span | undefined;
|
|
619
664
|
declare function unregisterSpan(spanId: string): void;
|
|
620
665
|
|
|
621
|
-
|
|
666
|
+
/**
|
|
667
|
+
* tracedStream — Wrap an async iterable in a trace span.
|
|
668
|
+
*
|
|
669
|
+
* Creates a span that starts when iteration begins and ends when
|
|
670
|
+
* iteration completes (or errors). Chunks pass through UNCHANGED.
|
|
671
|
+
*
|
|
672
|
+
* This is the user-level streaming utility. For provider-level streaming
|
|
673
|
+
* enrichment (token counts, cost), see individual provider instrumentors.
|
|
674
|
+
*
|
|
675
|
+
* Usage:
|
|
676
|
+
* const stream = await openai.chat.completions.create({ stream: true, ... });
|
|
677
|
+
* for await (const chunk of tracedStream(stream, { name: 'llm-stream' })) {
|
|
678
|
+
* process(chunk);
|
|
679
|
+
* }
|
|
680
|
+
*/
|
|
681
|
+
|
|
682
|
+
interface TracedStreamOptions {
|
|
683
|
+
/** Span name */
|
|
684
|
+
name: string;
|
|
685
|
+
/** Span kind (default: INTERNAL) */
|
|
686
|
+
kind?: SpanKind;
|
|
687
|
+
/** Additional span attributes */
|
|
688
|
+
attributes?: Record<string, unknown>;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Wrap an async iterable in a trace span.
|
|
692
|
+
*
|
|
693
|
+
* - Span starts on first iteration
|
|
694
|
+
* - chunk_count attribute set when iteration ends
|
|
695
|
+
* - On error: span records exception, error re-thrown to caller
|
|
696
|
+
* - On early break: span ended cleanly via finally
|
|
697
|
+
* - If SDK not initialized: chunks pass through without wrapping
|
|
698
|
+
*/
|
|
699
|
+
declare function tracedStream<T>(source: AsyncIterable<T>, options: TracedStreamOptions | string): AsyncGenerator<T, void, undefined>;
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Double-tracing prevention for framework integrations.
|
|
703
|
+
*
|
|
704
|
+
* When a framework integration (e.g., LlamaIndex handler) creates its own
|
|
705
|
+
* LLM span, the underlying provider proxy (e.g., patchOpenAI) would also
|
|
706
|
+
* create a duplicate span. This module provides suppression:
|
|
707
|
+
*
|
|
708
|
+
* - Framework integrations SET suppression via suppressProviderInstrumentation()
|
|
709
|
+
* - Provider proxies CHECK via isProviderInstrumentationSuppressed() and skip
|
|
710
|
+
*
|
|
711
|
+
* Scoped to AsyncLocalStorage — concurrent calls are independent.
|
|
712
|
+
*/
|
|
713
|
+
/**
|
|
714
|
+
* Run a callback with provider instrumentation suppressed.
|
|
715
|
+
*
|
|
716
|
+
* During this callback, all provider instrumentors (patchOpenAI, etc.) will
|
|
717
|
+
* skip span creation. The framework is responsible for creating the span.
|
|
718
|
+
*
|
|
719
|
+
* @param fn - The function to run with suppression active
|
|
720
|
+
* @returns The function's return value
|
|
721
|
+
*/
|
|
722
|
+
declare function suppressProviderInstrumentation<T>(fn: () => T): T;
|
|
723
|
+
/**
|
|
724
|
+
* Check if provider instrumentation should be suppressed.
|
|
725
|
+
*
|
|
726
|
+
* Called by provider instrumentors as an early-exit guard. When true,
|
|
727
|
+
* the provider calls the original method directly without creating a span.
|
|
728
|
+
*/
|
|
729
|
+
declare function isProviderInstrumentationSuppressed(): boolean;
|
|
730
|
+
|
|
731
|
+
export { type AgentContext, type AgentOptions, AgentRole, MessageType, type RisicareConfig, SemanticPhase, type SessionContext, type SessionOptions, Span, SpanKind, type SpanOptions, SpanStatus, type StartSpanOptions, type TraceContext, type TracedStreamOptions, Tracer, agent, disable, enable, extractTraceContext, flush, getCurrentAgent, getCurrentAgentId, getCurrentContext, getCurrentPhase, getCurrentSession, getCurrentSessionId, getCurrentSpan, getCurrentSpanId, getCurrentTraceId, getMetrics, getSpanById, getTraceContent, getTraceContext, getTracer, init, injectTraceContext, isEnabled, isProviderInstrumentationSuppressed, registerSpan, reportError, score, session, shutdown, suppressProviderInstrumentation, traceAct, traceCoordinate, traceDecide, traceDelegate, traceMessage, traceObserve, traceThink, tracedStream, unregisterSpan, withAgent, withPhase, withSession };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export { RisicareCallbackHandler } from './frameworks/langchain.js';
|
|
2
|
+
export { instrumentLangGraph } from './frameworks/langgraph.js';
|
|
3
|
+
export { patchInstructor } from './frameworks/instructor.js';
|
|
4
|
+
export { RisicareLlamaIndexHandler } from './frameworks/llamaindex.js';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* SDK configuration with environment variable loading.
|
|
3
8
|
*
|
|
@@ -83,18 +88,38 @@ declare enum SemanticPhase {
|
|
|
83
88
|
declare enum AgentRole {
|
|
84
89
|
ORCHESTRATOR = "orchestrator",
|
|
85
90
|
WORKER = "worker",
|
|
86
|
-
|
|
91
|
+
SUPERVISOR = "supervisor",
|
|
92
|
+
SPECIALIST = "specialist",
|
|
93
|
+
ROUTER = "router",
|
|
94
|
+
AGGREGATOR = "aggregator",
|
|
95
|
+
BROADCASTER = "broadcaster",
|
|
96
|
+
CRITIC = "critic",
|
|
87
97
|
PLANNER = "planner",
|
|
88
98
|
EXECUTOR = "executor",
|
|
89
|
-
|
|
99
|
+
RETRIEVER = "retriever",
|
|
100
|
+
VALIDATOR = "validator",
|
|
101
|
+
REVIEWER = "reviewer",
|
|
90
102
|
CUSTOM = "custom"
|
|
91
103
|
}
|
|
92
104
|
declare enum MessageType {
|
|
93
|
-
|
|
105
|
+
TASK = "task",
|
|
106
|
+
RESULT = "result",
|
|
107
|
+
STATUS = "status",
|
|
108
|
+
ERROR = "error",
|
|
109
|
+
QUERY = "query",
|
|
94
110
|
RESPONSE = "response",
|
|
111
|
+
BROADCAST = "broadcast",
|
|
112
|
+
DIRECT = "direct",
|
|
113
|
+
PROPOSAL = "proposal",
|
|
114
|
+
VOTE = "vote",
|
|
115
|
+
CONSENSUS = "consensus",
|
|
116
|
+
CONFLICT = "conflict",
|
|
117
|
+
HEARTBEAT = "heartbeat",
|
|
118
|
+
SHUTDOWN = "shutdown",
|
|
119
|
+
HANDOFF = "handoff",
|
|
120
|
+
REQUEST = "request",
|
|
95
121
|
DELEGATE = "delegate",
|
|
96
|
-
COORDINATE = "coordinate"
|
|
97
|
-
BROADCAST = "broadcast"
|
|
122
|
+
COORDINATE = "coordinate"
|
|
98
123
|
}
|
|
99
124
|
interface SpanEvent {
|
|
100
125
|
name: string;
|
|
@@ -477,14 +502,34 @@ declare function session<TArgs extends unknown[], TReturn>(optionsOrResolver: Se
|
|
|
477
502
|
* return await llm.invoke(`Decide action: ${analysis}`);
|
|
478
503
|
* });
|
|
479
504
|
*/
|
|
480
|
-
/**
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
505
|
+
/**
|
|
506
|
+
* Wrap a function in a THINK phase context with auto-span.
|
|
507
|
+
*
|
|
508
|
+
* @example traceThink(async () => { ... })
|
|
509
|
+
* @example traceThink("analyze-data", async () => { ... })
|
|
510
|
+
*/
|
|
511
|
+
declare function traceThink<TArgs extends unknown[], TReturn>(fnOrName: ((...args: TArgs) => TReturn) | string, maybeFn?: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
512
|
+
/**
|
|
513
|
+
* Wrap a function in a DECIDE phase context with auto-span.
|
|
514
|
+
*
|
|
515
|
+
* @example traceDecide(async () => { ... })
|
|
516
|
+
* @example traceDecide("choose-action", async () => { ... })
|
|
517
|
+
*/
|
|
518
|
+
declare function traceDecide<TArgs extends unknown[], TReturn>(fnOrName: ((...args: TArgs) => TReturn) | string, maybeFn?: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
519
|
+
/**
|
|
520
|
+
* Wrap a function in an ACT phase context with auto-span.
|
|
521
|
+
*
|
|
522
|
+
* @example traceAct(async () => { ... })
|
|
523
|
+
* @example traceAct("execute-tool", async () => { ... })
|
|
524
|
+
*/
|
|
525
|
+
declare function traceAct<TArgs extends unknown[], TReturn>(fnOrName: ((...args: TArgs) => TReturn) | string, maybeFn?: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
526
|
+
/**
|
|
527
|
+
* Wrap a function in an OBSERVE phase context with auto-span.
|
|
528
|
+
*
|
|
529
|
+
* @example traceObserve(async () => { ... })
|
|
530
|
+
* @example traceObserve("check-result", async () => { ... })
|
|
531
|
+
*/
|
|
532
|
+
declare function traceObserve<TArgs extends unknown[], TReturn>(fnOrName: ((...args: TArgs) => TReturn) | string, maybeFn?: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
488
533
|
|
|
489
534
|
/**
|
|
490
535
|
* Phase context — cognitive phase tracking (THINK/DECIDE/ACT/OBSERVE).
|
|
@@ -618,4 +663,69 @@ declare function registerSpan(span: Span, ttlMs?: number): void;
|
|
|
618
663
|
declare function getSpanById(spanId: string): Span | undefined;
|
|
619
664
|
declare function unregisterSpan(spanId: string): void;
|
|
620
665
|
|
|
621
|
-
|
|
666
|
+
/**
|
|
667
|
+
* tracedStream — Wrap an async iterable in a trace span.
|
|
668
|
+
*
|
|
669
|
+
* Creates a span that starts when iteration begins and ends when
|
|
670
|
+
* iteration completes (or errors). Chunks pass through UNCHANGED.
|
|
671
|
+
*
|
|
672
|
+
* This is the user-level streaming utility. For provider-level streaming
|
|
673
|
+
* enrichment (token counts, cost), see individual provider instrumentors.
|
|
674
|
+
*
|
|
675
|
+
* Usage:
|
|
676
|
+
* const stream = await openai.chat.completions.create({ stream: true, ... });
|
|
677
|
+
* for await (const chunk of tracedStream(stream, { name: 'llm-stream' })) {
|
|
678
|
+
* process(chunk);
|
|
679
|
+
* }
|
|
680
|
+
*/
|
|
681
|
+
|
|
682
|
+
interface TracedStreamOptions {
|
|
683
|
+
/** Span name */
|
|
684
|
+
name: string;
|
|
685
|
+
/** Span kind (default: INTERNAL) */
|
|
686
|
+
kind?: SpanKind;
|
|
687
|
+
/** Additional span attributes */
|
|
688
|
+
attributes?: Record<string, unknown>;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Wrap an async iterable in a trace span.
|
|
692
|
+
*
|
|
693
|
+
* - Span starts on first iteration
|
|
694
|
+
* - chunk_count attribute set when iteration ends
|
|
695
|
+
* - On error: span records exception, error re-thrown to caller
|
|
696
|
+
* - On early break: span ended cleanly via finally
|
|
697
|
+
* - If SDK not initialized: chunks pass through without wrapping
|
|
698
|
+
*/
|
|
699
|
+
declare function tracedStream<T>(source: AsyncIterable<T>, options: TracedStreamOptions | string): AsyncGenerator<T, void, undefined>;
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* Double-tracing prevention for framework integrations.
|
|
703
|
+
*
|
|
704
|
+
* When a framework integration (e.g., LlamaIndex handler) creates its own
|
|
705
|
+
* LLM span, the underlying provider proxy (e.g., patchOpenAI) would also
|
|
706
|
+
* create a duplicate span. This module provides suppression:
|
|
707
|
+
*
|
|
708
|
+
* - Framework integrations SET suppression via suppressProviderInstrumentation()
|
|
709
|
+
* - Provider proxies CHECK via isProviderInstrumentationSuppressed() and skip
|
|
710
|
+
*
|
|
711
|
+
* Scoped to AsyncLocalStorage — concurrent calls are independent.
|
|
712
|
+
*/
|
|
713
|
+
/**
|
|
714
|
+
* Run a callback with provider instrumentation suppressed.
|
|
715
|
+
*
|
|
716
|
+
* During this callback, all provider instrumentors (patchOpenAI, etc.) will
|
|
717
|
+
* skip span creation. The framework is responsible for creating the span.
|
|
718
|
+
*
|
|
719
|
+
* @param fn - The function to run with suppression active
|
|
720
|
+
* @returns The function's return value
|
|
721
|
+
*/
|
|
722
|
+
declare function suppressProviderInstrumentation<T>(fn: () => T): T;
|
|
723
|
+
/**
|
|
724
|
+
* Check if provider instrumentation should be suppressed.
|
|
725
|
+
*
|
|
726
|
+
* Called by provider instrumentors as an early-exit guard. When true,
|
|
727
|
+
* the provider calls the original method directly without creating a span.
|
|
728
|
+
*/
|
|
729
|
+
declare function isProviderInstrumentationSuppressed(): boolean;
|
|
730
|
+
|
|
731
|
+
export { type AgentContext, type AgentOptions, AgentRole, MessageType, type RisicareConfig, SemanticPhase, type SessionContext, type SessionOptions, Span, SpanKind, type SpanOptions, SpanStatus, type StartSpanOptions, type TraceContext, type TracedStreamOptions, Tracer, agent, disable, enable, extractTraceContext, flush, getCurrentAgent, getCurrentAgentId, getCurrentContext, getCurrentPhase, getCurrentSession, getCurrentSessionId, getCurrentSpan, getCurrentSpanId, getCurrentTraceId, getMetrics, getSpanById, getTraceContent, getTraceContext, getTracer, init, injectTraceContext, isEnabled, isProviderInstrumentationSuppressed, registerSpan, reportError, score, session, shutdown, suppressProviderInstrumentation, traceAct, traceCoordinate, traceDecide, traceDelegate, traceMessage, traceObserve, traceThink, tracedStream, unregisterSpan, withAgent, withPhase, withSession };
|