-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathconstants.ts
More file actions
27 lines (22 loc) · 833 Bytes
/
constants.ts
File metadata and controls
27 lines (22 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { Span } from '../../types-hoist/span';
// Global Map to track tool call IDs to their corresponding spans
// This allows us to capture tool errors and link them to the correct span
export const toolCallSpanMap = new Map<string, Span>();
// Operation sets for efficient mapping to OpenTelemetry semantic convention values
export const INVOKE_AGENT_OPS = new Set([
'ai.generateText',
'ai.streamText',
'ai.generateObject',
'ai.streamObject',
'ai.embed',
'ai.embedMany',
'ai.rerank',
]);
export const GENERATE_CONTENT_OPS = new Set([
'ai.generateText.doGenerate',
'ai.streamText.doStream',
'ai.generateObject.doGenerate',
'ai.streamObject.doStream',
]);
export const EMBEDDINGS_OPS = new Set(['ai.embed.doEmbed', 'ai.embedMany.doEmbed']);
export const RERANK_OPS = new Set(['ai.rerank.doRerank']);