langwatch 0.3.0-prerelease.1 → 0.3.0-prerelease.2

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.
Files changed (184) hide show
  1. package/dist/chunk-4BZATFKJ.mjs +181 -0
  2. package/dist/chunk-4BZATFKJ.mjs.map +1 -0
  3. package/dist/chunk-CSC3CMIT.mjs +118 -0
  4. package/dist/chunk-CSC3CMIT.mjs.map +1 -0
  5. package/dist/chunk-F63YKTXA.mjs +47 -0
  6. package/dist/chunk-F63YKTXA.mjs.map +1 -0
  7. package/dist/chunk-G3AUABT7.js +4 -0
  8. package/dist/chunk-G3AUABT7.js.map +1 -0
  9. package/dist/chunk-HPC6Z7J4.js +118 -0
  10. package/dist/chunk-HPC6Z7J4.js.map +1 -0
  11. package/dist/chunk-KGDAENGD.js +50 -0
  12. package/dist/chunk-KGDAENGD.js.map +1 -0
  13. package/dist/chunk-LD74LVRU.js +47 -0
  14. package/dist/chunk-LD74LVRU.js.map +1 -0
  15. package/dist/chunk-OM7VY3XT.mjs +4 -0
  16. package/dist/chunk-OM7VY3XT.mjs.map +1 -0
  17. package/dist/chunk-PCQVQ7SB.js +45 -0
  18. package/dist/chunk-PCQVQ7SB.js.map +1 -0
  19. package/dist/chunk-PMBEK6YE.mjs +424 -0
  20. package/dist/chunk-PMBEK6YE.mjs.map +1 -0
  21. package/dist/chunk-PR3JDWC3.mjs +50 -0
  22. package/dist/chunk-PR3JDWC3.mjs.map +1 -0
  23. package/dist/chunk-PTJ6AAI7.js +360 -0
  24. package/dist/chunk-PTJ6AAI7.js.map +1 -0
  25. package/dist/chunk-QEWDG5QE.mjs +45 -0
  26. package/dist/chunk-QEWDG5QE.mjs.map +1 -0
  27. package/dist/chunk-REUCVT7A.mjs +39 -0
  28. package/dist/chunk-REUCVT7A.mjs.map +1 -0
  29. package/dist/chunk-SVJ7SCGB.js +424 -0
  30. package/dist/chunk-SVJ7SCGB.js.map +1 -0
  31. package/dist/chunk-VJSOCNPA.js +181 -0
  32. package/dist/chunk-VJSOCNPA.js.map +1 -0
  33. package/dist/chunk-WM2GRSRW.js +39 -0
  34. package/dist/chunk-WM2GRSRW.js.map +1 -0
  35. package/dist/chunk-Z5J5UI5E.mjs +360 -0
  36. package/dist/chunk-Z5J5UI5E.mjs.map +1 -0
  37. package/dist/client-B2HqIKg6.d.ts +51 -0
  38. package/dist/client-XyCqclCi.d.mts +51 -0
  39. package/dist/client-browser.d.mts +8 -0
  40. package/dist/client-browser.d.ts +8 -0
  41. package/dist/client-browser.js +83 -0
  42. package/dist/client-browser.js.map +1 -0
  43. package/dist/client-browser.mjs +83 -0
  44. package/dist/client-browser.mjs.map +1 -0
  45. package/dist/client-node.d.mts +8 -0
  46. package/dist/client-node.d.ts +8 -0
  47. package/dist/client-node.js +90 -0
  48. package/dist/client-node.js.map +1 -0
  49. package/dist/client-node.mjs +90 -0
  50. package/dist/client-node.mjs.map +1 -0
  51. package/dist/evaluation/index.d.mts +897 -0
  52. package/dist/evaluation/index.d.ts +897 -0
  53. package/dist/evaluation/index.js +13 -0
  54. package/dist/evaluation/index.js.map +1 -0
  55. package/dist/evaluation/index.mjs +13 -0
  56. package/dist/evaluation/index.mjs.map +1 -0
  57. package/dist/filterable-batch-span-processor-zO5kcjBY.d.mts +64 -0
  58. package/dist/filterable-batch-span-processor-zO5kcjBY.d.ts +64 -0
  59. package/dist/index.d.mts +48 -0
  60. package/{src/observability/exporters/langwatch-exporter.ts → dist/index.d.ts} +13 -18
  61. package/dist/index.js +30 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/index.mjs +30 -0
  64. package/dist/index.mjs.map +1 -0
  65. package/dist/observability/index.d.mts +260 -0
  66. package/dist/observability/index.d.ts +260 -0
  67. package/dist/observability/index.js +20 -0
  68. package/dist/observability/index.js.map +1 -0
  69. package/dist/observability/index.mjs +20 -0
  70. package/dist/observability/index.mjs.map +1 -0
  71. package/dist/observability/instrumentation/langchain/index.d.mts +40 -0
  72. package/dist/observability/instrumentation/langchain/index.d.ts +40 -0
  73. package/dist/observability/instrumentation/langchain/index.js +666 -0
  74. package/dist/observability/instrumentation/langchain/index.js.map +1 -0
  75. package/dist/observability/instrumentation/langchain/index.mjs +666 -0
  76. package/dist/observability/instrumentation/langchain/index.mjs.map +1 -0
  77. package/dist/prompt/index.d.mts +10 -0
  78. package/dist/prompt/index.d.ts +10 -0
  79. package/dist/prompt/index.js +18 -0
  80. package/dist/prompt/index.js.map +1 -0
  81. package/dist/prompt/index.mjs +18 -0
  82. package/dist/prompt/index.mjs.map +1 -0
  83. package/dist/prompt-BXJWdbQp.d.mts +1967 -0
  84. package/dist/prompt-BXJWdbQp.d.ts +1967 -0
  85. package/dist/record-evaluation-CmxMXa-3.d.mts +25 -0
  86. package/dist/record-evaluation-CmxMXa-3.d.ts +25 -0
  87. package/dist/trace-D-bZOuqb.d.mts +622 -0
  88. package/dist/trace-G2312klE.d.ts +622 -0
  89. package/package.json +9 -4
  90. package/.editorconfig +0 -16
  91. package/.eslintrc.cjs +0 -37
  92. package/copy-types.sh +0 -28
  93. package/examples/langchain/.env.example +0 -2
  94. package/examples/langchain/README.md +0 -42
  95. package/examples/langchain/package-lock.json +0 -2930
  96. package/examples/langchain/package.json +0 -27
  97. package/examples/langchain/src/cli-markdown.d.ts +0 -137
  98. package/examples/langchain/src/index.ts +0 -109
  99. package/examples/langchain/tsconfig.json +0 -25
  100. package/examples/langgraph/.env.example +0 -2
  101. package/examples/langgraph/README.md +0 -42
  102. package/examples/langgraph/package-lock.json +0 -3031
  103. package/examples/langgraph/package.json +0 -28
  104. package/examples/langgraph/src/cli-markdown.d.ts +0 -137
  105. package/examples/langgraph/src/index.ts +0 -196
  106. package/examples/langgraph/tsconfig.json +0 -25
  107. package/examples/mastra/.env.example +0 -2
  108. package/examples/mastra/README.md +0 -57
  109. package/examples/mastra/package-lock.json +0 -5296
  110. package/examples/mastra/package.json +0 -32
  111. package/examples/mastra/src/cli-markdown.d.ts +0 -137
  112. package/examples/mastra/src/index.ts +0 -120
  113. package/examples/mastra/src/mastra/agents/weather-agent.ts +0 -30
  114. package/examples/mastra/src/mastra/index.ts +0 -21
  115. package/examples/mastra/src/mastra/tools/weather-tool.ts +0 -102
  116. package/examples/mastra/tsconfig.json +0 -25
  117. package/examples/vercel-ai/.env.example +0 -2
  118. package/examples/vercel-ai/README.md +0 -38
  119. package/examples/vercel-ai/package-lock.json +0 -2571
  120. package/examples/vercel-ai/package.json +0 -27
  121. package/examples/vercel-ai/src/cli-markdown.d.ts +0 -137
  122. package/examples/vercel-ai/src/index.ts +0 -110
  123. package/examples/vercel-ai/src/instrumentation.ts +0 -9
  124. package/examples/vercel-ai/tsconfig.json +0 -25
  125. package/src/__tests__/client-browser.test.ts +0 -92
  126. package/src/__tests__/client-node.test.ts +0 -76
  127. package/src/__tests__/client.test.ts +0 -71
  128. package/src/__tests__/integration/client-browser.test.ts +0 -46
  129. package/src/__tests__/integration/client-node.test.ts +0 -46
  130. package/src/client-browser.ts +0 -70
  131. package/src/client-node.ts +0 -82
  132. package/src/client-shared.ts +0 -72
  133. package/src/client.ts +0 -119
  134. package/src/evaluation/__tests__/record-evaluation.test.ts +0 -112
  135. package/src/evaluation/__tests__/run-evaluation.test.ts +0 -171
  136. package/src/evaluation/index.ts +0 -2
  137. package/src/evaluation/record-evaluation.ts +0 -101
  138. package/src/evaluation/run-evaluation.ts +0 -133
  139. package/src/evaluation/tracer.ts +0 -3
  140. package/src/evaluation/types.ts +0 -23
  141. package/src/index.ts +0 -13
  142. package/src/internal/api/__tests__/errors.test.ts +0 -98
  143. package/src/internal/api/client.ts +0 -30
  144. package/src/internal/api/errors.ts +0 -32
  145. package/src/internal/generated/openapi/.gitkeep +0 -0
  146. package/src/internal/generated/types/.gitkeep +0 -0
  147. package/src/observability/__tests__/integration/base.test.ts +0 -74
  148. package/src/observability/__tests__/integration/browser-setup-ordering.test.ts +0 -60
  149. package/src/observability/__tests__/integration/complex-nested-spans.test.ts +0 -29
  150. package/src/observability/__tests__/integration/error-handling.test.ts +0 -24
  151. package/src/observability/__tests__/integration/langwatch-disabled-otel.test.ts +0 -24
  152. package/src/observability/__tests__/integration/langwatch-first-then-vercel.test.ts +0 -24
  153. package/src/observability/__tests__/integration/multiple-setup-attempts.test.ts +0 -27
  154. package/src/observability/__tests__/integration/otel-ordering.test.ts +0 -27
  155. package/src/observability/__tests__/integration/vercel-configurations.test.ts +0 -20
  156. package/src/observability/__tests__/integration/vercel-first-then-langwatch.test.ts +0 -27
  157. package/src/observability/__tests__/span.test.ts +0 -214
  158. package/src/observability/__tests__/trace.test.ts +0 -180
  159. package/src/observability/exporters/index.ts +0 -1
  160. package/src/observability/index.ts +0 -4
  161. package/src/observability/instrumentation/langchain/__tests__/integration/langchain-chatbot.test.ts +0 -112
  162. package/src/observability/instrumentation/langchain/__tests__/langchain.test.ts +0 -284
  163. package/src/observability/instrumentation/langchain/index.ts +0 -624
  164. package/src/observability/processors/__tests__/filterable-batch-span-exporter.test.ts +0 -98
  165. package/src/observability/processors/filterable-batch-span-processor.ts +0 -99
  166. package/src/observability/processors/index.ts +0 -1
  167. package/src/observability/semconv/attributes.ts +0 -185
  168. package/src/observability/semconv/events.ts +0 -42
  169. package/src/observability/semconv/index.ts +0 -16
  170. package/src/observability/semconv/values.ts +0 -159
  171. package/src/observability/span.ts +0 -728
  172. package/src/observability/trace.ts +0 -301
  173. package/src/prompt/__tests__/prompt.test.ts +0 -139
  174. package/src/prompt/get-prompt-version.ts +0 -49
  175. package/src/prompt/get-prompt.ts +0 -44
  176. package/src/prompt/index.ts +0 -3
  177. package/src/prompt/prompt.ts +0 -133
  178. package/src/prompt/service.ts +0 -221
  179. package/src/prompt/tracer.ts +0 -3
  180. package/src/prompt/types.ts +0 -0
  181. package/ts-to-zod.config.js +0 -35
  182. package/tsconfig.json +0 -26
  183. package/tsup.config.ts +0 -20
  184. package/vitest.config.ts +0 -9
