langwatch 0.3.1 → 0.4.0
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/README.md +5 -2
- package/dist/{add-LBBS4I3H.js → add-35QACTIV.js} +34 -28
- package/dist/add-35QACTIV.js.map +1 -0
- package/dist/{add-RD3ZKFAT.mjs → add-TRJAXM4D.mjs} +22 -16
- package/dist/add-TRJAXM4D.mjs.map +1 -0
- package/dist/chunk-4ZSSHX6F.js +636 -0
- package/dist/chunk-4ZSSHX6F.js.map +1 -0
- package/dist/chunk-5EVBOHJY.js +155 -0
- package/dist/chunk-5EVBOHJY.js.map +1 -0
- package/dist/{chunk-YN4436PK.mjs → chunk-CU3443HD.mjs} +14 -9
- package/dist/{chunk-2JU376G7.js → chunk-D2CSG4SJ.js} +4 -4
- package/dist/chunk-D2CSG4SJ.js.map +1 -0
- package/dist/chunk-DISMHYXC.js +184 -0
- package/dist/chunk-DISMHYXC.js.map +1 -0
- package/dist/{chunk-E7UE2MPD.mjs → chunk-ECUXLXFT.mjs} +2 -2
- package/dist/chunk-EJWJXTPU.mjs +626 -0
- package/dist/chunk-EJWJXTPU.mjs.map +1 -0
- package/dist/chunk-GQMDZ4GY.mjs +155 -0
- package/dist/chunk-GQMDZ4GY.mjs.map +1 -0
- package/dist/{chunk-3GKPQB4R.mjs → chunk-HUI45ULC.mjs} +4 -4
- package/dist/chunk-HUI45ULC.mjs.map +1 -0
- package/dist/{chunk-HJU67C7H.js → chunk-K64Y6YUG.js} +10 -10
- package/dist/{chunk-HJU67C7H.js.map → chunk-K64Y6YUG.js.map} +1 -1
- package/dist/chunk-LP76VXI3.mjs +636 -0
- package/dist/chunk-LP76VXI3.mjs.map +1 -0
- package/dist/chunk-M4VUHTT2.js +626 -0
- package/dist/chunk-M4VUHTT2.js.map +1 -0
- package/dist/{chunk-PR3JDWC3.mjs → chunk-N2V6J3U2.mjs} +28 -3
- package/dist/chunk-N2V6J3U2.mjs.map +1 -0
- package/dist/chunk-OUCVXP4G.js +258 -0
- package/dist/chunk-OUCVXP4G.js.map +1 -0
- package/dist/{chunk-FJLK5CFL.js → chunk-OXBO24RB.js} +13 -8
- package/dist/chunk-OXBO24RB.js.map +1 -0
- package/dist/chunk-PGWR3OQY.mjs +258 -0
- package/dist/chunk-PGWR3OQY.mjs.map +1 -0
- package/dist/{chunk-SMXXAVMB.js → chunk-SGNJDRCT.js} +2 -2
- package/dist/chunk-SGNJDRCT.js.map +1 -0
- package/dist/{chunk-W5ZEP3CI.mjs → chunk-SYMZPWZE.mjs} +2 -2
- package/dist/chunk-SYMZPWZE.mjs.map +1 -0
- package/dist/{chunk-KGDAENGD.js → chunk-YH5TIVK2.js} +28 -3
- package/dist/chunk-YH5TIVK2.js.map +1 -0
- package/dist/chunk-YNQ44U6D.mjs +184 -0
- package/dist/chunk-YNQ44U6D.mjs.map +1 -0
- package/dist/cli/index.js +8 -8
- package/dist/cli/index.mjs +8 -8
- package/dist/{create-G5MTGOOH.js → create-7K2CC4KQ.js} +11 -11
- package/dist/{create-G5MTGOOH.js.map → create-7K2CC4KQ.js.map} +1 -1
- package/dist/{create-QUZYBMQB.mjs → create-MK7NEGCM.mjs} +8 -8
- package/dist/implementation-C4lvooSg.d.mts +576 -0
- package/dist/implementation-CzemP9jY.d.ts +576 -0
- package/dist/index-DTEZr0Jn.d.mts +34 -0
- package/dist/index-DTEZr0Jn.d.ts +34 -0
- package/dist/index.d.mts +122 -41
- package/dist/index.d.ts +122 -41
- package/dist/index.js +16 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -23
- package/dist/index.mjs.map +1 -1
- package/dist/init-GDKJICSS.js +16 -0
- package/dist/{init-XU2JFY6N.js.map → init-GDKJICSS.js.map} +1 -1
- package/dist/{init-H67RW22E.mjs → init-RINSTP4L.mjs} +5 -5
- package/dist/{list-7NPSX2E4.mjs → list-7L23G5DY.mjs} +28 -16
- package/dist/list-7L23G5DY.mjs.map +1 -0
- package/dist/{list-ZXFLAF52.js → list-OLLQ7XKZ.js} +29 -17
- package/dist/list-OLLQ7XKZ.js.map +1 -0
- package/dist/{login-EK4WVOI2.mjs → login-RCNKL5AM.mjs} +6 -5
- package/dist/login-RCNKL5AM.mjs.map +1 -0
- package/dist/{login-76NQIHKR.js → login-XF3BQQPV.js} +7 -6
- package/dist/login-XF3BQQPV.js.map +1 -0
- package/dist/observability-sdk/index.d.mts +134 -0
- package/dist/observability-sdk/index.d.ts +134 -0
- package/dist/observability-sdk/index.js +41 -0
- package/dist/observability-sdk/index.js.map +1 -0
- package/dist/observability-sdk/index.mjs +41 -0
- package/dist/observability-sdk/instrumentation/langchain/index.d.mts +69 -0
- package/dist/observability-sdk/instrumentation/langchain/index.d.ts +69 -0
- package/dist/observability-sdk/instrumentation/langchain/index.js +518 -0
- package/dist/observability-sdk/instrumentation/langchain/index.js.map +1 -0
- package/dist/observability-sdk/instrumentation/langchain/index.mjs +518 -0
- package/dist/observability-sdk/instrumentation/langchain/index.mjs.map +1 -0
- package/dist/observability-sdk/setup/node/index.d.mts +368 -0
- package/dist/observability-sdk/setup/node/index.d.ts +368 -0
- package/dist/observability-sdk/setup/node/index.js +276 -0
- package/dist/observability-sdk/setup/node/index.js.map +1 -0
- package/dist/observability-sdk/setup/node/index.mjs +276 -0
- package/dist/observability-sdk/setup/node/index.mjs.map +1 -0
- package/dist/{remove-SDJYEPAY.mjs → remove-3VLQNVHN.mjs} +11 -8
- package/dist/remove-3VLQNVHN.mjs.map +1 -0
- package/dist/{remove-XBNGIVMR.js → remove-L6JVJBWY.js} +18 -15
- package/dist/remove-L6JVJBWY.js.map +1 -0
- package/dist/{sync-ST2IWXSB.mjs → sync-DPMTUTVL.mjs} +39 -33
- package/dist/sync-DPMTUTVL.mjs.map +1 -0
- package/dist/{sync-EISKGPTL.js → sync-PSU3F5Z4.js} +52 -46
- package/dist/sync-PSU3F5Z4.js.map +1 -0
- package/dist/{prompt-D-jpMrLS.d.mts → types-1q5wIYP5.d.mts} +628 -14
- package/dist/{prompt-D-jpMrLS.d.ts → types-C9k5gGhU.d.ts} +628 -14
- package/dist/types-DRiQaKFG.d.mts +254 -0
- package/dist/types-DRiQaKFG.d.ts +254 -0
- package/dist/types-Dmazk5Bk.d.mts +44 -0
- package/dist/types-Dmazk5Bk.d.ts +44 -0
- package/package.json +40 -40
- package/dist/add-LBBS4I3H.js.map +0 -1
- package/dist/add-RD3ZKFAT.mjs.map +0 -1
- package/dist/chunk-2JU376G7.js.map +0 -1
- package/dist/chunk-2ODBGSBI.js +0 -4
- package/dist/chunk-2ODBGSBI.js.map +0 -1
- package/dist/chunk-3GKPQB4R.mjs.map +0 -1
- package/dist/chunk-52GXX3MA.js +0 -426
- package/dist/chunk-52GXX3MA.js.map +0 -1
- package/dist/chunk-5NC5ILKA.js +0 -94
- package/dist/chunk-5NC5ILKA.js.map +0 -1
- package/dist/chunk-6I4EA43Y.js +0 -39
- package/dist/chunk-6I4EA43Y.js.map +0 -1
- package/dist/chunk-DTEKFQ4U.js +0 -159
- package/dist/chunk-DTEKFQ4U.js.map +0 -1
- package/dist/chunk-F63YKTXA.mjs +0 -47
- package/dist/chunk-F63YKTXA.mjs.map +0 -1
- package/dist/chunk-FJLK5CFL.js.map +0 -1
- package/dist/chunk-GJSEBQXF.mjs +0 -392
- package/dist/chunk-GJSEBQXF.mjs.map +0 -1
- package/dist/chunk-J7ICRUU4.mjs +0 -426
- package/dist/chunk-J7ICRUU4.mjs.map +0 -1
- package/dist/chunk-KGDAENGD.js.map +0 -1
- package/dist/chunk-LD74LVRU.js +0 -47
- package/dist/chunk-LD74LVRU.js.map +0 -1
- package/dist/chunk-PCQVQ7SB.js +0 -45
- package/dist/chunk-PCQVQ7SB.js.map +0 -1
- package/dist/chunk-PR3JDWC3.mjs.map +0 -1
- package/dist/chunk-PWZBLTHR.js +0 -118
- package/dist/chunk-PWZBLTHR.js.map +0 -1
- package/dist/chunk-QEWDG5QE.mjs +0 -45
- package/dist/chunk-QEWDG5QE.mjs.map +0 -1
- package/dist/chunk-SMXXAVMB.js.map +0 -1
- package/dist/chunk-STV4ZVNA.mjs +0 -118
- package/dist/chunk-STV4ZVNA.mjs.map +0 -1
- package/dist/chunk-T5AZMMVS.mjs +0 -94
- package/dist/chunk-T5AZMMVS.mjs.map +0 -1
- package/dist/chunk-UU33HCCZ.mjs +0 -159
- package/dist/chunk-UU33HCCZ.mjs.map +0 -1
- package/dist/chunk-VGHLQXKB.js +0 -392
- package/dist/chunk-VGHLQXKB.js.map +0 -1
- package/dist/chunk-W5ZEP3CI.mjs.map +0 -1
- package/dist/chunk-Y666BJA5.mjs +0 -4
- package/dist/chunk-YFUZF7JM.mjs +0 -39
- package/dist/chunk-YFUZF7JM.mjs.map +0 -1
- package/dist/chunk-YN4436PK.mjs.map +0 -1
- package/dist/client-B2HqIKg6.d.ts +0 -51
- package/dist/client-XyCqclCi.d.mts +0 -51
- package/dist/client-browser.d.mts +0 -8
- package/dist/client-browser.d.ts +0 -8
- package/dist/client-browser.js +0 -85
- package/dist/client-browser.js.map +0 -1
- package/dist/client-browser.mjs +0 -85
- package/dist/client-browser.mjs.map +0 -1
- package/dist/client-node.d.mts +0 -8
- package/dist/client-node.d.ts +0 -8
- package/dist/client-node.js +0 -92
- package/dist/client-node.js.map +0 -1
- package/dist/client-node.mjs +0 -92
- package/dist/client-node.mjs.map +0 -1
- package/dist/evaluation/index.d.mts +0 -897
- package/dist/evaluation/index.d.ts +0 -897
- package/dist/evaluation/index.js +0 -14
- package/dist/evaluation/index.js.map +0 -1
- package/dist/evaluation/index.mjs +0 -14
- package/dist/filterable-batch-span-processor-zO5kcjBY.d.mts +0 -64
- package/dist/filterable-batch-span-processor-zO5kcjBY.d.ts +0 -64
- package/dist/init-XU2JFY6N.js +0 -16
- package/dist/list-7NPSX2E4.mjs.map +0 -1
- package/dist/list-ZXFLAF52.js.map +0 -1
- package/dist/login-76NQIHKR.js.map +0 -1
- package/dist/login-EK4WVOI2.mjs.map +0 -1
- package/dist/observability/index.d.mts +0 -260
- package/dist/observability/index.d.ts +0 -260
- package/dist/observability/index.js +0 -21
- package/dist/observability/index.js.map +0 -1
- package/dist/observability/index.mjs +0 -21
- package/dist/observability/index.mjs.map +0 -1
- package/dist/observability/instrumentation/langchain/index.d.mts +0 -40
- package/dist/observability/instrumentation/langchain/index.d.ts +0 -40
- package/dist/observability/instrumentation/langchain/index.js +0 -668
- package/dist/observability/instrumentation/langchain/index.js.map +0 -1
- package/dist/observability/instrumentation/langchain/index.mjs +0 -668
- package/dist/observability/instrumentation/langchain/index.mjs.map +0 -1
- package/dist/prompt/index.d.mts +0 -10
- package/dist/prompt/index.d.ts +0 -10
- package/dist/prompt/index.js +0 -22
- package/dist/prompt/index.js.map +0 -1
- package/dist/prompt/index.mjs +0 -22
- package/dist/prompt/index.mjs.map +0 -1
- package/dist/record-evaluation-CmxMXa-3.d.mts +0 -25
- package/dist/record-evaluation-CmxMXa-3.d.ts +0 -25
- package/dist/remove-SDJYEPAY.mjs.map +0 -1
- package/dist/remove-XBNGIVMR.js.map +0 -1
- package/dist/sync-EISKGPTL.js.map +0 -1
- package/dist/sync-ST2IWXSB.mjs.map +0 -1
- package/dist/trace-CqaKo0kZ.d.ts +0 -622
- package/dist/trace-DtVc5GhF.d.mts +0 -622
- /package/dist/{chunk-Y666BJA5.mjs.map → chunk-CU3443HD.mjs.map} +0 -0
- /package/dist/{chunk-E7UE2MPD.mjs.map → chunk-ECUXLXFT.mjs.map} +0 -0
- /package/dist/{create-QUZYBMQB.mjs.map → create-MK7NEGCM.mjs.map} +0 -0
- /package/dist/{init-H67RW22E.mjs.map → init-RINSTP4L.mjs.map} +0 -0
- /package/dist/{evaluation → observability-sdk}/index.mjs.map +0 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { AttributeValue } from '@opentelemetry/api';
|
|
2
|
+
import { AnyValue } from '@opentelemetry/api-logs';
|
|
3
|
+
import * as semconvAttributes from '@opentelemetry/semantic-conventions';
|
|
4
|
+
import * as semconvIncubatingAttributes from '@opentelemetry/semantic-conventions/incubating';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* LangWatch input data attribute key
|
|
8
|
+
* Used to store the input data for a span or event
|
|
9
|
+
*/
|
|
10
|
+
declare const ATTR_LANGWATCH_INPUT = "langwatch.input";
|
|
11
|
+
/**
|
|
12
|
+
* LangWatch output data attribute key
|
|
13
|
+
* Used to store the output data for a span or event
|
|
14
|
+
*/
|
|
15
|
+
declare const ATTR_LANGWATCH_OUTPUT = "langwatch.output";
|
|
16
|
+
/**
|
|
17
|
+
* LangWatch span type attribute key
|
|
18
|
+
* Used to identify the type of span being traced
|
|
19
|
+
*/
|
|
20
|
+
declare const ATTR_LANGWATCH_SPAN_TYPE = "langwatch.span.type";
|
|
21
|
+
/**
|
|
22
|
+
* LangWatch RAG contexts attribute key
|
|
23
|
+
* Used to store retrieval-augmented generation contexts
|
|
24
|
+
*/
|
|
25
|
+
declare const ATTR_LANGWATCH_RAG_CONTEXTS = "langwatch.contexts";
|
|
26
|
+
/**
|
|
27
|
+
* LangWatch metrics attribute key
|
|
28
|
+
* Used to store custom metrics data
|
|
29
|
+
*/
|
|
30
|
+
declare const ATTR_LANGWATCH_METRICS = "langwatch.metrics";
|
|
31
|
+
/**
|
|
32
|
+
* LangWatch SDK version attribute key
|
|
33
|
+
* Used to track the version of the LangWatch SDK being used
|
|
34
|
+
*/
|
|
35
|
+
declare const ATTR_LANGWATCH_SDK_VERSION = "langwatch.sdk.version";
|
|
36
|
+
/**
|
|
37
|
+
* LangWatch SDK name attribute key
|
|
38
|
+
* Used to identify the LangWatch SDK implementation
|
|
39
|
+
*/
|
|
40
|
+
declare const ATTR_LANGWATCH_SDK_NAME = "langwatch.sdk.name";
|
|
41
|
+
/**
|
|
42
|
+
* LangWatch SDK language attribute key
|
|
43
|
+
* Used to identify the programming language of the SDK
|
|
44
|
+
*/
|
|
45
|
+
declare const ATTR_LANGWATCH_SDK_LANGUAGE = "langwatch.sdk.language";
|
|
46
|
+
/**
|
|
47
|
+
* LangWatch timestamps attribute key
|
|
48
|
+
* Used to store timing information for events
|
|
49
|
+
*/
|
|
50
|
+
declare const ATTR_LANGWATCH_TIMESTAMPS = "langwatch.timestamps";
|
|
51
|
+
/**
|
|
52
|
+
* LangWatch custom evaluation attribute key
|
|
53
|
+
* Used to store custom evaluation data
|
|
54
|
+
*/
|
|
55
|
+
declare const ATTR_LANGWATCH_EVALUATION_CUSTOM = "langwatch.evaluation.custom";
|
|
56
|
+
/**
|
|
57
|
+
* LangWatch parameters attribute key
|
|
58
|
+
* Used to store parameter data for operations
|
|
59
|
+
*/
|
|
60
|
+
declare const ATTR_LANGWATCH_PARAMS = "langwatch.params";
|
|
61
|
+
/**
|
|
62
|
+
* LangWatch customer ID attribute key
|
|
63
|
+
* Used to identify the customer associated with the trace
|
|
64
|
+
*/
|
|
65
|
+
declare const ATTR_LANGWATCH_CUSTOMER_ID = "langwatch.customer.id";
|
|
66
|
+
/**
|
|
67
|
+
* LangWatch thread ID attribute key
|
|
68
|
+
* Used to group related operations within a conversation thread
|
|
69
|
+
*/
|
|
70
|
+
declare const ATTR_LANGWATCH_THREAD_ID = "langwatch.thread.id";
|
|
71
|
+
/**
|
|
72
|
+
* LangWatch user ID attribute key
|
|
73
|
+
* Used to store the user ID for a span or event
|
|
74
|
+
*/
|
|
75
|
+
declare const ATTR_LANGWATCH_USER_ID = "langwatch.user.id";
|
|
76
|
+
/**
|
|
77
|
+
* LangWatch tags attribute key
|
|
78
|
+
* Used to store tags for a span or event
|
|
79
|
+
*/
|
|
80
|
+
declare const ATTR_LANGWATCH_TAGS = "langwatch.tags";
|
|
81
|
+
/**
|
|
82
|
+
* LangWatch streaming attribute key
|
|
83
|
+
* Used to indicate if the operation involves streaming
|
|
84
|
+
*/
|
|
85
|
+
declare const ATTR_LANGWATCH_STREAMING = "langwatch.gen_ai.streaming";
|
|
86
|
+
/**
|
|
87
|
+
* LangWatch prompt ID attribute key
|
|
88
|
+
* Used to identify the specific prompt being used
|
|
89
|
+
*/
|
|
90
|
+
declare const ATTR_LANGWATCH_PROMPT_ID = "langwatch.prompt.id";
|
|
91
|
+
/**
|
|
92
|
+
* LangWatch prompt ID attribute key
|
|
93
|
+
* Used to identify the specific prompt being used
|
|
94
|
+
*/
|
|
95
|
+
declare const ATTR_LANGWATCH_PROMPT_HANDLE = "langwatch.prompt.handle";
|
|
96
|
+
/**
|
|
97
|
+
* LangWatch prompt version ID attribute key
|
|
98
|
+
* Used to identify the specific version of a prompt
|
|
99
|
+
*/
|
|
100
|
+
declare const ATTR_LANGWATCH_PROMPT_VERSION_ID = "langwatch.prompt.version.id";
|
|
101
|
+
/**
|
|
102
|
+
* LangWatch prompt variables attribute key
|
|
103
|
+
* Used to store variables used in prompt templates
|
|
104
|
+
*/
|
|
105
|
+
declare const ATTR_LANGWATCH_PROMPT_VARIABLES = "langwatch.prompt.variables";
|
|
106
|
+
/**
|
|
107
|
+
* LangWatch prompt selected ID attribute key
|
|
108
|
+
* Used to identify which prompt was selected from a set
|
|
109
|
+
*/
|
|
110
|
+
declare const ATTR_LANGWATCH_PROMPT_SELECTED_ID = "langwatch.prompt.selected.id";
|
|
111
|
+
/**
|
|
112
|
+
* LangWatch prompt version number attribute key
|
|
113
|
+
* Used to track the version number of a prompt
|
|
114
|
+
*/
|
|
115
|
+
declare const ATTR_LANGWATCH_PROMPT_VERSION_NUMBER = "langwatch.prompt.version.number";
|
|
116
|
+
/**
|
|
117
|
+
* LangWatch LangChain tags attribute key
|
|
118
|
+
* Used to store tags associated with LangChain operations
|
|
119
|
+
*/
|
|
120
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_TAGS = "langwatch.langchain.tags";
|
|
121
|
+
/**
|
|
122
|
+
* LangWatch LangChain event name attribute key
|
|
123
|
+
* Used to identify the specific LangChain event type
|
|
124
|
+
*/
|
|
125
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME = "langwatch.langchain.event_name";
|
|
126
|
+
/**
|
|
127
|
+
* LangWatch LangChain run ID attribute key
|
|
128
|
+
* Used to identify a specific LangChain run
|
|
129
|
+
*/
|
|
130
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_ID = "langwatch.langchain.run.id";
|
|
131
|
+
/**
|
|
132
|
+
* LangWatch LangChain run tags attribute key
|
|
133
|
+
* Used to store tags associated with a LangChain run
|
|
134
|
+
*/
|
|
135
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS = "langwatch.langchain.run.tags";
|
|
136
|
+
/**
|
|
137
|
+
* LangWatch LangChain run type attribute key
|
|
138
|
+
* Used to identify the type of LangChain run
|
|
139
|
+
*/
|
|
140
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE = "langwatch.langchain.run.type";
|
|
141
|
+
/**
|
|
142
|
+
* LangWatch LangChain run metadata attribute key
|
|
143
|
+
* Used to store metadata associated with a LangChain run
|
|
144
|
+
*/
|
|
145
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA = "langwatch.langchain.run.metadata";
|
|
146
|
+
/**
|
|
147
|
+
* LangWatch LangChain run extra parameters attribute key
|
|
148
|
+
* Used to store additional parameters for a LangChain run
|
|
149
|
+
*/
|
|
150
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS = "langwatch.langchain.run.extra_params";
|
|
151
|
+
/**
|
|
152
|
+
* LangWatch LangChain run parent ID attribute key
|
|
153
|
+
* Used to identify the parent run in a hierarchical structure
|
|
154
|
+
*/
|
|
155
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID = "langwatch.langchain.run.parent.id";
|
|
156
|
+
|
|
157
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_CUSTOMER_ID: typeof ATTR_LANGWATCH_CUSTOMER_ID;
|
|
158
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_EVALUATION_CUSTOM: typeof ATTR_LANGWATCH_EVALUATION_CUSTOM;
|
|
159
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_INPUT: typeof ATTR_LANGWATCH_INPUT;
|
|
160
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME: typeof ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME;
|
|
161
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS;
|
|
162
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_ID: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_ID;
|
|
163
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA;
|
|
164
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID;
|
|
165
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS;
|
|
166
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE;
|
|
167
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_TAGS: typeof ATTR_LANGWATCH_LANGCHAIN_TAGS;
|
|
168
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_METRICS: typeof ATTR_LANGWATCH_METRICS;
|
|
169
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_OUTPUT: typeof ATTR_LANGWATCH_OUTPUT;
|
|
170
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PARAMS: typeof ATTR_LANGWATCH_PARAMS;
|
|
171
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_HANDLE: typeof ATTR_LANGWATCH_PROMPT_HANDLE;
|
|
172
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_ID: typeof ATTR_LANGWATCH_PROMPT_ID;
|
|
173
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_SELECTED_ID: typeof ATTR_LANGWATCH_PROMPT_SELECTED_ID;
|
|
174
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VARIABLES: typeof ATTR_LANGWATCH_PROMPT_VARIABLES;
|
|
175
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_ID: typeof ATTR_LANGWATCH_PROMPT_VERSION_ID;
|
|
176
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_NUMBER: typeof ATTR_LANGWATCH_PROMPT_VERSION_NUMBER;
|
|
177
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_RAG_CONTEXTS: typeof ATTR_LANGWATCH_RAG_CONTEXTS;
|
|
178
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_SDK_LANGUAGE: typeof ATTR_LANGWATCH_SDK_LANGUAGE;
|
|
179
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_SDK_NAME: typeof ATTR_LANGWATCH_SDK_NAME;
|
|
180
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_SDK_VERSION: typeof ATTR_LANGWATCH_SDK_VERSION;
|
|
181
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_SPAN_TYPE: typeof ATTR_LANGWATCH_SPAN_TYPE;
|
|
182
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_STREAMING: typeof ATTR_LANGWATCH_STREAMING;
|
|
183
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_TAGS: typeof ATTR_LANGWATCH_TAGS;
|
|
184
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_THREAD_ID: typeof ATTR_LANGWATCH_THREAD_ID;
|
|
185
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_TIMESTAMPS: typeof ATTR_LANGWATCH_TIMESTAMPS;
|
|
186
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_USER_ID: typeof ATTR_LANGWATCH_USER_ID;
|
|
187
|
+
declare namespace langwatchAttributes {
|
|
188
|
+
export { langwatchAttributes_ATTR_LANGWATCH_CUSTOMER_ID as ATTR_LANGWATCH_CUSTOMER_ID, langwatchAttributes_ATTR_LANGWATCH_EVALUATION_CUSTOM as ATTR_LANGWATCH_EVALUATION_CUSTOM, langwatchAttributes_ATTR_LANGWATCH_INPUT as ATTR_LANGWATCH_INPUT, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME as ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS as ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_ID as ATTR_LANGWATCH_LANGCHAIN_RUN_ID, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA as ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID as ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS as ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE as ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_TAGS as ATTR_LANGWATCH_LANGCHAIN_TAGS, langwatchAttributes_ATTR_LANGWATCH_METRICS as ATTR_LANGWATCH_METRICS, langwatchAttributes_ATTR_LANGWATCH_OUTPUT as ATTR_LANGWATCH_OUTPUT, langwatchAttributes_ATTR_LANGWATCH_PARAMS as ATTR_LANGWATCH_PARAMS, langwatchAttributes_ATTR_LANGWATCH_PROMPT_HANDLE as ATTR_LANGWATCH_PROMPT_HANDLE, langwatchAttributes_ATTR_LANGWATCH_PROMPT_ID as ATTR_LANGWATCH_PROMPT_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_SELECTED_ID as ATTR_LANGWATCH_PROMPT_SELECTED_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VARIABLES as ATTR_LANGWATCH_PROMPT_VARIABLES, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_ID as ATTR_LANGWATCH_PROMPT_VERSION_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_NUMBER as ATTR_LANGWATCH_PROMPT_VERSION_NUMBER, langwatchAttributes_ATTR_LANGWATCH_RAG_CONTEXTS as ATTR_LANGWATCH_RAG_CONTEXTS, langwatchAttributes_ATTR_LANGWATCH_SDK_LANGUAGE as ATTR_LANGWATCH_SDK_LANGUAGE, langwatchAttributes_ATTR_LANGWATCH_SDK_NAME as ATTR_LANGWATCH_SDK_NAME, langwatchAttributes_ATTR_LANGWATCH_SDK_VERSION as ATTR_LANGWATCH_SDK_VERSION, langwatchAttributes_ATTR_LANGWATCH_SPAN_TYPE as ATTR_LANGWATCH_SPAN_TYPE, langwatchAttributes_ATTR_LANGWATCH_STREAMING as ATTR_LANGWATCH_STREAMING, langwatchAttributes_ATTR_LANGWATCH_TAGS as ATTR_LANGWATCH_TAGS, langwatchAttributes_ATTR_LANGWATCH_THREAD_ID as ATTR_LANGWATCH_THREAD_ID, langwatchAttributes_ATTR_LANGWATCH_TIMESTAMPS as ATTR_LANGWATCH_TIMESTAMPS, langwatchAttributes_ATTR_LANGWATCH_USER_ID as ATTR_LANGWATCH_USER_ID };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
type OnlyStringValues<T> = {
|
|
192
|
+
[K in keyof T]: T[K] extends string ? T[K] : never;
|
|
193
|
+
}[keyof T];
|
|
194
|
+
/**
|
|
195
|
+
* Union type representing all possible attribute keys that can be used in spans.
|
|
196
|
+
*
|
|
197
|
+
* This includes:
|
|
198
|
+
* - Standard OpenTelemetry semantic convention attributes
|
|
199
|
+
* - LangWatch-specific attributes
|
|
200
|
+
* - Custom string attributes
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* const attributes: SemconvAttributes = {
|
|
205
|
+
* "http.method": "GET",
|
|
206
|
+
* "http.url": "https://api.example.com",
|
|
207
|
+
* "langwatch.span.type": "llm",
|
|
208
|
+
* "custom.attribute": "value"
|
|
209
|
+
* };
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
type SemConvAttributeKey = OnlyStringValues<typeof semconvIncubatingAttributes> | OnlyStringValues<typeof semconvAttributes> | OnlyStringValues<typeof langwatchAttributes> | (string & {});
|
|
213
|
+
/**
|
|
214
|
+
* Record type representing span attributes with semantic convention keys.
|
|
215
|
+
*
|
|
216
|
+
* This type ensures type safety when setting attributes on spans while
|
|
217
|
+
* allowing both standard OpenTelemetry semantic conventions and custom attributes.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* const spanAttributes: SemConvAttributes = {
|
|
222
|
+
* "service.name": "my-service",
|
|
223
|
+
* "service.version": "1.0.0",
|
|
224
|
+
* "langwatch.span.type": "llm",
|
|
225
|
+
* "custom.user.id": "user123"
|
|
226
|
+
* };
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
type SemConvAttributes = Partial<Record<SemConvAttributeKey, AttributeValue>>;
|
|
230
|
+
/**
|
|
231
|
+
* Record type representing log record attributes with semantic convention keys.
|
|
232
|
+
*
|
|
233
|
+
* This type ensures type safety when setting attributes on log records while
|
|
234
|
+
* allowing both standard OpenTelemetry semantic conventions and custom attributes.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```typescript
|
|
238
|
+
* const logRecordAttributes: SemConvLogRecordAttributes = {
|
|
239
|
+
* "log.level": "INFO",
|
|
240
|
+
* "log.source": "my-service",
|
|
241
|
+
* "log.category": "test",
|
|
242
|
+
* "user.id": "12345",
|
|
243
|
+
* "string.attr": "string value",
|
|
244
|
+
* "number.attr": 42,
|
|
245
|
+
* "boolean.attr": true,
|
|
246
|
+
* "array.attr": ["item1", "item2", "item3"],
|
|
247
|
+
* "object.attr": { key1: "value1", key2: "value2" },
|
|
248
|
+
* "null.attr": null,
|
|
249
|
+
* };
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
type SemConvLogRecordAttributes = Partial<Record<SemConvAttributeKey, AnyValue>>;
|
|
253
|
+
|
|
254
|
+
export { type SemConvAttributes as S, type SemConvLogRecordAttributes as a, type SemConvAttributeKey as b, langwatchAttributes as l };
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { AttributeValue } from '@opentelemetry/api';
|
|
2
|
+
import { AnyValue } from '@opentelemetry/api-logs';
|
|
3
|
+
import * as semconvAttributes from '@opentelemetry/semantic-conventions';
|
|
4
|
+
import * as semconvIncubatingAttributes from '@opentelemetry/semantic-conventions/incubating';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* LangWatch input data attribute key
|
|
8
|
+
* Used to store the input data for a span or event
|
|
9
|
+
*/
|
|
10
|
+
declare const ATTR_LANGWATCH_INPUT = "langwatch.input";
|
|
11
|
+
/**
|
|
12
|
+
* LangWatch output data attribute key
|
|
13
|
+
* Used to store the output data for a span or event
|
|
14
|
+
*/
|
|
15
|
+
declare const ATTR_LANGWATCH_OUTPUT = "langwatch.output";
|
|
16
|
+
/**
|
|
17
|
+
* LangWatch span type attribute key
|
|
18
|
+
* Used to identify the type of span being traced
|
|
19
|
+
*/
|
|
20
|
+
declare const ATTR_LANGWATCH_SPAN_TYPE = "langwatch.span.type";
|
|
21
|
+
/**
|
|
22
|
+
* LangWatch RAG contexts attribute key
|
|
23
|
+
* Used to store retrieval-augmented generation contexts
|
|
24
|
+
*/
|
|
25
|
+
declare const ATTR_LANGWATCH_RAG_CONTEXTS = "langwatch.contexts";
|
|
26
|
+
/**
|
|
27
|
+
* LangWatch metrics attribute key
|
|
28
|
+
* Used to store custom metrics data
|
|
29
|
+
*/
|
|
30
|
+
declare const ATTR_LANGWATCH_METRICS = "langwatch.metrics";
|
|
31
|
+
/**
|
|
32
|
+
* LangWatch SDK version attribute key
|
|
33
|
+
* Used to track the version of the LangWatch SDK being used
|
|
34
|
+
*/
|
|
35
|
+
declare const ATTR_LANGWATCH_SDK_VERSION = "langwatch.sdk.version";
|
|
36
|
+
/**
|
|
37
|
+
* LangWatch SDK name attribute key
|
|
38
|
+
* Used to identify the LangWatch SDK implementation
|
|
39
|
+
*/
|
|
40
|
+
declare const ATTR_LANGWATCH_SDK_NAME = "langwatch.sdk.name";
|
|
41
|
+
/**
|
|
42
|
+
* LangWatch SDK language attribute key
|
|
43
|
+
* Used to identify the programming language of the SDK
|
|
44
|
+
*/
|
|
45
|
+
declare const ATTR_LANGWATCH_SDK_LANGUAGE = "langwatch.sdk.language";
|
|
46
|
+
/**
|
|
47
|
+
* LangWatch timestamps attribute key
|
|
48
|
+
* Used to store timing information for events
|
|
49
|
+
*/
|
|
50
|
+
declare const ATTR_LANGWATCH_TIMESTAMPS = "langwatch.timestamps";
|
|
51
|
+
/**
|
|
52
|
+
* LangWatch custom evaluation attribute key
|
|
53
|
+
* Used to store custom evaluation data
|
|
54
|
+
*/
|
|
55
|
+
declare const ATTR_LANGWATCH_EVALUATION_CUSTOM = "langwatch.evaluation.custom";
|
|
56
|
+
/**
|
|
57
|
+
* LangWatch parameters attribute key
|
|
58
|
+
* Used to store parameter data for operations
|
|
59
|
+
*/
|
|
60
|
+
declare const ATTR_LANGWATCH_PARAMS = "langwatch.params";
|
|
61
|
+
/**
|
|
62
|
+
* LangWatch customer ID attribute key
|
|
63
|
+
* Used to identify the customer associated with the trace
|
|
64
|
+
*/
|
|
65
|
+
declare const ATTR_LANGWATCH_CUSTOMER_ID = "langwatch.customer.id";
|
|
66
|
+
/**
|
|
67
|
+
* LangWatch thread ID attribute key
|
|
68
|
+
* Used to group related operations within a conversation thread
|
|
69
|
+
*/
|
|
70
|
+
declare const ATTR_LANGWATCH_THREAD_ID = "langwatch.thread.id";
|
|
71
|
+
/**
|
|
72
|
+
* LangWatch user ID attribute key
|
|
73
|
+
* Used to store the user ID for a span or event
|
|
74
|
+
*/
|
|
75
|
+
declare const ATTR_LANGWATCH_USER_ID = "langwatch.user.id";
|
|
76
|
+
/**
|
|
77
|
+
* LangWatch tags attribute key
|
|
78
|
+
* Used to store tags for a span or event
|
|
79
|
+
*/
|
|
80
|
+
declare const ATTR_LANGWATCH_TAGS = "langwatch.tags";
|
|
81
|
+
/**
|
|
82
|
+
* LangWatch streaming attribute key
|
|
83
|
+
* Used to indicate if the operation involves streaming
|
|
84
|
+
*/
|
|
85
|
+
declare const ATTR_LANGWATCH_STREAMING = "langwatch.gen_ai.streaming";
|
|
86
|
+
/**
|
|
87
|
+
* LangWatch prompt ID attribute key
|
|
88
|
+
* Used to identify the specific prompt being used
|
|
89
|
+
*/
|
|
90
|
+
declare const ATTR_LANGWATCH_PROMPT_ID = "langwatch.prompt.id";
|
|
91
|
+
/**
|
|
92
|
+
* LangWatch prompt ID attribute key
|
|
93
|
+
* Used to identify the specific prompt being used
|
|
94
|
+
*/
|
|
95
|
+
declare const ATTR_LANGWATCH_PROMPT_HANDLE = "langwatch.prompt.handle";
|
|
96
|
+
/**
|
|
97
|
+
* LangWatch prompt version ID attribute key
|
|
98
|
+
* Used to identify the specific version of a prompt
|
|
99
|
+
*/
|
|
100
|
+
declare const ATTR_LANGWATCH_PROMPT_VERSION_ID = "langwatch.prompt.version.id";
|
|
101
|
+
/**
|
|
102
|
+
* LangWatch prompt variables attribute key
|
|
103
|
+
* Used to store variables used in prompt templates
|
|
104
|
+
*/
|
|
105
|
+
declare const ATTR_LANGWATCH_PROMPT_VARIABLES = "langwatch.prompt.variables";
|
|
106
|
+
/**
|
|
107
|
+
* LangWatch prompt selected ID attribute key
|
|
108
|
+
* Used to identify which prompt was selected from a set
|
|
109
|
+
*/
|
|
110
|
+
declare const ATTR_LANGWATCH_PROMPT_SELECTED_ID = "langwatch.prompt.selected.id";
|
|
111
|
+
/**
|
|
112
|
+
* LangWatch prompt version number attribute key
|
|
113
|
+
* Used to track the version number of a prompt
|
|
114
|
+
*/
|
|
115
|
+
declare const ATTR_LANGWATCH_PROMPT_VERSION_NUMBER = "langwatch.prompt.version.number";
|
|
116
|
+
/**
|
|
117
|
+
* LangWatch LangChain tags attribute key
|
|
118
|
+
* Used to store tags associated with LangChain operations
|
|
119
|
+
*/
|
|
120
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_TAGS = "langwatch.langchain.tags";
|
|
121
|
+
/**
|
|
122
|
+
* LangWatch LangChain event name attribute key
|
|
123
|
+
* Used to identify the specific LangChain event type
|
|
124
|
+
*/
|
|
125
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME = "langwatch.langchain.event_name";
|
|
126
|
+
/**
|
|
127
|
+
* LangWatch LangChain run ID attribute key
|
|
128
|
+
* Used to identify a specific LangChain run
|
|
129
|
+
*/
|
|
130
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_ID = "langwatch.langchain.run.id";
|
|
131
|
+
/**
|
|
132
|
+
* LangWatch LangChain run tags attribute key
|
|
133
|
+
* Used to store tags associated with a LangChain run
|
|
134
|
+
*/
|
|
135
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS = "langwatch.langchain.run.tags";
|
|
136
|
+
/**
|
|
137
|
+
* LangWatch LangChain run type attribute key
|
|
138
|
+
* Used to identify the type of LangChain run
|
|
139
|
+
*/
|
|
140
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE = "langwatch.langchain.run.type";
|
|
141
|
+
/**
|
|
142
|
+
* LangWatch LangChain run metadata attribute key
|
|
143
|
+
* Used to store metadata associated with a LangChain run
|
|
144
|
+
*/
|
|
145
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA = "langwatch.langchain.run.metadata";
|
|
146
|
+
/**
|
|
147
|
+
* LangWatch LangChain run extra parameters attribute key
|
|
148
|
+
* Used to store additional parameters for a LangChain run
|
|
149
|
+
*/
|
|
150
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS = "langwatch.langchain.run.extra_params";
|
|
151
|
+
/**
|
|
152
|
+
* LangWatch LangChain run parent ID attribute key
|
|
153
|
+
* Used to identify the parent run in a hierarchical structure
|
|
154
|
+
*/
|
|
155
|
+
declare const ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID = "langwatch.langchain.run.parent.id";
|
|
156
|
+
|
|
157
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_CUSTOMER_ID: typeof ATTR_LANGWATCH_CUSTOMER_ID;
|
|
158
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_EVALUATION_CUSTOM: typeof ATTR_LANGWATCH_EVALUATION_CUSTOM;
|
|
159
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_INPUT: typeof ATTR_LANGWATCH_INPUT;
|
|
160
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME: typeof ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME;
|
|
161
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS;
|
|
162
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_ID: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_ID;
|
|
163
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA;
|
|
164
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID;
|
|
165
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS;
|
|
166
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE: typeof ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE;
|
|
167
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_TAGS: typeof ATTR_LANGWATCH_LANGCHAIN_TAGS;
|
|
168
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_METRICS: typeof ATTR_LANGWATCH_METRICS;
|
|
169
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_OUTPUT: typeof ATTR_LANGWATCH_OUTPUT;
|
|
170
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PARAMS: typeof ATTR_LANGWATCH_PARAMS;
|
|
171
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_HANDLE: typeof ATTR_LANGWATCH_PROMPT_HANDLE;
|
|
172
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_ID: typeof ATTR_LANGWATCH_PROMPT_ID;
|
|
173
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_SELECTED_ID: typeof ATTR_LANGWATCH_PROMPT_SELECTED_ID;
|
|
174
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VARIABLES: typeof ATTR_LANGWATCH_PROMPT_VARIABLES;
|
|
175
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_ID: typeof ATTR_LANGWATCH_PROMPT_VERSION_ID;
|
|
176
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_NUMBER: typeof ATTR_LANGWATCH_PROMPT_VERSION_NUMBER;
|
|
177
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_RAG_CONTEXTS: typeof ATTR_LANGWATCH_RAG_CONTEXTS;
|
|
178
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_SDK_LANGUAGE: typeof ATTR_LANGWATCH_SDK_LANGUAGE;
|
|
179
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_SDK_NAME: typeof ATTR_LANGWATCH_SDK_NAME;
|
|
180
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_SDK_VERSION: typeof ATTR_LANGWATCH_SDK_VERSION;
|
|
181
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_SPAN_TYPE: typeof ATTR_LANGWATCH_SPAN_TYPE;
|
|
182
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_STREAMING: typeof ATTR_LANGWATCH_STREAMING;
|
|
183
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_TAGS: typeof ATTR_LANGWATCH_TAGS;
|
|
184
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_THREAD_ID: typeof ATTR_LANGWATCH_THREAD_ID;
|
|
185
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_TIMESTAMPS: typeof ATTR_LANGWATCH_TIMESTAMPS;
|
|
186
|
+
declare const langwatchAttributes_ATTR_LANGWATCH_USER_ID: typeof ATTR_LANGWATCH_USER_ID;
|
|
187
|
+
declare namespace langwatchAttributes {
|
|
188
|
+
export { langwatchAttributes_ATTR_LANGWATCH_CUSTOMER_ID as ATTR_LANGWATCH_CUSTOMER_ID, langwatchAttributes_ATTR_LANGWATCH_EVALUATION_CUSTOM as ATTR_LANGWATCH_EVALUATION_CUSTOM, langwatchAttributes_ATTR_LANGWATCH_INPUT as ATTR_LANGWATCH_INPUT, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME as ATTR_LANGWATCH_LANGCHAIN_EVENT_NAME, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS as ATTR_LANGWATCH_LANGCHAIN_RUN_EXTRA_PARAMS, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_ID as ATTR_LANGWATCH_LANGCHAIN_RUN_ID, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA as ATTR_LANGWATCH_LANGCHAIN_RUN_METADATA, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID as ATTR_LANGWATCH_LANGCHAIN_RUN_PARENT_ID, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS as ATTR_LANGWATCH_LANGCHAIN_RUN_TAGS, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE as ATTR_LANGWATCH_LANGCHAIN_RUN_TYPE, langwatchAttributes_ATTR_LANGWATCH_LANGCHAIN_TAGS as ATTR_LANGWATCH_LANGCHAIN_TAGS, langwatchAttributes_ATTR_LANGWATCH_METRICS as ATTR_LANGWATCH_METRICS, langwatchAttributes_ATTR_LANGWATCH_OUTPUT as ATTR_LANGWATCH_OUTPUT, langwatchAttributes_ATTR_LANGWATCH_PARAMS as ATTR_LANGWATCH_PARAMS, langwatchAttributes_ATTR_LANGWATCH_PROMPT_HANDLE as ATTR_LANGWATCH_PROMPT_HANDLE, langwatchAttributes_ATTR_LANGWATCH_PROMPT_ID as ATTR_LANGWATCH_PROMPT_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_SELECTED_ID as ATTR_LANGWATCH_PROMPT_SELECTED_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VARIABLES as ATTR_LANGWATCH_PROMPT_VARIABLES, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_ID as ATTR_LANGWATCH_PROMPT_VERSION_ID, langwatchAttributes_ATTR_LANGWATCH_PROMPT_VERSION_NUMBER as ATTR_LANGWATCH_PROMPT_VERSION_NUMBER, langwatchAttributes_ATTR_LANGWATCH_RAG_CONTEXTS as ATTR_LANGWATCH_RAG_CONTEXTS, langwatchAttributes_ATTR_LANGWATCH_SDK_LANGUAGE as ATTR_LANGWATCH_SDK_LANGUAGE, langwatchAttributes_ATTR_LANGWATCH_SDK_NAME as ATTR_LANGWATCH_SDK_NAME, langwatchAttributes_ATTR_LANGWATCH_SDK_VERSION as ATTR_LANGWATCH_SDK_VERSION, langwatchAttributes_ATTR_LANGWATCH_SPAN_TYPE as ATTR_LANGWATCH_SPAN_TYPE, langwatchAttributes_ATTR_LANGWATCH_STREAMING as ATTR_LANGWATCH_STREAMING, langwatchAttributes_ATTR_LANGWATCH_TAGS as ATTR_LANGWATCH_TAGS, langwatchAttributes_ATTR_LANGWATCH_THREAD_ID as ATTR_LANGWATCH_THREAD_ID, langwatchAttributes_ATTR_LANGWATCH_TIMESTAMPS as ATTR_LANGWATCH_TIMESTAMPS, langwatchAttributes_ATTR_LANGWATCH_USER_ID as ATTR_LANGWATCH_USER_ID };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
type OnlyStringValues<T> = {
|
|
192
|
+
[K in keyof T]: T[K] extends string ? T[K] : never;
|
|
193
|
+
}[keyof T];
|
|
194
|
+
/**
|
|
195
|
+
* Union type representing all possible attribute keys that can be used in spans.
|
|
196
|
+
*
|
|
197
|
+
* This includes:
|
|
198
|
+
* - Standard OpenTelemetry semantic convention attributes
|
|
199
|
+
* - LangWatch-specific attributes
|
|
200
|
+
* - Custom string attributes
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* const attributes: SemconvAttributes = {
|
|
205
|
+
* "http.method": "GET",
|
|
206
|
+
* "http.url": "https://api.example.com",
|
|
207
|
+
* "langwatch.span.type": "llm",
|
|
208
|
+
* "custom.attribute": "value"
|
|
209
|
+
* };
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
type SemConvAttributeKey = OnlyStringValues<typeof semconvIncubatingAttributes> | OnlyStringValues<typeof semconvAttributes> | OnlyStringValues<typeof langwatchAttributes> | (string & {});
|
|
213
|
+
/**
|
|
214
|
+
* Record type representing span attributes with semantic convention keys.
|
|
215
|
+
*
|
|
216
|
+
* This type ensures type safety when setting attributes on spans while
|
|
217
|
+
* allowing both standard OpenTelemetry semantic conventions and custom attributes.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```typescript
|
|
221
|
+
* const spanAttributes: SemConvAttributes = {
|
|
222
|
+
* "service.name": "my-service",
|
|
223
|
+
* "service.version": "1.0.0",
|
|
224
|
+
* "langwatch.span.type": "llm",
|
|
225
|
+
* "custom.user.id": "user123"
|
|
226
|
+
* };
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
type SemConvAttributes = Partial<Record<SemConvAttributeKey, AttributeValue>>;
|
|
230
|
+
/**
|
|
231
|
+
* Record type representing log record attributes with semantic convention keys.
|
|
232
|
+
*
|
|
233
|
+
* This type ensures type safety when setting attributes on log records while
|
|
234
|
+
* allowing both standard OpenTelemetry semantic conventions and custom attributes.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```typescript
|
|
238
|
+
* const logRecordAttributes: SemConvLogRecordAttributes = {
|
|
239
|
+
* "log.level": "INFO",
|
|
240
|
+
* "log.source": "my-service",
|
|
241
|
+
* "log.category": "test",
|
|
242
|
+
* "user.id": "12345",
|
|
243
|
+
* "string.attr": "string value",
|
|
244
|
+
* "number.attr": 42,
|
|
245
|
+
* "boolean.attr": true,
|
|
246
|
+
* "array.attr": ["item1", "item2", "item3"],
|
|
247
|
+
* "object.attr": { key1: "value1", key2: "value2" },
|
|
248
|
+
* "null.attr": null,
|
|
249
|
+
* };
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
type SemConvLogRecordAttributes = Partial<Record<SemConvAttributeKey, AnyValue>>;
|
|
253
|
+
|
|
254
|
+
export { type SemConvAttributes as S, type SemConvLogRecordAttributes as a, type SemConvAttributeKey as b, langwatchAttributes as l };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data capture modes for controlling automatic capture behavior.
|
|
3
|
+
*/
|
|
4
|
+
type DataCaptureMode = "none" | "input" | "output" | "all";
|
|
5
|
+
/**
|
|
6
|
+
* Context provided to data capture predicates for making decisions.
|
|
7
|
+
*/
|
|
8
|
+
interface DataCaptureContext {
|
|
9
|
+
/** Type of span (e.g., "llm", "chain", "tool", "retriever") */
|
|
10
|
+
spanType: string;
|
|
11
|
+
/** Name of the operation being performed */
|
|
12
|
+
operationName: string;
|
|
13
|
+
/** Any additional attributes set on the span */
|
|
14
|
+
spanAttributes: Record<string, any>;
|
|
15
|
+
/** Environment (development, staging, production) */
|
|
16
|
+
environment?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Predicate function for dynamic capture decisions.
|
|
20
|
+
*
|
|
21
|
+
* @param context - Context about the span and operation
|
|
22
|
+
* @returns Capture mode to use for this specific operation
|
|
23
|
+
*/
|
|
24
|
+
type DataCapturePredicate = (context: DataCaptureContext) => DataCaptureMode;
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for what data should be captured in spans.
|
|
27
|
+
*
|
|
28
|
+
* This provides simple control over input/output data capture
|
|
29
|
+
* by LangWatch instrumentations.
|
|
30
|
+
*/
|
|
31
|
+
interface DataCaptureConfig {
|
|
32
|
+
/**
|
|
33
|
+
* Controls data capture behavior.
|
|
34
|
+
*
|
|
35
|
+
* @default "all"
|
|
36
|
+
*/
|
|
37
|
+
mode?: DataCaptureMode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Union type for all supported data capture configuration formats.
|
|
41
|
+
*/
|
|
42
|
+
type DataCaptureOptions = DataCaptureMode | DataCaptureConfig;
|
|
43
|
+
|
|
44
|
+
export type { DataCaptureOptions as D, DataCaptureMode as a, DataCaptureConfig as b, DataCaptureContext as c, DataCapturePredicate as d };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data capture modes for controlling automatic capture behavior.
|
|
3
|
+
*/
|
|
4
|
+
type DataCaptureMode = "none" | "input" | "output" | "all";
|
|
5
|
+
/**
|
|
6
|
+
* Context provided to data capture predicates for making decisions.
|
|
7
|
+
*/
|
|
8
|
+
interface DataCaptureContext {
|
|
9
|
+
/** Type of span (e.g., "llm", "chain", "tool", "retriever") */
|
|
10
|
+
spanType: string;
|
|
11
|
+
/** Name of the operation being performed */
|
|
12
|
+
operationName: string;
|
|
13
|
+
/** Any additional attributes set on the span */
|
|
14
|
+
spanAttributes: Record<string, any>;
|
|
15
|
+
/** Environment (development, staging, production) */
|
|
16
|
+
environment?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Predicate function for dynamic capture decisions.
|
|
20
|
+
*
|
|
21
|
+
* @param context - Context about the span and operation
|
|
22
|
+
* @returns Capture mode to use for this specific operation
|
|
23
|
+
*/
|
|
24
|
+
type DataCapturePredicate = (context: DataCaptureContext) => DataCaptureMode;
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for what data should be captured in spans.
|
|
27
|
+
*
|
|
28
|
+
* This provides simple control over input/output data capture
|
|
29
|
+
* by LangWatch instrumentations.
|
|
30
|
+
*/
|
|
31
|
+
interface DataCaptureConfig {
|
|
32
|
+
/**
|
|
33
|
+
* Controls data capture behavior.
|
|
34
|
+
*
|
|
35
|
+
* @default "all"
|
|
36
|
+
*/
|
|
37
|
+
mode?: DataCaptureMode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Union type for all supported data capture configuration formats.
|
|
41
|
+
*/
|
|
42
|
+
type DataCaptureOptions = DataCaptureMode | DataCaptureConfig;
|
|
43
|
+
|
|
44
|
+
export type { DataCaptureOptions as D, DataCaptureMode as a, DataCaptureConfig as b, DataCaptureContext as c, DataCapturePredicate as d };
|