@traceai/cohere 0.1.0 → 0.1.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/README.md +78 -369
- package/dist/esm/attributes.d.ts +11 -0
- package/dist/esm/attributes.d.ts.map +1 -0
- package/dist/esm/attributes.js +240 -0
- package/dist/esm/attributes.js.map +1 -0
- package/dist/esm/instrumentation.d.ts +11 -20
- package/dist/esm/instrumentation.d.ts.map +1 -1
- package/dist/esm/instrumentation.js +175 -344
- package/dist/esm/instrumentation.js.map +1 -1
- package/dist/esm/stream.d.ts +6 -0
- package/dist/esm/stream.d.ts.map +1 -0
- package/dist/esm/stream.js +215 -0
- package/dist/esm/stream.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esnext/attributes.d.ts +11 -0
- package/dist/esnext/attributes.d.ts.map +1 -0
- package/dist/esnext/attributes.js +248 -0
- package/dist/esnext/attributes.js.map +1 -0
- package/dist/esnext/instrumentation.d.ts +11 -20
- package/dist/esnext/instrumentation.d.ts.map +1 -1
- package/dist/esnext/instrumentation.js +178 -331
- package/dist/esnext/instrumentation.js.map +1 -1
- package/dist/esnext/stream.d.ts +6 -0
- package/dist/esnext/stream.d.ts.map +1 -0
- package/dist/esnext/stream.js +203 -0
- package/dist/esnext/stream.js.map +1 -0
- package/dist/esnext/tsconfig.esnext.tsbuildinfo +1 -1
- package/dist/esnext/version.d.ts +1 -1
- package/dist/esnext/version.js +1 -1
- package/dist/esnext/version.js.map +1 -1
- package/dist/src/__tests__/attributes.test.d.ts +2 -0
- package/dist/src/__tests__/attributes.test.d.ts.map +1 -0
- package/dist/src/__tests__/attributes.test.js +50 -0
- package/dist/src/__tests__/attributes.test.js.map +1 -0
- package/dist/src/__tests__/auto.test.d.ts +2 -0
- package/dist/src/__tests__/auto.test.d.ts.map +1 -0
- package/dist/src/__tests__/auto.test.js +70 -0
- package/dist/src/__tests__/auto.test.js.map +1 -0
- package/dist/src/__tests__/instrumentation.test.js +1 -1
- package/dist/src/__tests__/instrumentation.test.js.map +1 -1
- package/dist/src/__tests__/lifecycle.test.d.ts +2 -0
- package/dist/src/__tests__/lifecycle.test.d.ts.map +1 -0
- package/dist/src/__tests__/lifecycle.test.js +232 -0
- package/dist/src/__tests__/lifecycle.test.js.map +1 -0
- package/dist/src/__tests__/metadata.test.d.ts +2 -0
- package/dist/src/__tests__/metadata.test.d.ts.map +1 -0
- package/dist/src/__tests__/metadata.test.js +320 -0
- package/dist/src/__tests__/metadata.test.js.map +1 -0
- package/dist/src/__tests__/sdk.test.d.ts +2 -0
- package/dist/src/__tests__/sdk.test.d.ts.map +1 -0
- package/dist/src/__tests__/sdk.test.js +883 -0
- package/dist/src/__tests__/sdk.test.js.map +1 -0
- package/dist/src/__tests__/timing.test.d.ts +2 -0
- package/dist/src/__tests__/timing.test.d.ts.map +1 -0
- package/dist/src/__tests__/timing.test.js +158 -0
- package/dist/src/__tests__/timing.test.js.map +1 -0
- package/dist/src/attributes.d.ts +11 -0
- package/dist/src/attributes.d.ts.map +1 -0
- package/dist/src/attributes.js +257 -0
- package/dist/src/attributes.js.map +1 -0
- package/dist/src/instrumentation.d.ts +11 -20
- package/dist/src/instrumentation.d.ts.map +1 -1
- package/dist/src/instrumentation.js +176 -329
- package/dist/src/instrumentation.js.map +1 -1
- package/dist/src/stream.d.ts +6 -0
- package/dist/src/stream.d.ts.map +1 -0
- package/dist/src/stream.js +215 -0
- package/dist/src/stream.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -11
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
12
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
13
|
+
var m = o[Symbol.asyncIterator], i;
|
|
14
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
15
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
16
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const node_http_1 = require("node:http");
|
|
20
|
+
const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
|
|
21
|
+
const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
|
|
22
|
+
const api_1 = require("@opentelemetry/api");
|
|
23
|
+
const exporter_trace_otlp_http_1 = require("@opentelemetry/exporter-trace-otlp-http");
|
|
24
|
+
const fi_semantic_conventions_1 = require("@traceai/fi-semantic-conventions");
|
|
25
|
+
const instrumentation_1 = require("../instrumentation");
|
|
26
|
+
// Real SDK serialization/iteration against an offline HTTP server. No provider keys.
|
|
27
|
+
const sdk = require("cohere-ai");
|
|
28
|
+
const exporter = new sdk_trace_base_1.InMemorySpanExporter();
|
|
29
|
+
const provider = new sdk_trace_node_1.NodeTracerProvider({ spanProcessors: [new sdk_trace_base_1.SimpleSpanProcessor(exporter)] });
|
|
30
|
+
let server;
|
|
31
|
+
let url;
|
|
32
|
+
let response;
|
|
33
|
+
let streaming = false;
|
|
34
|
+
let wire = [];
|
|
35
|
+
let instrumentation;
|
|
36
|
+
const usage = { cached_tokens: 11, tokens: { input_tokens: 42, output_tokens: 9 }, billed_units: { input_tokens: 30, output_tokens: 7 } };
|
|
37
|
+
const request = { model: "command-fixture", messages: [{ role: "user", content: "private-input" }] };
|
|
38
|
+
const generationId = "synthetic-generation-19";
|
|
39
|
+
const citation = {
|
|
40
|
+
start: 0, end: 8, text: "Evidence", type: "TEXT_CONTENT",
|
|
41
|
+
sources: [
|
|
42
|
+
{ type: "document", id: "doc-19", document: { text: "private-input" } },
|
|
43
|
+
{ type: "tool", id: "tool-19", tool_output: { text: "private-input" } },
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
const start = { type: "message-start", id: generationId, delta: { message: { role: "assistant" } } };
|
|
47
|
+
const content = { type: "content-delta", index: 0, delta: { message: { content: { text: "Evidence" } } } };
|
|
48
|
+
const terminal = { type: "message-end", delta: { finish_reason: "COMPLETE", usage } };
|
|
49
|
+
function events(items, invalidTail = false) {
|
|
50
|
+
streaming = true;
|
|
51
|
+
response = items.map(item => `data: ${JSON.stringify(item)}\n\n`).join("") + (invalidTail ? "data: not-json\n\n" : "");
|
|
52
|
+
}
|
|
53
|
+
function client(config = {}, v2 = true) {
|
|
54
|
+
instrumentation = new instrumentation_1.CohereInstrumentation({ traceConfig: config });
|
|
55
|
+
instrumentation.setTracerProvider(provider);
|
|
56
|
+
instrumentation.manuallyInstrument(sdk);
|
|
57
|
+
return new (v2 ? sdk.CohereClientV2 : sdk.CohereClient)({ token: "offline-placeholder", environment: url });
|
|
58
|
+
}
|
|
59
|
+
function attributes() {
|
|
60
|
+
const spans = exporter.getFinishedSpans();
|
|
61
|
+
expect(spans).toHaveLength(1);
|
|
62
|
+
return spans[0].attributes;
|
|
63
|
+
}
|
|
64
|
+
beforeAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
+
server = (0, node_http_1.createServer)((req, reply) => {
|
|
66
|
+
const chunks = [];
|
|
67
|
+
req.on("data", chunk => chunks.push(chunk));
|
|
68
|
+
req.on("end", () => {
|
|
69
|
+
if (req.url === "/v1/traces") {
|
|
70
|
+
wire.push(JSON.parse(Buffer.concat(chunks).toString()));
|
|
71
|
+
reply.setHeader("Content-Type", "application/json");
|
|
72
|
+
reply.end("{}");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
reply.setHeader("Content-Type", streaming ? "text/event-stream" : "application/json");
|
|
76
|
+
reply.end(typeof response === "string" ? response : JSON.stringify(response));
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
yield new Promise(resolve => server.listen(0, "127.0.0.1", resolve));
|
|
80
|
+
url = `http://127.0.0.1:${server.address().port}`;
|
|
81
|
+
}));
|
|
82
|
+
beforeEach(() => { exporter.reset(); streaming = false; wire = []; });
|
|
83
|
+
afterEach(() => instrumentation === null || instrumentation === void 0 ? void 0 : instrumentation.disable());
|
|
84
|
+
afterAll(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
+
yield new Promise(resolve => server.close(() => resolve()));
|
|
86
|
+
yield provider.shutdown();
|
|
87
|
+
}));
|
|
88
|
+
it.each([false, true])("preserves cached and separately billed tokens with hidden content (stream=%s)", (stream) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
+
var _a, e_1, _b, _c;
|
|
90
|
+
const c = client({ hideInputs: true, hideOutputs: true });
|
|
91
|
+
if (stream) {
|
|
92
|
+
events([start, content, terminal]);
|
|
93
|
+
const delivered = [];
|
|
94
|
+
try {
|
|
95
|
+
for (var _d = true, _e = __asyncValues(yield c.chatStream(request)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
96
|
+
_c = _f.value;
|
|
97
|
+
_d = false;
|
|
98
|
+
const event = _c;
|
|
99
|
+
delivered.push(event);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
103
|
+
finally {
|
|
104
|
+
try {
|
|
105
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
106
|
+
}
|
|
107
|
+
finally { if (e_1) throw e_1.error; }
|
|
108
|
+
}
|
|
109
|
+
expect(delivered[2].delta.usage.cachedTokens).toBe(11);
|
|
110
|
+
expect(delivered[2].delta.usage.billedUnits.inputTokens).toBe(30);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
response = { id: generationId, message: { role: "assistant", content: [{ type: "text", text: "Evidence" }] }, usage };
|
|
114
|
+
const result = yield c.chat(request);
|
|
115
|
+
expect(result.usage.cachedTokens).toBe(11);
|
|
116
|
+
expect(result.usage.billedUnits.inputTokens).toBe(30);
|
|
117
|
+
}
|
|
118
|
+
expect(attributes()).toMatchObject({
|
|
119
|
+
[fi_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_PROMPT]: 42,
|
|
120
|
+
[fi_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_COMPLETION]: 9,
|
|
121
|
+
[fi_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_TOTAL]: 51,
|
|
122
|
+
[fi_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_READ]: 11,
|
|
123
|
+
"cohere.usage.billed_units.input_tokens": 30,
|
|
124
|
+
"cohere.usage.billed_units.output_tokens": 7,
|
|
125
|
+
});
|
|
126
|
+
expect(attributes()[fi_semantic_conventions_1.SemanticConventions.RAW_OUTPUT]).toBeUndefined();
|
|
127
|
+
expect(JSON.stringify(attributes())).not.toMatch(/private-input|Evidence/);
|
|
128
|
+
}));
|
|
129
|
+
it.each([false, true])("preserves billed search units with hidden rerank content (v2=%s)", (v2) => __awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
+
const c = client({ hideInputs: true, hideOutputs: true }, v2);
|
|
131
|
+
response = { id: "rerank-fixture", results: [{ index: 0, relevance_score: 0.9 }], meta: { billed_units: { search_units: 2 } } };
|
|
132
|
+
const result = yield c.rerank({ model: "rerank-fixture", query: "private-input", documents: ["private-input"] });
|
|
133
|
+
expect(result.meta.billedUnits.searchUnits).toBe(2);
|
|
134
|
+
expect(attributes()["cohere.usage.billed_units.search_units"]).toBe(2);
|
|
135
|
+
expect(attributes()[fi_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_TOTAL]).toBeUndefined();
|
|
136
|
+
expect(attributes()[fi_semantic_conventions_1.SemanticConventions.RAW_OUTPUT]).toBeUndefined();
|
|
137
|
+
}));
|
|
138
|
+
const privacyModes = [
|
|
139
|
+
{}, { hideInputs: true }, { hideInputMessages: true }, { hideInputText: true }, { hideInputImages: true },
|
|
140
|
+
{ hideOutputs: true }, { hideOutputMessages: true }, { hideOutputText: true },
|
|
141
|
+
];
|
|
142
|
+
describe.each(privacyModes)("citation privacy %j", config => {
|
|
143
|
+
it.each(["chat", "complete", "cancelled", "eof", "failure"])("retains indexed citation provenance on %s", (ending) => __awaiter(void 0, void 0, void 0, function* () {
|
|
144
|
+
const c = client(config);
|
|
145
|
+
const ragRequest = Object.assign(Object.assign({}, request), { documents: [{ id: "doc-19", data: { text: "private-input" } }] });
|
|
146
|
+
const second = Object.assign(Object.assign({}, citation), { start: 9, end: 17, sources: citation.sources.slice(0, 1) });
|
|
147
|
+
let deliveredCitation;
|
|
148
|
+
if (ending === "chat") {
|
|
149
|
+
response = { id: generationId, message: { role: "assistant", content: [{ type: "text", text: "Evidence" }], citations: [citation, second] } };
|
|
150
|
+
deliveredCitation = (yield c.chat(ragRequest)).message.citations[0];
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
const items = [start, content,
|
|
154
|
+
{ type: "citation-start", index: 1, delta: { message: { citations: second } } },
|
|
155
|
+
{ type: "citation-start", index: 0, delta: { message: { citations: citation } } },
|
|
156
|
+
];
|
|
157
|
+
if (ending === "complete")
|
|
158
|
+
items.push({ type: "citation-end", index: 0 }, { type: "citation-end", index: 1 }, terminal);
|
|
159
|
+
events(items, ending === "failure");
|
|
160
|
+
const consume = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
161
|
+
var _a, e_2, _b, _c;
|
|
162
|
+
try {
|
|
163
|
+
for (var _d = true, _e = __asyncValues(yield c.chatStream(ragRequest)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
164
|
+
_c = _f.value;
|
|
165
|
+
_d = false;
|
|
166
|
+
const event = _c;
|
|
167
|
+
if (event.type === "citation-start" && event.index === 0) {
|
|
168
|
+
deliveredCitation = event.delta.message.citations;
|
|
169
|
+
if (ending === "cancelled")
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
175
|
+
finally {
|
|
176
|
+
try {
|
|
177
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
178
|
+
}
|
|
179
|
+
finally { if (e_2) throw e_2.error; }
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
if (ending === "failure")
|
|
183
|
+
yield expect(consume()).rejects.toBeInstanceOf(Error);
|
|
184
|
+
else
|
|
185
|
+
yield consume();
|
|
186
|
+
}
|
|
187
|
+
// Telemetry projection must never mutate data delivered to the caller.
|
|
188
|
+
expect(JSON.stringify(deliveredCitation)).toContain("private-input");
|
|
189
|
+
const attrs = attributes();
|
|
190
|
+
const outputHidden = config.hideOutputs || config.hideOutputMessages || config.hideOutputText;
|
|
191
|
+
const inputHidden = config.hideInputs || config.hideInputMessages || config.hideInputText || config.hideInputImages;
|
|
192
|
+
if (outputHidden) {
|
|
193
|
+
expect(attrs[fi_semantic_conventions_1.SemanticConventions.LLM_OUTPUT_MESSAGES]).toBeUndefined();
|
|
194
|
+
expect(attrs[fi_semantic_conventions_1.SemanticConventions.RAW_OUTPUT]).toBeUndefined();
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
const expected = [citation, second].map(item => inputHidden ? {
|
|
198
|
+
start: item.start, end: item.end, text: item.text, type: item.type,
|
|
199
|
+
sources: item.sources.map(source => ({ type: source.type, id: source.id })),
|
|
200
|
+
} : Object.assign(Object.assign({}, item), { sources: item.sources.map(source => "tool_output" in source ? {
|
|
201
|
+
type: source.type, id: source.id, toolOutput: source.tool_output,
|
|
202
|
+
} : source) }));
|
|
203
|
+
expect(JSON.parse(attrs[fi_semantic_conventions_1.SemanticConventions.LLM_OUTPUT_MESSAGES])[0].citations).toEqual(expected);
|
|
204
|
+
expect(JSON.parse(attrs[fi_semantic_conventions_1.SemanticConventions.RAW_OUTPUT]).message.citations).toEqual(expected);
|
|
205
|
+
}
|
|
206
|
+
if (inputHidden)
|
|
207
|
+
expect(JSON.stringify(attrs)).not.toContain("private-input");
|
|
208
|
+
expect(exporter.getFinishedSpans()[0].status.code).toBe(ending === "cancelled" ? api_1.SpanStatusCode.UNSET : ["eof", "failure"].includes(ending) ? api_1.SpanStatusCode.ERROR : api_1.SpanStatusCode.OK);
|
|
209
|
+
}));
|
|
210
|
+
});
|
|
211
|
+
it.each(["complete", "cancelled", "abort", "failure", "eof"])("retains the stream-start generation ID with hidden output on %s", (ending) => __awaiter(void 0, void 0, void 0, function* () {
|
|
212
|
+
const c = client({ hideInputs: true, hideOutputs: true });
|
|
213
|
+
events(ending === "complete" ? [start, content, terminal] : [start], ending === "failure");
|
|
214
|
+
const stream = yield c.chatStream(request);
|
|
215
|
+
const consume = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
216
|
+
var _a, e_3, _b, _c;
|
|
217
|
+
try {
|
|
218
|
+
for (var _d = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield stream_1.next(), _a = stream_1_1.done, !_a; _d = true) {
|
|
219
|
+
_c = stream_1_1.value;
|
|
220
|
+
_d = false;
|
|
221
|
+
const event = _c;
|
|
222
|
+
expect(event.type).toBeDefined();
|
|
223
|
+
if (ending === "cancelled")
|
|
224
|
+
break;
|
|
225
|
+
if (ending === "abort") {
|
|
226
|
+
stream.controller.abort();
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
232
|
+
finally {
|
|
233
|
+
try {
|
|
234
|
+
if (!_d && !_a && (_b = stream_1.return)) yield _b.call(stream_1);
|
|
235
|
+
}
|
|
236
|
+
finally { if (e_3) throw e_3.error; }
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
if (ending === "failure")
|
|
240
|
+
yield expect(consume()).rejects.toBeInstanceOf(Error);
|
|
241
|
+
else
|
|
242
|
+
yield consume();
|
|
243
|
+
expect(attributes()[fi_semantic_conventions_1.SemanticConventions.GEN_AI_RESPONSE_ID]).toBe(generationId);
|
|
244
|
+
expect(attributes()[fi_semantic_conventions_1.SemanticConventions.RAW_OUTPUT]).toBeUndefined();
|
|
245
|
+
}));
|
|
246
|
+
it("exports first generated-content latency for a real SDK stream even when content is hidden", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
247
|
+
var _a, e_4, _b, _c;
|
|
248
|
+
const c = client({ hideInputs: true, hideOutputs: true });
|
|
249
|
+
events([start, content, terminal]);
|
|
250
|
+
try {
|
|
251
|
+
for (var _d = true, _e = __asyncValues(yield c.chatStream(request)), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
252
|
+
_c = _f.value;
|
|
253
|
+
_d = false;
|
|
254
|
+
const _event = _c;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
258
|
+
finally {
|
|
259
|
+
try {
|
|
260
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
261
|
+
}
|
|
262
|
+
finally { if (e_4) throw e_4.error; }
|
|
263
|
+
}
|
|
264
|
+
const elapsed = attributes()["cohere.stream.time_to_first_token_ms"];
|
|
265
|
+
expect(typeof elapsed).toBe("number");
|
|
266
|
+
expect(elapsed).toBeGreaterThanOrEqual(0);
|
|
267
|
+
}));
|
|
268
|
+
it.each([false, true])("exports independent metadata and citation privacy over OTLP/HTTP (hideOutputs=%s)", (hideOutputs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
269
|
+
var _a, e_5, _b, _c;
|
|
270
|
+
const c = client({ hideInputs: true, hideOutputs });
|
|
271
|
+
const wireProvider = new sdk_trace_node_1.NodeTracerProvider({ spanProcessors: [
|
|
272
|
+
new sdk_trace_base_1.SimpleSpanProcessor(new exporter_trace_otlp_http_1.OTLPTraceExporter({ url: `${url}/v1/traces` })),
|
|
273
|
+
] });
|
|
274
|
+
instrumentation.setTracerProvider(wireProvider);
|
|
275
|
+
try {
|
|
276
|
+
events([start, content, { type: "citation-start", index: 0, delta: { message: { citations: citation } } }, terminal]);
|
|
277
|
+
try {
|
|
278
|
+
for (var _d = true, _e = __asyncValues(yield c.chatStream(Object.assign(Object.assign({}, request), { documents: [{ id: "doc-19", data: { text: "private-input" } }] }))), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
|
|
279
|
+
_c = _f.value;
|
|
280
|
+
_d = false;
|
|
281
|
+
const _event = _c;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
285
|
+
finally {
|
|
286
|
+
try {
|
|
287
|
+
if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
|
|
288
|
+
}
|
|
289
|
+
finally { if (e_5) throw e_5.error; }
|
|
290
|
+
}
|
|
291
|
+
streaming = false;
|
|
292
|
+
response = { id: "rerank-fixture", results: [{ index: 0, relevance_score: 0.9 }], meta: { billed_units: { search_units: 2 } } };
|
|
293
|
+
yield c.rerank({ model: "rerank-fixture", query: "private-input", documents: ["private-input"] });
|
|
294
|
+
yield wireProvider.forceFlush();
|
|
295
|
+
const spans = wire.flatMap(batch => batch.resourceSpans.flatMap((resource) => resource.scopeSpans.flatMap((scope) => scope.spans)));
|
|
296
|
+
expect(spans).toHaveLength(2);
|
|
297
|
+
const attrs = spans.map(span => Object.fromEntries(span.attributes.map((item) => [item.key, Object.values(item.value)[0]])));
|
|
298
|
+
expect(attrs[0]).toMatchObject({
|
|
299
|
+
[fi_semantic_conventions_1.SemanticConventions.GEN_AI_RESPONSE_ID]: generationId, [fi_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_READ]: 11,
|
|
300
|
+
[fi_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_PROMPT]: 42, [fi_semantic_conventions_1.SemanticConventions.LLM_TOKEN_COUNT_COMPLETION]: 9,
|
|
301
|
+
"cohere.usage.billed_units.input_tokens": 30, "cohere.usage.billed_units.output_tokens": 7,
|
|
302
|
+
"cohere.stream.time_to_first_token_ms": expect.any(Number),
|
|
303
|
+
});
|
|
304
|
+
expect(attrs[1]["cohere.usage.billed_units.search_units"]).toBe(2);
|
|
305
|
+
expect(JSON.stringify(wire)).not.toContain("private-input");
|
|
306
|
+
if (hideOutputs) {
|
|
307
|
+
expect(attrs[0][fi_semantic_conventions_1.SemanticConventions.RAW_OUTPUT]).toBeUndefined();
|
|
308
|
+
expect(attrs[0][fi_semantic_conventions_1.SemanticConventions.LLM_OUTPUT_MESSAGES]).toBeUndefined();
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
const sources = [{ type: "document", id: "doc-19" }, { type: "tool", id: "tool-19" }];
|
|
312
|
+
expect(JSON.parse(attrs[0][fi_semantic_conventions_1.SemanticConventions.RAW_OUTPUT]).message.citations[0].sources).toEqual(sources);
|
|
313
|
+
expect(JSON.parse(attrs[0][fi_semantic_conventions_1.SemanticConventions.LLM_OUTPUT_MESSAGES])[0].citations[0].sources).toEqual(sources);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
finally {
|
|
317
|
+
yield wireProvider.shutdown();
|
|
318
|
+
}
|
|
319
|
+
}));
|
|
320
|
+
//# sourceMappingURL=metadata.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.test.js","sourceRoot":"","sources":["../../../src/__tests__/metadata.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,yCAAiD;AACjD,kEAAmE;AACnE,kEAA0F;AAC1F,4CAAoD;AACpD,sFAA4E;AAC5E,8EAA4E;AAE5E,wDAA2D;AAE3D,qFAAqF;AACrF,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACjC,MAAM,QAAQ,GAAG,IAAI,qCAAoB,EAAE,CAAC;AAC5C,MAAM,QAAQ,GAAG,IAAI,mCAAkB,CAAC,EAAE,cAAc,EAAE,CAAC,IAAI,oCAAmB,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;AACjG,IAAI,MAAc,CAAC;AACnB,IAAI,GAAW,CAAC;AAChB,IAAI,QAAiB,CAAC;AACtB,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,IAAI,IAAI,GAAU,EAAE,CAAC;AACrB,IAAI,eAAsC,CAAC;AAC3C,MAAM,KAAK,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC;AAC1I,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;AACrG,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAC/C,MAAM,QAAQ,GAAG;IACf,KAAK,EAAE,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