@@ -1,99 +0,0 @@
1
- /**
2
- * Filterable Batch Span Exporter for OpenTelemetry
3
- *
4
- * This module provides a BatchSpanProcessor subclass that allows filtering of spans before export
5
- * based on configurable rules. Spans matching any exclude rule are dropped and not exported.
6
- *
7
- * @module filterable-batch-span-exporter
8
- */
9
-
10
- import {
11
- BatchSpanProcessor,
12
- ReadableSpan,
13
- SpanExporter,
14
- } from '@opentelemetry/sdk-trace-base';
15
-
16
- /**
17
- * A rule for excluding spans from export based on their name or instrumentation scope name.
18
- *
19
- * @property fieldName - The span field to match against ('span_name' or 'instrumentation_scope_name').
20
- * @property matchValue - The value to match against the field.
21
- * @property matchOperation - The operation to use for matching ('includes', 'exact_match', 'starts_with', 'ends_with').
22
- *
23
- * @example
24
- * const rule: SpanProcessingExcludeRule = {
25
- * fieldName: 'span_name',
26
- * matchValue: 'heartbeat',
27
- * matchOperation: 'exact_match',
28
- * };
29
- */
30
- export interface SpanProcessingExcludeRule {
31
- fieldName: "span_name" | "instrumentation_scope_name";
32
- matchValue: string;
33
- matchOperation: "includes" | "exact_match" | "starts_with" | "ends_with";
34
- }
35
-
36
- /**
37
- * A BatchSpanProcessor that filters out spans matching any of the provided exclude rules before export.
38
- *
39
- * This is useful for dropping noisy or irrelevant spans (e.g., health checks, heartbeats) from being exported to your tracing backend.
40
- *
41
- * @example
42
- * import { FilterableBatchSpanProcessor } from './filterable-batch-span-exporter';
43
- * import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
44
- *
45
- * const exporter = new OTLPTraceExporter({ url: '...' });
46
- * const filters = [
47
- * { fieldName: 'span_name', matchValue: 'heartbeat', matchOperation: 'exact_match' },
48
- * { fieldName: 'instrumentation_scope_name', matchValue: 'internal', matchOperation: 'starts_with' },
49
- * ];
50
- * provider.addSpanProcessor(new FilterableBatchSpanProcessor(exporter, filters));
51
- */
52
- export class FilterableBatchSpanProcessor extends BatchSpanProcessor {
53
- private readonly _filters: SpanProcessingExcludeRule[];
54
-
55
- /**
56
- * Create a new FilterableBatchSpanProcessor.
57
- *
58
- * @param exporter - The underlying SpanExporter to use for exporting spans.
59
- * @param filters - An array of rules for excluding spans from export.
60
- */
61
- constructor(exporter: SpanExporter, filters: SpanProcessingExcludeRule[]) {
62
- super(exporter);
63
- this._filters = filters;
64
- }
65
-
66
- /**
67
- * Called when a span ends. If the span matches any exclude rule, it is dropped and not exported.
68
- *
69
- * @param span - The ReadableSpan that has ended.
70
- */
71
- override onEnd(span: ReadableSpan): void {
72
- for (const filter of this._filters) {
73
- let sourceValue: string;
74
-
75
- if (filter.fieldName === "span_name") {
76
- sourceValue = span.name;
77
- } else if (filter.fieldName === "instrumentation_scope_name") {
78
- sourceValue = span.instrumentationScope.name;
79
- } else {
80
- continue;
81
- }
82
-
83
- const matchValue = filter.matchValue;
84
- const matchOperation = filter.matchOperation;
85
-
86
- switch (true) {
87
- case matchOperation === "exact_match" && sourceValue === matchValue:
88
- case matchOperation === "includes" && sourceValue.includes(matchValue):
89
- case matchOperation === "starts_with" && sourceValue.startsWith(matchValue):
90
- case matchOperation === "ends_with" && sourceValue.endsWith(matchValue):
91
- return;
92
-
93
- default: break;
94
- }
95
- }
96
-
97
- super.onEnd(span);
98
- }
99
- }
@@ -1 +0,0 @@
1
- export * from "./filterable-batch-span-processor";
@@ -1,185 +0,0 @@
1
- /*
2
- This file contains the semantic conventions for attributes either owned by LangWatch, or
3
- which are no yet part of the OpenTelemetry semantic conventions for Gen AI.
4
-
5
- Any that are not yet part of the OpenTelemetry semantic conventions for Gen AI are
6
- marked with an UNSTABLE_ prefix.
7
- */
8
-
9
- /**
10
- * LangWatch input data attribute key
11
- * Used to store the input data for a span or event
12
- */
13
- export const ATTR_LANGWATCH_INPUT = "langwatch.input";
14
-
15
- /**
16
- * LangWatch output data attribute key
17
- * Used to store the output data for a span or event
18
- */
19
- export const ATTR_LANGWATCH_OUTPUT = "langwatch.output";
20
-
21
- /**
22
- * LangWatch span type attribute key
23
- * Used to identify the type of span being traced
24
- */
25
- export const ATTR_LANGWATCH_SPAN_TYPE = "langwatch.span.type";
26
-
27
- /**
28
- * LangWatch RAG contexts attribute key
29
- * Used to store retrieval-augmented generation contexts
30
- */
31
- export const ATTR_LANGWATCH_RAG_CONTEXTS = "langwatch.contexts";
32
-
33
- /**
34
- * LangWatch metrics attribute key
35
- * Used to store custom metrics data
36
- */
37
- export const ATTR_LANGWATCH_METRICS = "langwatch.metrics";
38
-
39
- /**
40
- * LangWatch SDK version attribute key
41
- * Used to track the version of the LangWatch SDK being used
42
- */
43
- export const ATTR_LANGWATCH_SDK_VERSION = "langwatch.sdk.version";
44
-
45
- /**
46
- * LangWatch SDK name attribute key
47
- * Used to identify the LangWatch SDK implementation
48
- */
49
- export const ATTR_LANGWATCH_SDK_NAME = "langwatch.sdk.name";
50
-
51
- /**
52
- * LangWatch SDK language attribute key
53
- * Used to identify the programming language of the SDK
54
- */
55
- export const ATTR_LANGWATCH_SDK_LANGUAGE = "langwatch.sdk.language";
56
-
57
- /**
58
- * LangWatch timestamps attribute key
59
- * Used to store timing information for events
60
- */
61
- export const ATTR_LANGWATCH_TIMESTAMPS = "langwatch.timestamps";
62
-
63
- /**
64
- * LangWatch custom evaluation attribute key
65
- * Used to store custom evaluation data
66
- */
67
- export const ATTR_LANGWATCH_EVALUATION_CUSTOM = "langwatch.evaluation.custom";
68
-
69
- /**
70
- * LangWatch parameters attribute key
71
- * Used to store parameter data for operations
72
- */
73
- export const ATTR_LANGWATCH_PARAMS = "langwatch.params";
74
-
75
- /**
76
- * LangWatch customer ID attribute key
77
- * Used to identify the customer associated with the trace
78
- */
79
- export const ATTR_LANGWATCH_CUSTOMER_ID = "langwatch.customer.id";
80
-
81
- /**
82
- * LangWatch thread ID attribute key
83
- * Used to group related operations within a conversation thread
84
- */
85
- export const ATTR_LANGWATCH_THREAD_ID = "langwatch.thread.id";
86
-
87
- /**
88
- * LangWatch streaming attribute key
89
- * Used to indicate if the operation involves streaming
90
- */
91
- export const ATTR_LANGWATCH_STREAMING = "langwatch.gen_ai.streaming";
92
-
93
- /**
94
- * LangWatch prompt ID attribute key
95
- * Used to identify the specific prompt being used
96
- */
97
- export const ATTR_LANGWATCH_PROMPT_ID = "langwatch.prompt.id";
98
-
99
- /**
100
- * LangWatch prompt version ID attribute key
101
- * Used to identify the specific version of a prompt
102
- */
103
- export const ATTR_LANGWATCH_PROMPT_VERSION_ID = "langwatch.prompt.version.id";
104
-
105
- /**
106
- * LangWatch prompt variables attribute key
107
- * Used to store variables used in prompt templates
108
- */
109
- export const ATTR_LANGWATCH_PROMPT_VARIABLES = "langwatch.prompt.variables";
110
-
111
- /**
112
- * LangWatch prompt selected ID attribute key
113
- * Used to identify which prompt was selected from a set
114
- */
115
- export const ATTR_LANGWATCH_PROMPT_SELECTED_ID = "langwatch.prompt.selected.id";
116
-
117
- /**
118
- * LangWatch prompt version number attribute key
119
- * Used to track the version number of a prompt
120
- */
121
- export const ATTR_LANGWATCH_PROMPT_VERSION_NUMBER =
122
- "langwatch.prompt.version.number";
123
-
124
- /**
125
- * LangWatch gen AI log event imposter attribute key
126
- * Used to identify imposter events in log records
127
- */
128
- export const ATTR_LANGWATCH_GEN_AI_LOG_EVENT_IMPOSTER =
129
- "langwatch.gen_ai.log_event.imposter";
130
-
131
- /**
132
- * LangWatch gen AI log event body attribute key
133
- * Used to store the body content of log events
134
- */
135
- export const ATTR_LANGWATCH_GEN_AI_LOG_EVENT_BODY =
136
- "langwatch.gen_ai.log_event.body";
137
-
138
- /**
139
- * LangWatch LangChain tags attribute key
140
- * Used to store tags associated with LangChain operations
141
- */
142
- export const ATTR_LANGWATCH_LANGCHAIN_TAGS = "langwatch.langchain.tags";
143
-
144
- /**
145
- * LangWatch LangChain event name attribute key
146
- * Used to identify the specific LangChain event type
147
- */
148
- export const ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME = "langwatch.langchain.event_name";
149
-
150
- /**
151
- * LangWatch LangChain run ID attribute key
152
- * Used to identify a specific LangChain run
153
- */
154
- export const ATTR_LANGWATCH_LANGCHAIN_RUN_ID = "langwatch.langchain.run.id";
155
-
156
- /**
157
- * LangWatch LangChain run tags attribute key
158
- * Used to store tags associated with a LangChain run
159
- */
160
- export const ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS = "langwatch.langchain.run.tags";
161
-
162
- /**
163
- * LangWatch LangChain run type attribute key
164
- * Used to identify the type of LangChain run
165
- */
166
- export const ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE = "langwatch.langchain.run.type";
167
-
168
- /**
169
- * LangWatch LangChain run metadata attribute key
170
- * Used to store metadata associated with a LangChain run
171
- */
172
- export const ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA = "langwatch.langchain.run.metadata";
173
-
174
- /**
175
- * LangWatch LangChain run extra parameters attribute key
176
- * Used to store additional parameters for a LangChain run
177
- */
178
- export const ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS = "langwatch.langchain.run.extra_params";
179
-
180
- /**
181
- * LangWatch LangChain run parent ID attribute key
182
- * Used to identify the parent run in a hierarchical structure
183
- */
184
- export const ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID =
185
- "langwatch.langchain.run.parent.id";
@@ -1,42 +0,0 @@
1
- /*
2
- This file contains the values for the OpenTelemetry semantic conventions for GenAI log
3
- record event names.
4
-
5
- 👉 https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-events/
6
- */
7
-
8
- /**
9
- * GenAI system message event name
10
- * Used for log records representing system messages in AI conversations
11
- */
12
- export const LOG_EVNT_GEN_AI_SYSTEM_MESSAGE = "gen.ai.system_message";
13
-
14
- /**
15
- * GenAI user message event name
16
- * Used for log records representing user messages in AI conversations
17
- */
18
- export const LOG_EVNT_GEN_AI_USER_MESSAGE = "gen.ai.user_message";
19
-
20
- /**
21
- * GenAI assistant message event name
22
- * Used for log records representing assistant responses in AI conversations
23
- */
24
- export const LOG_EVNT_GEN_AI_ASSISTANT_MESSAGE = "gen.ai.assistant_message";
25
-
26
- /**
27
- * GenAI tool message event name
28
- * Used for log records representing tool calls or responses in AI conversations
29
- */
30
- export const LOG_EVNT_GEN_AI_TOOL_MESSAGE = "gen.ai.tool_message";
31
-
32
- /**
33
- * GenAI choice event name
34
- * Used for log records representing choices made by AI models
35
- */
36
- export const LOG_EVNT_GEN_AI_CHOICE = "gen.ai.choice";
37
-
38
- /**
39
- * LangWatch LangChain callback event name
40
- * Used for log records representing LangChain callback events
41
- */
42
- export const EVNT_LANGWATCH_LANGCHAIN_CALLBACK = "langwatch.langchain.callback";
@@ -1,16 +0,0 @@
1
- /**
2
- * Semantic conventions module for LangWatch observability
3
- *
4
- * This module exports all semantic convention constants used for:
5
- * - Attributes: Key-value pairs for span and event metadata
6
- * - Values: Predefined values for semantic convention attributes
7
- * - Events: Event names for log records and traces
8
- *
9
- * @see {@link ./attributes} for attribute constants
10
- * @see {@link ./values} for value constants
11
- * @see {@link ./events} for event constants
12
- */
13
-
14
- export * from "./attributes";
15
- export * from "./values";
16
- export * from "./events";
@@ -1,159 +0,0 @@
1
- /*
2
- This file contains the values for the OpenTelemetry semantic conventions for Gen AI,
3
- some of which are still in development and therefor currently considered to be
4
- experimental.
5
-
6
- 👉 https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-events/
7
- */
8
-
9
- /**
10
- * Anthropic AI system identifier
11
- * Used to identify Anthropic's Claude models
12
- */
13
- export const VAL_GEN_AI_SYSTEM_ANTHROPIC = "anthropic";
14
-
15
- /**
16
- * AWS Bedrock system identifier
17
- * Used to identify AWS Bedrock AI services
18
- */
19
- export const VAL_GEN_AI_SYSTEM_AWS_BEDROCK = "aws.bedrock";
20
-
21
- /**
22
- * Azure AI Inference system identifier
23
- * Used to identify Azure AI Inference services
24
- */
25
- export const VAL_GEN_AI_SYSTEM_AZURE_AI_INFERENCE = "azure.ai.inference";
26
-
27
- /**
28
- * Azure AI OpenAI system identifier
29
- * Used to identify Azure OpenAI services
30
- */
31
- export const VAL_GEN_AI_SYSTEM_AZURE_AI_OPENAI = "azure.ai.openai";
32
-
33
- /**
34
- * Cohere system identifier
35
- * Used to identify Cohere AI models
36
- */
37
- export const VAL_GEN_AI_SYSTEM_COHERE = "cohere";
38
-
39
- /**
40
- * DeepSeek system identifier
41
- * Used to identify DeepSeek AI models
42
- */
43
- export const VAL_GEN_AI_SYSTEM_DEEPSEEK = "deepseek";
44
-
45
- /**
46
- * GCP Gemini system identifier
47
- * Used to identify Google Cloud Gemini models
48
- */
49
- export const VAL_GEN_AI_SYSTEM_GCP_GEMINI = "gcp.gemini";
50
-
51
- /**
52
- * GCP Gen AI system identifier
53
- * Used to identify Google Cloud Generative AI services
54
- */
55
- export const VAL_GEN_AI_SYSTEM_GCP_GEN_AI = "gcp.gen_ai";
56
-
57
- /**
58
- * GCP Vertex AI system identifier
59
- * Used to identify Google Cloud Vertex AI services
60
- */
61
- export const VAL_GEN_AI_SYSTEM_GCP_VERTEX_AI = "gcp.vertex_ai";
62
-
63
- /**
64
- * Groq system identifier
65
- * Used to identify Groq AI models
66
- */
67
- export const VAL_GEN_AI_SYSTEM_GROQ = "groq";
68
-
69
- /**
70
- * IBM WatsonX AI system identifier
71
- * Used to identify IBM WatsonX AI services
72
- */
73
- export const VAL_GEN_AI_SYSTEM_IBM_WATSONX_AI = "ibm.watsonx.ai";
74
-
75
- /**
76
- * Mistral AI system identifier
77
- * Used to identify Mistral AI models
78
- */
79
- export const VAL_GEN_AI_SYSTEM_MISTRAL_AI = "mistral_ai";
80
-
81
- /**
82
- * OpenAI system identifier
83
- * Used to identify OpenAI models and services
84
- */
85
- export const VAL_GEN_AI_SYSTEM_OPENAI = "openai";
86
-
87
- /**
88
- * Perplexity system identifier
89
- * Used to identify Perplexity AI models
90
- */
91
- export const VAL_GEN_AI_SYSTEM_PERPLEXITY = "perplexity";
92
-
93
- /**
94
- * XAI system identifier
95
- * Used to identify XAI models and services
96
- */
97
- export const VAL_GEN_AI_SYSTEM_XAI = "xai";
98
-
99
- /**
100
- * Content filter finish reason
101
- * Used when generation stops due to content filtering
102
- */
103
- export const VAL_GEN_AI_FINISH_REASON_CONTENT_FILTER = "content_filter";
104
-
105
- /**
106
- * Error finish reason
107
- * Used when generation stops due to an error
108
- */
109
- export const VAL_GEN_AI_FINISH_REASON_ERROR = "error";
110
-
111
- /**
112
- * Length finish reason
113
- * Used when generation stops due to length limits
114
- */
115
- export const VAL_GEN_AI_FINISH_REASON_LENGTH = "length";
116
-
117
- /**
118
- * Stop finish reason
119
- * Used when generation stops due to stop tokens
120
- */
121
- export const VAL_GEN_AI_FINISH_REASON_STOP = "stop";
122
-
123
- /**
124
- * Tool calls finish reason
125
- * Used when generation stops due to tool calls
126
- */
127
- export const VAL_GEN_AI_FINISH_REASON_TOOL_CALLS = "tool_calls";
128
-
129
- /**
130
- * Union type of all supported GenAI system identifiers
131
- * Used for type safety when working with system identification
132
- */
133
- export type VAL_GEN_AI_SYSTEMS =
134
- | typeof VAL_GEN_AI_SYSTEM_ANTHROPIC
135
- | typeof VAL_GEN_AI_SYSTEM_AWS_BEDROCK
136
- | typeof VAL_GEN_AI_SYSTEM_AZURE_AI_INFERENCE
137
- | typeof VAL_GEN_AI_SYSTEM_AZURE_AI_OPENAI
138
- | typeof VAL_GEN_AI_SYSTEM_COHERE
139
- | typeof VAL_GEN_AI_SYSTEM_DEEPSEEK
140
- | typeof VAL_GEN_AI_SYSTEM_GCP_GEMINI
141
- | typeof VAL_GEN_AI_SYSTEM_GCP_GEN_AI
142
- | typeof VAL_GEN_AI_SYSTEM_GCP_VERTEX_AI
143
- | typeof VAL_GEN_AI_SYSTEM_GROQ
144
- | typeof VAL_GEN_AI_SYSTEM_IBM_WATSONX_AI
145
- | typeof VAL_GEN_AI_SYSTEM_MISTRAL_AI
146
- | typeof VAL_GEN_AI_SYSTEM_OPENAI
147
- | typeof VAL_GEN_AI_SYSTEM_PERPLEXITY
148
- | typeof VAL_GEN_AI_SYSTEM_XAI;
149
-
150
- /**
151
- * Union type of all supported GenAI finish reasons
152
- * Used for type safety when working with generation completion reasons
153
- */
154
- export type VAL_GEN_AI_FINISH_REASONS =
155
- | typeof VAL_GEN_AI_FINISH_REASON_CONTENT_FILTER
156
- | typeof VAL_GEN_AI_FINISH_REASON_ERROR
157
- | typeof VAL_GEN_AI_FINISH_REASON_LENGTH
158
- | typeof VAL_GEN_AI_FINISH_REASON_STOP
159
- | typeof VAL_GEN_AI_FINISH_REASON_TOOL_CALLS;