From 5497b29c888219550ef3e044566a8b5577b22598 Mon Sep 17 00:00:00 2001 From: darshit-s3 <119623510+darshit-s3@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:00:20 +0530 Subject: [PATCH 01/25] feat: adding gemini support (#162) * feat: adding gemini support * chore: update package lock --- package-lock.json | 24 ++- package.json | 7 +- src/examples/gemini/basic.ts | 36 ++++ src/init/init.ts | 2 + src/instrumentation/gemini/instrumentation.ts | 72 +++++++ src/instrumentation/gemini/patch.ts | 186 ++++++++++++++++++ 6 files changed, 318 insertions(+), 9 deletions(-) create mode 100644 src/examples/gemini/basic.ts create mode 100644 src/instrumentation/gemini/instrumentation.ts create mode 100644 src/instrumentation/gemini/patch.ts diff --git a/package-lock.json b/package-lock.json index 72ea6fcb..74041fcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.1.2", + "version": "5.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/typescript-sdk", - "version": "5.1.2", + "version": "5.2.0", "license": "Apache-2.0", "dependencies": { - "@langtrase/trace-attributes": "7.1.2", + "@langtrase/trace-attributes": "7.2.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -26,6 +26,7 @@ "@ai-sdk/openai": "^0.0.34", "@anthropic-ai/sdk": "^0.24.3", "@changesets/cli": "^2.27.1", + "@google/generative-ai": "^0.1.3", "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", @@ -1877,6 +1878,16 @@ "node": ">=14" } }, + "node_modules/@google/generative-ai": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@google/generative-ai/-/generative-ai-0.1.3.tgz", + "integrity": "sha512-Cm4uJX1sKarpm1mje/MiOIinM7zdUUrQp/5/qGPAgznbdd/B9zup5ehT6c1qGqycFcSopTA1J1HpqHS5kJR8hQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@graphql-typed-document-node/core": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", @@ -2075,9 +2086,10 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" }, "node_modules/@langtrase/trace-attributes": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.1.2.tgz", - "integrity": "sha512-Jih/Xm5K+6eXCKtJHwKIefE4oVxt/Xyo6Nf7LWXt6lJ4ixBcuva0turmNUTMnEDMhV8c86L9EDQDVklmhh/POw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.2.0.tgz", + "integrity": "sha512-F8bwBaCZ94PUTqMpOGFtYg+9B7GF5EoyN8w99hudSr1UXvoG11QQblt4Caw+mqb/4s2lnuJ0xQbQESeUf4StMg==", + "license": "MIT", "dependencies": { "js-tiktoken": "^1.0.14", "json-schema-to-typescript": "^14.1.0", diff --git a/package.json b/package.json index 279504cd..4ca3db2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.1.2", + "version": "5.2.0", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -21,7 +21,7 @@ "author": "Scale3 Labs", "license": "Apache-2.0", "dependencies": { - "@langtrase/trace-attributes": "7.1.2", + "@langtrase/trace-attributes": "7.2.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -36,6 +36,7 @@ "devDependencies": { "@ai-sdk/anthropic": "^0.0.41", "@ai-sdk/openai": "^0.0.34", + "@google/generative-ai": "^0.1.3", "@anthropic-ai/sdk": "^0.24.3", "@changesets/cli": "^2.27.1", "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", @@ -61,4 +62,4 @@ "typescript": "^4.9.5", "weaviate-ts-client": "^2.2.0" } -} \ No newline at end of file +} diff --git a/src/examples/gemini/basic.ts b/src/examples/gemini/basic.ts new file mode 100644 index 00000000..6a2f3cf4 --- /dev/null +++ b/src/examples/gemini/basic.ts @@ -0,0 +1,36 @@ +import { init } from '@langtrace-init/init' +import { GoogleGenerativeAI } from '@google/generative-ai' + +import dotenv from 'dotenv' +dotenv.config() +init({ batch: false, write_spans_to_console: true }) + +if (process.env.GEMINI_API_KEY === undefined) { + throw new Error('GEMINI_API_KEY is not defined') +} +const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY) + +export const basicGeminiChat = async (): Promise => { + const model = genAI.getGenerativeModel({ + model: 'gemini-1.5-flash', + generationConfig: { + candidateCount: 1, + maxOutputTokens: 20, + temperature: 1.0 + } + }) + const prompt = 'Say hi twice' + const result = await model.generateContent(prompt) + console.log(result.response.text()) +} + +export const basicGeminiChatStream = async (): Promise => { + const model = genAI.getGenerativeModel({ model: 'gemini-1.5-flash' }) + const prompt = 'say hi 3 times' + const result = await model.generateContentStream(prompt) + + for await (const chunk of result.stream) { + const chunkText = chunk.text() + process.stdout.write(chunkText) + } +} diff --git a/src/init/init.ts b/src/init/init.ts index 84f80477..d77b458b 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -26,6 +26,7 @@ import { LANGTRACE_REMOTE_URL } from '@langtrace-constants/exporter/langtrace_ex import { anthropicInstrumentation } from '@langtrace-instrumentation/anthropic/instrumentation' import { chromaInstrumentation } from '@langtrace-instrumentation/chroma/instrumentation' import { cohereInstrumentation } from '@langtrace-instrumentation/cohere/instrumentation' +import { geminiInstrumentation } from '@langtrace-instrumentation/gemini/instrumentation' import { groqInstrumentation } from '@langtrace-instrumentation/groq/instrumentation' import { llamaIndexInstrumentation } from '@langtrace-instrumentation/llamaindex/instrumentation' import { openAIInstrumentation } from '@langtrace-instrumentation/openai/instrumentation' @@ -151,6 +152,7 @@ export const init: LangTraceInit = ({ openai: openAIInstrumentation, cohere: cohereInstrumentation, anthropic: anthropicInstrumentation, + gemini: geminiInstrumentation, groq: groqInstrumentation, pinecone: pineconeInstrumentation, llamaindex: llamaIndexInstrumentation, diff --git a/src/instrumentation/gemini/instrumentation.ts b/src/instrumentation/gemini/instrumentation.ts new file mode 100644 index 00000000..5a01a1dc --- /dev/null +++ b/src/instrumentation/gemini/instrumentation.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generateContentPatch } from '@langtrace-instrumentation/gemini/patch' +import { diag } from '@opentelemetry/api' +import { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation' +// eslint-disable-next-line no-restricted-imports +import { name, version } from '../../../package.json' + +class GeminiInstrumentation extends InstrumentationBase { + constructor () { + super(name, version) + } + + init (): Array> { + diag.debug('init GeminiInstrumentation') + const module = new InstrumentationNodeModuleDefinition( + '@google/generative-ai', + ['>=0.1.3'], + (moduleExports, moduleVersion) => { + diag.debug(`Patching Gemini SDK version ${moduleVersion}`) + this._patch(moduleExports, moduleVersion as string) + return moduleExports + }, + (moduleExports, moduleVersion) => { + diag.debug(`Unpatching Gemini SDK version ${moduleVersion}`) + if (moduleExports !== undefined) { + this._unpatch(moduleExports) + } + } + ) + return [module] + } + + private _patch (gemini: any, moduleVersion?: string): void { + if (isWrapped(gemini.GenerativeModel.prototype)) { + this._unpatch(gemini) + } + + this._wrap(gemini.GenerativeModel.prototype, + 'generateContent', + (originalMethod: (...args: any[]) => any) => + generateContentPatch(originalMethod, this.tracer, this.instrumentationVersion, name, moduleVersion) + ) + + this._wrap(gemini.GenerativeModel.prototype, + 'generateContentStream', + (originalMethod: (...args: any[]) => any) => + generateContentPatch(originalMethod, this.tracer, this.instrumentationVersion, name, moduleVersion) + ) + } + + private _unpatch (gemini: any): void { + this._unwrap(gemini.GoogleGenerativeAI.GenerativeModel, 'generateContent') + this._unwrap(gemini.GoogleGenerativeAI.GenerativeModel, 'generateContentStream') + } +} + +export const geminiInstrumentation = new GeminiInstrumentation() diff --git a/src/instrumentation/gemini/patch.ts b/src/instrumentation/gemini/patch.ts new file mode 100644 index 00000000..704a4325 --- /dev/null +++ b/src/instrumentation/gemini/patch.ts @@ -0,0 +1,186 @@ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' +import { calculatePromptTokens, estimateTokens } from '@langtrace-utils/llm' +import { addSpanEvent, createStreamProxy } from '@langtrace-utils/misc' +import { + APIS, + Event, + LLMSpanAttributes, + Vendors +} from '@langtrase/trace-attributes' +import { + context, + diag, + Exception, + Span, + SpanKind, + SpanStatusCode, + trace, + Tracer +} from '@opentelemetry/api' + +export function generateContentPatch ( + originalMethod: (...args: any[]) => any, + tracer: Tracer, + langtraceVersion: string, + sdkName: string, + version?: string +): (...args: any[]) => any { + return async function (this: any, ...args: any[]) { + const serviceProvider = Vendors.GEMINI + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + + const prompts = args.map(arg => ({ + role: 'user', + content: arg + })) + + const attributes: LLMSpanAttributes = { + 'langtrace.sdk.name': sdkName, + 'langtrace.service.name': serviceProvider, + 'langtrace.service.type': 'llm', + 'gen_ai.operation.name': 'chat', + 'langtrace.service.version': version, + 'langtrace.version': langtraceVersion, + 'url.full': '', + 'url.path': '', + 'gen_ai.request.model': this?.model, + 'http.max.retries': this?._client?.maxRetries, + 'http.timeout': this?._client?.timeout, + 'gen_ai.request.temperature': this?.generationConfig?.temperature, + 'gen_ai.request.top_p': this?.generationConfig?.topP, + 'gen_ai.request.top_k': this?.generationConfig?.topK, + 'gen_ai.request.max_tokens': this?.generationConfig?.maxOutputTokens, + 'gen_ai.request.response_format': this?.generationConfig?.responseMimeType, + 'gen_ai.request.frequency_penalty': this?.generationConfig?.frequencyPenalty, + 'gen_ai.request.presence_penalty': this?.generationConfig?.presencePenalty, + 'gen_ai.request.seed': this?.generationConfig?.seed, + ...customAttributes + } + + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] || APIS.gemini.GENERATE_CONTENT.METHOD + + const span = tracer.startSpan( + spanName, + { kind: SpanKind.CLIENT, attributes }, + context.active() + ) + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(prompts) }) + + return await context.with( + trace.setSpan(context.active(), span), + async () => { + try { + const resp = await originalMethod.apply(this, args) + if (Boolean(resp?.stream) && typeof resp?.stream[Symbol.asyncIterator] === 'function') { + // Change the span name for streaming + span.updateName(APIS.gemini.GENERATE_CONTENT_STREAM.METHOD) + const model = this?.model + const promptContent: string = JSON.stringify(prompts) + const promptTokens = calculatePromptTokens( + promptContent, + model as string + ) + + const wrappedStream = createStreamProxy( + resp.stream, + handleStreamResponse(span, resp.stream, promptTokens, attributes) + ) + + return { + ...resp, + stream: wrappedStream + } + } else { + addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify(resp.response.text()) }) + + const respAttributes: Partial = { + 'gen_ai.usage.input_tokens': Number( + resp?.response?.usageMetadata?.promptTokenCount + ), + 'gen_ai.usage.output_tokens': Number( + resp?.response?.usageMetadata?.candidatesTokenCount + ), + 'gen_ai.usage.total_tokens': Number( + resp?.response?.usageMetadata?.totalTokenCount + ), + 'gen_ai.response.finish_reasons': + resp?.response?.candidates[0]?.finishReason + } + span.setAttributes({ ...attributes, ...respAttributes }) + span.setStatus({ code: SpanStatusCode.OK }) + span.end() + return resp + } + } catch (error: any) { + span.setStatus({ code: SpanStatusCode.ERROR }) + span.recordException(error as Exception) + throw error + } + } + ) + } +} + +async function * handleStreamResponse ( + span: Span, + stream: any, + promptTokens: number, + inputAttributes: Partial +): AsyncGenerator { + let completionTokens = 0 + const result: string[] = [] + diag.debug('handleStreamResponse for Gemini') + const customAttributes = + context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + addSpanEvent(span, Event.STREAM_START) + try { + for await (const chunk of stream) { + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + const content = chunk.text ? chunk.text() : '' + const tokenCount = estimateTokens(content as string) + completionTokens += tokenCount + result.push(content as string) + yield chunk + } + addSpanEvent(span, Event.GEN_AI_COMPLETION, { + 'gen_ai.completion': + result.length > 0 + ? JSON.stringify([{ role: 'assistant', content: result.join('') }]) + : undefined + }) + + const attributes: Partial = { + 'gen_ai.usage.output_tokens': promptTokens, + 'gen_ai.usage.input_tokens': completionTokens, + 'gen_ai.usage.total_tokens': promptTokens + completionTokens, + ...customAttributes + } + span.setAttributes({ ...inputAttributes, ...attributes }) + span.setStatus({ code: SpanStatusCode.OK }) + addSpanEvent(span, Event.STREAM_END) + return stream + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + throw error + } finally { + span.end() + } +} From a3ab485e754148840b91acc125e80138030061cc Mon Sep 17 00:00:00 2001 From: Darshit Suratwala Date: Fri, 23 Aug 2024 11:04:37 +0530 Subject: [PATCH 02/25] docs: update changelog for 5.2.0 release --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31eeeaac..734012fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # @langtrase/typescript-sdk +## 5.2.0 + +### Minor Changes + +- Add support for Gemini tracing. + ## 5.1.2 ### Patch Changes From 92a68e232569b1d6ba98e6e2f65b5fbdcfc40d0a Mon Sep 17 00:00:00 2001 From: darshit-s3 <119623510+darshit-s3@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:40:59 +0530 Subject: [PATCH 03/25] feat: adding vertexai instrumentation support (#165) * feat: adding vertexai instrumentation support * style: remove commented import * chore: create types for vertexai * docs: revert vercel ai py check * docs: add mistral check * style: remove new lines --- README.md | 7 +- package-lock.json | 248 +++++++++++++++++- package.json | 7 +- src/examples/vertexai/basic.ts | 75 ++++++ src/init/init.ts | 5 +- src/instrumentation/gemini/instrumentation.ts | 1 - .../vertexai/instrumentation.ts | 86 ++++++ src/instrumentation/vertexai/patch.ts | 214 +++++++++++++++ src/instrumentation/vertexai/types.ts | 33 +++ 9 files changed, 662 insertions(+), 14 deletions(-) create mode 100644 src/examples/vertexai/basic.ts create mode 100644 src/instrumentation/vertexai/instrumentation.ts create mode 100644 src/instrumentation/vertexai/patch.ts create mode 100644 src/instrumentation/vertexai/types.ts diff --git a/README.md b/README.md index 14ffaa43..4fe35e6a 100644 --- a/README.md +++ b/README.md @@ -149,15 +149,16 @@ Langtrace automatically captures traces from the following vendors: | Cohere | LLM | :white_check_mark: | :white_check_mark: | | Groq | LLM | :x: | :white_check_mark: | | Perplexity | LLM | :white_check_mark: | :white_check_mark: | -| Gemini | LLM | :x: | :white_check_mark: | +| Gemini | LLM | :white_check_mark: | :white_check_mark: | +| Mistral | LLM | :x: | :white_check_mark: | | Langchain | Framework | :x: | :white_check_mark: | | LlamaIndex | Framework | :white_check_mark: | :white_check_mark: | | Langgraph | Framework | :x: | :white_check_mark: | | DSPy | Framework | :x: | :white_check_mark: | | CrewAI | Framework | :x: | :white_check_mark: | | Ollama | Framework | :white_check_mark: | :white_check_mark: | -| VertexAI | Framework | :x: | :white_check_mark: | -| VercelAI | Framework | :white_check_mark: | :x: | +| VertexAI | Framework | :white_check_mark: | :white_check_mark: | +| VercelAI | Framework | :white_check_mark: | :x: | | Pinecone | Vector Database | :white_check_mark: | :white_check_mark: | | ChromaDB | Vector Database | :white_check_mark: | :white_check_mark: | | QDrant | Vector Database | :white_check_mark: | :white_check_mark: | diff --git a/package-lock.json b/package-lock.json index 74041fcb..c7ba4c6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.2.0", + "version": "5.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/typescript-sdk", - "version": "5.2.0", + "version": "5.3.0", "license": "Apache-2.0", "dependencies": { - "@langtrase/trace-attributes": "7.2.0", + "@langtrase/trace-attributes": "7.3.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -26,6 +26,7 @@ "@ai-sdk/openai": "^0.0.34", "@anthropic-ai/sdk": "^0.24.3", "@changesets/cli": "^2.27.1", + "@google-cloud/vertexai": "^1.5.0", "@google/generative-ai": "^0.1.3", "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", "@pinecone-database/pinecone": "^2.0.1", @@ -1878,6 +1879,19 @@ "node": ">=14" } }, + "node_modules/@google-cloud/vertexai": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@google-cloud/vertexai/-/vertexai-1.6.0.tgz", + "integrity": "sha512-4GUJ0YmEQ9bWmc5f6EdTgSfCGCokhtG6qQyEzwPtSEgDzu3rYzTp8aq5x7MXw6lKIBqNxXqSUXvNIPNdHfmq5Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "google-auth-library": "^9.1.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@google/generative-ai": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@google/generative-ai/-/generative-ai-0.1.3.tgz", @@ -2086,9 +2100,9 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" }, "node_modules/@langtrase/trace-attributes": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.2.0.tgz", - "integrity": "sha512-F8bwBaCZ94PUTqMpOGFtYg+9B7GF5EoyN8w99hudSr1UXvoG11QQblt4Caw+mqb/4s2lnuJ0xQbQESeUf4StMg==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.3.0.tgz", + "integrity": "sha512-AbBwRT/0RZ36sNZZRLWgV7ELLz537dyO99Uj8m0Nm2ToH58LYLa+ESYaBVv9x7Wro28yUlu/yOi4ZwXjI2L9Qg==", "license": "MIT", "dependencies": { "js-tiktoken": "^1.0.14", @@ -4168,6 +4182,19 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/agentkeepalive": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", @@ -4635,6 +4662,16 @@ "node": "*" } }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/binary-extensions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", @@ -4779,6 +4816,13 @@ "ieee754": "^1.1.13" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -5593,6 +5637,16 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.795", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.795.tgz", @@ -6627,6 +6681,13 @@ "type": "^2.7.2" } }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true, + "license": "MIT" + }, "node_modules/extendable-error": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz", @@ -7089,6 +7150,88 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/gaxios": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-6.7.1.tgz", + "integrity": "sha512-LDODD4TMYx7XXdpwxAVRAIAuB0bzv0s+ywFonY46k126qzQHT9ygyoa9tncmOiQmmDrik65UYsEkv3lbfqQ3yQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9", + "uuid": "^9.0.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/gcp-metadata": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz", + "integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/gcp-metadata/node_modules/gaxios": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.1.3.tgz", + "integrity": "sha512-95hVgBRgEIRQQQHIbnxBXeHbW4TqFk4ZDJW7wmVtvYar72FdhRIo1UGOLS2eRAKCPEdPBWu+M7+A33D9CdX9rA==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -7229,6 +7372,38 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/google-auth-library": { + "version": "9.14.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-9.14.0.tgz", + "integrity": "sha512-Y/eq+RWVs55Io/anIsm24sDS8X79Tq948zVLGaa7+KlJYYqaGwp1YI37w48nzrNi12RgnzMrQD4NzdmCowT90g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^6.1.1", + "gcp-metadata": "^6.1.0", + "gtoken": "^7.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/google-auth-library/node_modules/gcp-metadata": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-6.1.0.tgz", + "integrity": "sha512-Jh/AIwwgaxan+7ZUUmRLCjtchyDiqh4KjBJ5tW3plBZb5iL/BPcso8A5DlzeD9qlw0duCamnNdpFjxwaT0KyKg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "gaxios": "^6.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -7314,6 +7489,20 @@ "web-streams-polyfill": "^3.2.1" } }, + "node_modules/gtoken": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-7.1.0.tgz", + "integrity": "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "gaxios": "^6.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/guid-typescript": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz", @@ -7431,6 +7620,20 @@ } ] }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/human-id": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/human-id/-/human-id-1.0.2.tgz", @@ -8025,6 +8228,16 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -8228,6 +8441,29 @@ "setimmediate": "^1.0.5" } }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", diff --git a/package.json b/package.json index 4ca3db2e..2c6c8142 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.2.0", + "version": "5.3.0", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -21,7 +21,7 @@ "author": "Scale3 Labs", "license": "Apache-2.0", "dependencies": { - "@langtrase/trace-attributes": "7.2.0", + "@langtrase/trace-attributes": "7.3.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -36,9 +36,10 @@ "devDependencies": { "@ai-sdk/anthropic": "^0.0.41", "@ai-sdk/openai": "^0.0.34", - "@google/generative-ai": "^0.1.3", "@anthropic-ai/sdk": "^0.24.3", "@changesets/cli": "^2.27.1", + "@google-cloud/vertexai": "^1.5.0", + "@google/generative-ai": "^0.1.3", "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", diff --git a/src/examples/vertexai/basic.ts b/src/examples/vertexai/basic.ts new file mode 100644 index 00000000..fac3ee81 --- /dev/null +++ b/src/examples/vertexai/basic.ts @@ -0,0 +1,75 @@ +import { init } from '@langtrace-init/init' +import dotenv from 'dotenv' +import { VertexAI } from '@google-cloud/vertexai' + +dotenv.config() +init({ batch: false, write_spans_to_console: true }) + +const project = 'model-palace-429011-f5' +const location = 'us-central1' +const textModel = 'gemini-1.5-flash' + +const vertexAI = new VertexAI({ project, location }) + +const generativeModel = vertexAI.getGenerativeModel({ model: textModel }) + +export const basicVertexAIChat = async (): Promise => { + const request = { contents: [{ role: 'user', parts: [{ text: 'How are you doing today?' }] }] } + const result = await generativeModel.generateContent(request) + const response = result.response + console.log('Response: ', JSON.stringify(response)) +} + +export const basicVertexAIDirectPromptStream = async (): Promise => { + const prompt = 'Write a story about a magic backpack.' + const result = await generativeModel.generateContentStream(prompt) + + // Print text as it comes in. + for await (const item of result.stream) { + console.log('stream chunk: ', JSON.stringify(item)) + } +} + +export const basicVertexAIChatStream = async (): Promise => { + const request = { contents: [{ role: 'user', parts: [{ text: 'How are you doing today?' }] }] } + const streamingResult = await generativeModel.generateContentStream(request) + for await (const item of streamingResult.stream) { + console.log('stream chunk: ', JSON.stringify(item)) + } + const aggregatedResponse = await streamingResult.response + console.log('aggregated response: ', JSON.stringify(aggregatedResponse)) +} + +export const basicImageVertexAIChat = async (): Promise => { + const filePart = { fileData: { fileUri: 'gs://generativeai-downloads/images/scones.jpg', mimeType: 'image/jpeg' } } + const textPart = { text: 'What is this picture about?' } + const request = { contents: [{ role: 'user', parts: [textPart, filePart] }] } + const streamingResult = await generativeModel.generateContentStream(request) + for await (const item of streamingResult.stream) { + console.log('stream chunk: ', JSON.stringify(item)) + } +} + +export const basicVertexAIStartChat = async (): Promise => { + const chat = generativeModel.startChat() + const chatInput = 'How can I learn more about Node.js?' + const result = await chat.sendMessage(chatInput) + const response = result.response + console.log('response: ', JSON.stringify(response)) +} + +export const basicVertexAIStartChatStream = async (): Promise => { + const chat = generativeModel.startChat() + const chatInput = 'How can I learn more about Node.js?' + const result = await chat.sendMessageStream(chatInput) + for await (const item of result.stream) { + const text = item.candidates?.[0]?.content?.parts?.[0]?.text + if (text === undefined || text === null) { + console.log('Stream chunk: ', text) + } else { + console.log('Stream chunk: No text available') + } + } + const aggregatedResponse = await result.response + console.log('Aggregated response: ', JSON.stringify(aggregatedResponse)) +} diff --git a/src/init/init.ts b/src/init/init.ts index d77b458b..f5247bd8 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -40,6 +40,8 @@ import { ollamaInstrumentation } from '@langtrace-instrumentation/ollama/instrum import { Vendor } from '@langtrase/trace-attributes' import { vercelAIInstrumentation } from '@langtrace-instrumentation/vercel/instrumentation' import { DropAttributesProcessor } from '@langtrace-extensions/spanprocessors/DropAttributesProcessor' +import { vertexAIInstrumentation } from '@langtrace-instrumentation/vertexai/instrumentation' + /** * Initializes the LangTrace sdk with custom options. * @@ -161,7 +163,8 @@ export const init: LangTraceInit = ({ weaviate: weaviateInstrumentation, pg: pgInstrumentation, ai: vercelAIInstrumentation, - ollama: ollamaInstrumentation + ollama: ollamaInstrumentation, + vertexai: vertexAIInstrumentation } const initOptions: LangtraceInitOptions = { api_key, diff --git a/src/instrumentation/gemini/instrumentation.ts b/src/instrumentation/gemini/instrumentation.ts index 5a01a1dc..e2d1d85e 100644 --- a/src/instrumentation/gemini/instrumentation.ts +++ b/src/instrumentation/gemini/instrumentation.ts @@ -26,7 +26,6 @@ class GeminiInstrumentation extends InstrumentationBase { } init (): Array> { - diag.debug('init GeminiInstrumentation') const module = new InstrumentationNodeModuleDefinition( '@google/generative-ai', ['>=0.1.3'], diff --git a/src/instrumentation/vertexai/instrumentation.ts b/src/instrumentation/vertexai/instrumentation.ts new file mode 100644 index 00000000..3b247eb7 --- /dev/null +++ b/src/instrumentation/vertexai/instrumentation.ts @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generateContentPatch } from '@langtrace-instrumentation/vertexai/patch' +import { APIS } from '@langtrase/trace-attributes' +import { diag } from '@opentelemetry/api' +import { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation' +// eslint-disable-next-line no-restricted-imports +import { name, version } from '../../../package.json' + +class VertexAIInstrumentation extends InstrumentationBase { + constructor () { + super(name, version) + } + + init (): Array> { + const module = new InstrumentationNodeModuleDefinition( + '@google-cloud/vertexai', + ['>=1.5.0'], + (moduleExports, moduleVersion) => { + diag.debug(`Patching Vertex AI SDK version ${moduleVersion}`) + this._patch(moduleExports, moduleVersion as string) + return moduleExports + }, + (moduleExports, moduleVersion) => { + diag.debug(`Unpatching Vertex AI SDK version ${moduleVersion}`) + if (moduleExports !== undefined) { + this._unpatch(moduleExports) + } + } + ) + return [module] + } + + private _patch (vertexai: any, moduleVersion?: string): void { + if (isWrapped(vertexai.GenerativeModel.prototype)) { + this._unpatch(vertexai) + } + + this._wrap(vertexai.GenerativeModel.prototype, + 'generateContent', + (originalMethod: (...args: any[]) => any) => + generateContentPatch(originalMethod, this.tracer, APIS.vertexai.GENERATE_CONTENT.METHOD, this.instrumentationVersion, name, moduleVersion) + ) + + this._wrap(vertexai.GenerativeModel.prototype, + 'generateContentStream', + (originalMethod: (...args: any[]) => any) => + generateContentPatch(originalMethod, this.tracer, APIS.vertexai.GENERATE_CONTENT_STREAM.METHOD, this.instrumentationVersion, name, moduleVersion) + ) + + this._wrap(vertexai.ChatSession.prototype, + 'sendMessage', + (originalMethod: (...args: any[]) => any) => + generateContentPatch(originalMethod, this.tracer, APIS.vertexai.SEND_MESSAGE.METHOD, this.instrumentationVersion, name, moduleVersion) + ) + + this._wrap(vertexai.ChatSession.prototype, + 'sendMessageStream', + (originalMethod: (...args: any[]) => any) => + generateContentPatch(originalMethod, this.tracer, APIS.vertexai.SEND_MESSAGE_STREAM.METHOD, this.instrumentationVersion, name, moduleVersion) + ) + } + + private _unpatch (vertexai: any): void { + this._unwrap(vertexai.GoogleGenerativeAI.GenerativeModel, 'generateContent') + this._unwrap(vertexai.GoogleGenerativeAI.GenerativeModel, 'generateContentStream') + this._unwrap(vertexai.GoogleGenerativeAI.GenerativeModel, 'sendMessage') + this._unwrap(vertexai.GoogleGenerativeAI.GenerativeModel, 'sendMessageStream') + } +} + +export const vertexAIInstrumentation = new VertexAIInstrumentation() diff --git a/src/instrumentation/vertexai/patch.ts b/src/instrumentation/vertexai/patch.ts new file mode 100644 index 00000000..c4fbcc35 --- /dev/null +++ b/src/instrumentation/vertexai/patch.ts @@ -0,0 +1,214 @@ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' +import { + Candidate, + CandidateContent, + CandidateContentPart, + Resp, + Response +} from '@langtrace-instrumentation/vertexai/types' +import { calculatePromptTokens, estimateTokens } from '@langtrace-utils/llm' +import { addSpanEvent, createStreamProxy } from '@langtrace-utils/misc' +import { + Event, + LLMSpanAttributes, + Vendors +} from '@langtrase/trace-attributes' +import { + context, + diag, + Exception, + Span, + SpanKind, + SpanStatusCode, + trace, + Tracer +} from '@opentelemetry/api' + +export function generateContentPatch ( + originalMethod: (...args: any[]) => any, + tracer: Tracer, + methodSpanName: string, + langtraceVersion: string, + sdkName: string, + version?: string +): (...args: any[]) => any { + return async function (this: any, ...args: any[]) { + const serviceProvider = Vendors.VERTEXAI + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + + const prompts = args.flatMap((arg: string | { contents: CandidateContent[] }) => { + if (typeof arg === 'string') { + // Handle the case where `arg` is a string + return [{ role: 'user', content: arg }] + } else { + // Handle the case where `arg` has the `contents` structure + return arg.contents.map(content => ({ + role: content.role, + content: content.parts.map(part => part.text).join('') + })) + } + }) + + const attributes: LLMSpanAttributes = { + 'langtrace.sdk.name': sdkName, + 'langtrace.service.name': serviceProvider, + 'langtrace.service.type': 'llm', + 'gen_ai.operation.name': 'chat', + 'langtrace.service.version': version, + 'langtrace.version': langtraceVersion, + 'url.full': '', + 'url.path': this?.publisherModelEndpoint, + 'gen_ai.request.model': this?.model, + 'http.max.retries': this?._client?.maxRetries, + 'http.timeout': this?._client?.timeout, + 'gen_ai.request.temperature': this?.generationConfig?.temperature, + 'gen_ai.request.top_p': this?.generationConfig?.topP, + 'gen_ai.request.top_k': this?.generationConfig?.topK, + 'gen_ai.request.max_tokens': this?.generationConfig?.maxOutputTokens, + 'gen_ai.request.response_format': this?.generationConfig?.responseMimeType, + 'gen_ai.request.frequency_penalty': this?.generationConfig?.frequencyPenalty, + 'gen_ai.request.presence_penalty': this?.generationConfig?.presencePenalty, + 'gen_ai.request.seed': this?.generationConfig?.seed, + ...customAttributes + } + + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] || methodSpanName + + const span = tracer.startSpan( + spanName, + { kind: SpanKind.CLIENT, attributes }, + context.active() + ) + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(prompts) }) + + return await context.with( + trace.setSpan(context.active(), span), + async () => { + try { + const resp = await originalMethod.apply(this, args) as Resp + + if (Boolean(resp?.stream) && (typeof resp?.stream[Symbol.asyncIterator] === 'function')) { + // Change the span name for streaming + span.updateName(methodSpanName) + const model = this?.model + const promptContent: string = JSON.stringify(prompts) + const promptTokens = calculatePromptTokens( + promptContent, + model as string + ) + + const wrappedStream = createStreamProxy( + resp.stream, + handleStreamResponse(span, resp.stream, promptTokens, attributes) + ) + + return { + ...resp, + stream: wrappedStream + } + } else { + const formattedContent = resp.response.candidates.map((candidate: Candidate) => { + return { + role: candidate.content.role, + content: candidate.content.parts.map((part: CandidateContentPart) => part.text).join(' ') + } + }) + + addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify(formattedContent) }) + + const respAttributes: Partial = { + 'gen_ai.usage.input_tokens': Number( + resp?.response?.usageMetadata?.promptTokenCount + ), + 'gen_ai.usage.output_tokens': Number( + resp?.response?.usageMetadata?.candidatesTokenCount + ), + 'gen_ai.usage.total_tokens': Number( + resp?.response?.usageMetadata?.totalTokenCount + ), + 'gen_ai.response.finish_reasons': + [resp?.response.candidates[0].finishReason], + 'gen_ai.request.top_logprobs': resp?.response?.candidates[0]?.avgLogprobs + } + span.setAttributes({ ...attributes, ...respAttributes }) + span.setStatus({ code: SpanStatusCode.OK }) + span.end() + return resp + } + } catch (error: any) { + span.setStatus({ code: SpanStatusCode.ERROR }) + span.recordException(error as Exception) + throw error + } + } + ) + } +} + +async function * handleStreamResponse ( + span: Span, + stream: any, + promptTokens: number, + inputAttributes: Partial +): AsyncGenerator { + let completionTokens = 0 + const result: string[] = [] + diag.debug('handleStreamResponse for Vertex') + const customAttributes = + context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + addSpanEvent(span, Event.STREAM_START) + try { + for await (const chunk of stream as Response[]) { + const { content } = chunk.candidates.map((candidate: Candidate) => { + return { + role: candidate.content.role, + content: candidate.content.parts.map((part: CandidateContentPart) => part.text).join('') + } + })[0] + const tokenCount = estimateTokens(content) + completionTokens += tokenCount + result.push(content) + yield chunk + } + addSpanEvent(span, Event.GEN_AI_COMPLETION, { + 'gen_ai.completion': + result.length > 0 + ? JSON.stringify([{ role: 'model', content: result.join('') }]) + : undefined + }) + + const attributes: Partial = { + 'gen_ai.usage.input_tokens': promptTokens, + 'gen_ai.usage.output_tokens': completionTokens, + 'gen_ai.usage.total_tokens': promptTokens + completionTokens, + ...customAttributes + } + span.setAttributes({ ...inputAttributes, ...attributes }) + span.setStatus({ code: SpanStatusCode.OK }) + addSpanEvent(span, Event.STREAM_END) + return stream + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + throw error + } finally { + span.end() + } +} diff --git a/src/instrumentation/vertexai/types.ts b/src/instrumentation/vertexai/types.ts new file mode 100644 index 00000000..3037e5ed --- /dev/null +++ b/src/instrumentation/vertexai/types.ts @@ -0,0 +1,33 @@ +export interface CandidateContentPart { + text: string +} + +export interface CandidateContent { + role: string + parts: CandidateContentPart[] +} + +export interface Candidate { + content: CandidateContent + finishReason: string + safetyRatings: any[] + avgLogprobs: number + index: number +} + +export interface UsageMetadata { + promptTokenCount: number + candidatesTokenCount: number + totalTokenCount: number +} + +export interface Response { + text?: any + candidates: Candidate[] + usageMetadata: UsageMetadata +} + +export interface Resp { + stream?: any + response: Response +} From dd3bd22e727a2d4e942b207842273129d958ccde Mon Sep 17 00:00:00 2001 From: darshit-s3 <119623510+darshit-s3@users.noreply.github.com> Date: Thu, 29 Aug 2024 08:33:44 +0530 Subject: [PATCH 04/25] docs: add vertexai to changelog (#166) --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 734012fa..99b4d4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # @langtrase/typescript-sdk +## 5.3.0 + +### Minor Changes + +- Add support for Vertex AI tracing. + ## 5.2.0 ### Minor Changes From 7202a24ae5ce6021fb29b48149bab31c0552b7c8 Mon Sep 17 00:00:00 2001 From: darshit-s3 <119623510+darshit-s3@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:40:39 +0530 Subject: [PATCH 05/25] fix: allow manual patch for Gemini and VertexAI (#169) --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/instrumentation/gemini/instrumentation.ts | 5 +++++ src/instrumentation/vertexai/instrumentation.ts | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99b4d4c1..03730af5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # @langtrase/typescript-sdk +## 5.3.1 + +### Patch Changes + +- Fix allowing manual patch for Gemini and Vertex AI. + ## 5.3.0 ### Minor Changes diff --git a/package.json b/package.json index 2c6c8142..a7690c85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.3.0", + "version": "5.3.1", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/instrumentation/gemini/instrumentation.ts b/src/instrumentation/gemini/instrumentation.ts index e2d1d85e..ae82e3e0 100644 --- a/src/instrumentation/gemini/instrumentation.ts +++ b/src/instrumentation/gemini/instrumentation.ts @@ -25,6 +25,11 @@ class GeminiInstrumentation extends InstrumentationBase { super(name, version) } + public manualPatch (gemini: any): void { + diag.debug('Manually instrumenting Gemini SDK') + this._patch(gemini) + } + init (): Array> { const module = new InstrumentationNodeModuleDefinition( '@google/generative-ai', diff --git a/src/instrumentation/vertexai/instrumentation.ts b/src/instrumentation/vertexai/instrumentation.ts index 3b247eb7..5a506b9a 100644 --- a/src/instrumentation/vertexai/instrumentation.ts +++ b/src/instrumentation/vertexai/instrumentation.ts @@ -26,6 +26,11 @@ class VertexAIInstrumentation extends InstrumentationBase { super(name, version) } + public manualPatch (vertexai: any): void { + diag.debug('Manually instrumenting Vertex AI SDK') + this._patch(vertexai) + } + init (): Array> { const module = new InstrumentationNodeModuleDefinition( '@google-cloud/vertexai', From 774aa6656ff0234ac6b9728087fd2d08f4e1a2b7 Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Thu, 29 Aug 2024 13:19:43 +0100 Subject: [PATCH 06/25] star github link --- src/init/init.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/init/init.ts b/src/init/init.ts index f5247bd8..0cc804b8 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -196,6 +196,8 @@ export const init: LangTraceInit = ({ } global.langtrace_initalized = true global.langtrace_options = initOptions + + diag.info('⭐ Leave our github a star to stay on top of our updates - https://github.com/Scale3-Labs/langtrace') } const disableInstrumentations = (disable_instrumentations: { all_except?: string[], only?: string[] }, allInstrumentations: Record, modules?: { [key in Vendor]?: any }): InstrumentationBase[] => { From e39b5a6f6a2b58ef461aab5cc306595a15f1ebc4 Mon Sep 17 00:00:00 2001 From: darshit-s3 <119623510+darshit-s3@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:10:08 +0530 Subject: [PATCH 07/25] feat: adding vertexai tools tracing support (#172) --- CHANGELOG.md | 7 +++ package-lock.json | 4 +- package.json | 2 +- src/examples/vertexai/basic.ts | 86 ++++++++++++++++++++++++++- src/instrumentation/vertexai/patch.ts | 81 ++++++++++++++++++++++--- src/instrumentation/vertexai/types.ts | 1 + 6 files changed, 167 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03730af5..c0f69e3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # @langtrase/typescript-sdk + +## 5.3.2 + +### Patch Changes + +- Add Vertex AI tools and funcition tracing support + ## 5.3.1 ### Patch Changes diff --git a/package-lock.json b/package-lock.json index c7ba4c6e..c06cdf84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.3.0", + "version": "5.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/typescript-sdk", - "version": "5.3.0", + "version": "5.3.2", "license": "Apache-2.0", "dependencies": { "@langtrase/trace-attributes": "7.3.0", diff --git a/package.json b/package.json index a7690c85..3d5dfc79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.3.1", + "version": "5.3.2", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/examples/vertexai/basic.ts b/src/examples/vertexai/basic.ts index fac3ee81..4e6a619f 100644 --- a/src/examples/vertexai/basic.ts +++ b/src/examples/vertexai/basic.ts @@ -1,6 +1,6 @@ import { init } from '@langtrace-init/init' import dotenv from 'dotenv' -import { VertexAI } from '@google-cloud/vertexai' +import { VertexAI, FunctionDeclarationSchemaType } from '@google-cloud/vertexai' dotenv.config() init({ batch: false, write_spans_to_console: true }) @@ -13,6 +13,38 @@ const vertexAI = new VertexAI({ project, location }) const generativeModel = vertexAI.getGenerativeModel({ model: textModel }) +const functionDeclarations = [ + { + functionDeclarations: [ + { + name: 'get_current_weather', + description: 'get weather in a given location', + parameters: { + type: FunctionDeclarationSchemaType.OBJECT, + properties: { + location: { type: FunctionDeclarationSchemaType.STRING }, + unit: { + type: FunctionDeclarationSchemaType.STRING, + enum: ['celsius', 'fahrenheit'] + } + }, + required: ['location'] + } + } + ] + } +] + +const functionResponseParts = [ + { + functionResponse: { + name: 'get_current_weather', + response: + { name: 'get_current_weather', content: { weather: 'super nice' } } + } + } +] + export const basicVertexAIChat = async (): Promise => { const request = { contents: [{ role: 'user', parts: [{ text: 'How are you doing today?' }] }] } const result = await generativeModel.generateContent(request) @@ -65,11 +97,59 @@ export const basicVertexAIStartChatStream = async (): Promise => { for await (const item of result.stream) { const text = item.candidates?.[0]?.content?.parts?.[0]?.text if (text === undefined || text === null) { - console.log('Stream chunk: ', text) - } else { console.log('Stream chunk: No text available') + } else { + console.log('Stream chunk: ', text) } } const aggregatedResponse = await result.response console.log('Aggregated response: ', JSON.stringify(aggregatedResponse)) } + +export const basicVertexAIStartChatWithToolRequest = async (): Promise => { + const request = { + contents: [ + { role: 'user', parts: [{ text: 'What is the weather in Boston?' }] }, + { role: 'model', parts: [{ functionCall: { name: 'get_current_weather', args: { location: 'Boston' } } }] }, + { role: 'user', parts: functionResponseParts } + ], + tools: functionDeclarations + } + const streamingResult = + await generativeModel.generateContentStream(request) + for await (const item of streamingResult.stream) { + if (item?.candidates !== undefined) { + console.log(item.candidates[0]) + } + } +} + +export const basicVertexAIStartChatWithToolResponse = async (): Promise => { + // Create a chat session and pass your function declarations + const chat = generativeModel.startChat({ tools: functionDeclarations }) + + const chatInput1 = 'What is the weather in Boston?' + + // This should include a functionCall response from the model + const streamingResult1 = await chat.sendMessageStream(chatInput1) + for await (const item of streamingResult1.stream) { + if (item?.candidates !== undefined) { + console.log(item.candidates[0]) + } + } + const response1 = await streamingResult1.response + console.log('first aggregated response: ', JSON.stringify(response1)) + + // Send a follow up message with a FunctionResponse + const streamingResult2 = await chat.sendMessageStream(functionResponseParts) + for await (const item of streamingResult2.stream) { + if (item?.candidates !== undefined) { + console.log(item.candidates[0]) + } + } + + // This should include a text response from the model using the response content + // provided above + const response2 = await streamingResult2.response + console.log('second aggregated response: ', JSON.stringify(response2)) +} diff --git a/src/instrumentation/vertexai/patch.ts b/src/instrumentation/vertexai/patch.ts index c4fbcc35..0834793b 100644 --- a/src/instrumentation/vertexai/patch.ts +++ b/src/instrumentation/vertexai/patch.ts @@ -53,19 +53,62 @@ export function generateContentPatch ( const serviceProvider = Vendors.VERTEXAI const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} - const prompts = args.flatMap((arg: string | { contents: CandidateContent[] }) => { - if (typeof arg === 'string') { + let argTools: any[] = [] + const prompts = args.flatMap((arg: string | { contents?: CandidateContent[], tools?: any, functionResponse?: any }) => { + if (Array.isArray(arg)) { + // Handle the case where `arg` is an array (like [ { functionResponse: ... } ]) + return arg.flatMap(innerArg => { + if (Array.isArray(innerArg.tools)) argTools = argTools.concat(innerArg.tools) + if (innerArg.functionResponse != null) { + return [{ role: 'model', content: JSON.stringify(innerArg.functionResponse) }] + } else if (innerArg.contents != null) { + return innerArg.contents.map((content: CandidateContent) => ({ + role: content.role, + content: content.parts.map((part: CandidateContentPart) => { + if (typeof part.text === 'string') { + return part.text + } else if ('functionCall' in part) { + return JSON.stringify((part as any).functionCall) + } else if (typeof part === 'object') { + return JSON.stringify(part) + } else { + return '' + } + }).join('') + })) + } else { + return [] + } + }) + } else if (typeof arg === 'string') { // Handle the case where `arg` is a string return [{ role: 'user', content: arg }] - } else { + } else if (arg.contents != null) { + if (Array.isArray(arg.tools)) argTools = argTools.concat(arg.tools) // Handle the case where `arg` has the `contents` structure return arg.contents.map(content => ({ role: content.role, - content: content.parts.map(part => part.text).join('') + content: content.parts.map((part: CandidateContentPart) => { + if (typeof part.text === 'string') { + return part.text + } else if ('functionCall' in part) { + return JSON.stringify((part as any).functionCall) + } else if (typeof part === 'object') { + return JSON.stringify(part) + } else { + return '' + } + }).join('') })) + } else if (arg.functionResponse != null) { + // Handle the case where `arg` has a `functionResponse` structure + return [{ role: 'model', content: JSON.stringify(arg.functionResponse) }] + } else { + return [] } }) + const allTools = argTools.concat(this?.tools ?? []) const attributes: LLMSpanAttributes = { 'langtrace.sdk.name': sdkName, 'langtrace.service.name': serviceProvider, @@ -73,9 +116,20 @@ export function generateContentPatch ( 'gen_ai.operation.name': 'chat', 'langtrace.service.version': version, 'langtrace.version': langtraceVersion, - 'url.full': '', - 'url.path': this?.publisherModelEndpoint, - 'gen_ai.request.model': this?.model, + 'url.full': this?.apiEndpoint, + 'url.path': this?.publisherModelEndpoint ?? this?.resourcePath ?? undefined, + 'gen_ai.request.model': (() => { + if (this?.model !== undefined && this.model !== null) { + return this.model + } + if (typeof this?.resourcePath === 'string') { + return this.resourcePath.split('/').pop() + } + if (typeof this?.publisherModelEndpoint === 'string') { + return this.publisherModelEndpoint.split('/').pop() + } + return undefined + })(), 'http.max.retries': this?._client?.maxRetries, 'http.timeout': this?._client?.timeout, 'gen_ai.request.temperature': this?.generationConfig?.temperature, @@ -86,6 +140,7 @@ export function generateContentPatch ( 'gen_ai.request.frequency_penalty': this?.generationConfig?.frequencyPenalty, 'gen_ai.request.presence_penalty': this?.generationConfig?.presencePenalty, 'gen_ai.request.seed': this?.generationConfig?.seed, + 'gen_ai.request.tools': allTools.length > 0 ? JSON.stringify(allTools) : undefined, ...customAttributes } @@ -179,7 +234,17 @@ async function * handleStreamResponse ( const { content } = chunk.candidates.map((candidate: Candidate) => { return { role: candidate.content.role, - content: candidate.content.parts.map((part: CandidateContentPart) => part.text).join('') + content: candidate.content.parts.map((part: CandidateContentPart) => { + if (typeof part.text === 'string') { + return part.text + } else if ('functionCall' in part) { + return JSON.stringify(part.functionCall) + } else if (typeof part === 'object') { + return JSON.stringify(part) + } else { + return '' + } + }).join('') } })[0] const tokenCount = estimateTokens(content) diff --git a/src/instrumentation/vertexai/types.ts b/src/instrumentation/vertexai/types.ts index 3037e5ed..dc11065c 100644 --- a/src/instrumentation/vertexai/types.ts +++ b/src/instrumentation/vertexai/types.ts @@ -1,5 +1,6 @@ export interface CandidateContentPart { text: string + functionCall: any } export interface CandidateContent { From 2af97b7bf2abf8952f5c1315a05db9b94a51eefe Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Wed, 4 Sep 2024 22:13:00 +0100 Subject: [PATCH 08/25] add mistral instrumentation --- src/examples/entrypoint.ts | 4 +- src/examples/mistral/basic.ts | 22 ++ src/init/init.ts | 2 + .../mistral/instrumentation.ts | 86 +++++++ src/instrumentation/mistral/patch.ts | 228 ++++++++++++++++++ 5 files changed, 340 insertions(+), 2 deletions(-) create mode 100644 src/examples/mistral/basic.ts create mode 100644 src/instrumentation/mistral/instrumentation.ts create mode 100644 src/instrumentation/mistral/patch.ts diff --git a/src/examples/entrypoint.ts b/src/examples/entrypoint.ts index ff1282c0..c432a9b5 100644 --- a/src/examples/entrypoint.ts +++ b/src/examples/entrypoint.ts @@ -1,3 +1,3 @@ -import { basic } from '@langtrace-examples/vercel/basic' +import { chatCompletion } from '@langtrace-examples/mistral/basic' -void basic() +void chatCompletion() diff --git a/src/examples/mistral/basic.ts b/src/examples/mistral/basic.ts new file mode 100644 index 00000000..318bcf15 --- /dev/null +++ b/src/examples/mistral/basic.ts @@ -0,0 +1,22 @@ +// Initialize dotenv +// import { init } from '@langtrace-init/init' +// import { withLangTraceRootSpan } from '@langtrace-utils/instrumentation' +import dotenv from 'dotenv' +import { Mistral } from '@mistralai/mistralai' +dotenv.config() + +// init({ write_spans_to_console: false, batch: false }) + +export async function chatCompletion (): Promise { + const client = new Mistral({ apiKey: 'iHN9Q428viFiqh47xZ766XLjSmqnAlvl' }) + + const response = await client.chat.complete({ + model: 'mistral-tiny', + messages: [ + { role: 'user', content: 'What are the best French cheeses?' } + ], + stream: false + }) + + console.info(response) +} diff --git a/src/init/init.ts b/src/init/init.ts index 0cc804b8..4d60816f 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -41,6 +41,7 @@ import { Vendor } from '@langtrase/trace-attributes' import { vercelAIInstrumentation } from '@langtrace-instrumentation/vercel/instrumentation' import { DropAttributesProcessor } from '@langtrace-extensions/spanprocessors/DropAttributesProcessor' import { vertexAIInstrumentation } from '@langtrace-instrumentation/vertexai/instrumentation' +import { mistralInstrumentation } from '@langtrace-instrumentation/mistral/instrumentation' /** * Initializes the LangTrace sdk with custom options. @@ -155,6 +156,7 @@ export const init: LangTraceInit = ({ cohere: cohereInstrumentation, anthropic: anthropicInstrumentation, gemini: geminiInstrumentation, + mistral: mistralInstrumentation, groq: groqInstrumentation, pinecone: pineconeInstrumentation, llamaindex: llamaIndexInstrumentation, diff --git a/src/instrumentation/mistral/instrumentation.ts b/src/instrumentation/mistral/instrumentation.ts new file mode 100644 index 00000000..d17df481 --- /dev/null +++ b/src/instrumentation/mistral/instrumentation.ts @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { diag } from '@opentelemetry/api' +import { + InstrumentationBase, + InstrumentationNodeModuleDefinition, + isWrapped +} from '@opentelemetry/instrumentation' +import { chatComplete, embeddingsCreate } from '@langtrace-instrumentation/mistral/patch' +// eslint-disable-next-line no-restricted-imports +import { version, name } from '../../../package.json' +class MistralInstrumentation extends InstrumentationBase { + constructor () { + super(name, version) + } + + public manualPatch (mistral: any): void { + diag.debug('Manually patching mistral') + this._patch(mistral) + } + + init (): Array> { + const module = new InstrumentationNodeModuleDefinition( + '@mistralai/mistralai', + ['>=1.0.4'], + (moduleExports, moduleVersion) => { + diag.debug(`Patching MistralAI SDK version ${moduleVersion}`) + this._patch(moduleExports, moduleVersion as string) + return moduleExports + }, + (moduleExports, moduleVersion) => { + diag.debug(`Unpatching MistralAI SDK version ${moduleVersion}`) + if (moduleExports !== undefined) { + this._unpatch(moduleExports) + } + } + ) + + return [module] + } + + private _patch (mistral: any, moduleVersion?: string): void { + const wrapped = isWrapped(mistral.Mistral.prototype.chat) || + isWrapped(mistral.Mistral.prototype.embeddings) + if (wrapped) { + this._unpatch(mistral) + } + this._wrap( + mistral.Mistral.prototype.chat, + 'complete', + (originalMethod: (...args: any[]) => any) => { + return chatComplete(originalMethod, this.tracer, this.instrumentationVersion, moduleVersion) + } + ) + + this._wrap( + mistral.Mistral.prototype.embeddings, + 'create', + (originalMethod: (...args: any[]) => any) => + embeddingsCreate(originalMethod, this.tracer, this.instrumentationVersion, moduleVersion) + ) + } + + private _unpatch (openai: any): void { + this._unwrap(openai.OpenAI.Chat.Completions.prototype, 'create') + this._unwrap(openai.OpenAI.Images.prototype, 'generate') + this._unwrap(openai.OpenAI.Images.prototype, 'edit') + this._unwrap(openai.OpenAI.Embeddings.prototype, 'create') + } +} + +export const mistralInstrumentation = new MistralInstrumentation() diff --git a/src/instrumentation/mistral/patch.ts b/src/instrumentation/mistral/patch.ts new file mode 100644 index 00000000..b38357c8 --- /dev/null +++ b/src/instrumentation/mistral/patch.ts @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' +import { addSpanEvent, createStreamProxy } from '@langtrace-utils/misc' +import { APIS, LLMSpanAttributes, Event, Vendors } from '@langtrase/trace-attributes' +import { + Exception, + Span, + SpanKind, + SpanStatusCode, + Tracer, + context, + trace +} from '@opentelemetry/api' + +export function chatComplete ( + originalMethod: (...args: any[]) => any, + tracer: Tracer, + langtraceVersion: string, + version?: string, + stream = false +): (...args: any[]) => any { + return async function (this: any, ...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const originalContext = this + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + // Determine the service provider + const serviceProvider: string = Vendors.MISTRAL + const attributes: LLMSpanAttributes = { + 'langtrace.sdk.name': '@langtrase/typescript-sdk', + 'gen_ai.operation.name': 'chat', + 'langtrace.service.name': serviceProvider, + 'langtrace.service.type': 'llm', + 'langtrace.service.version': version, + 'langtrace.version': langtraceVersion, + 'gen_ai.request.model': args[0]?.model, + 'url.full': originalContext?._client?.baseURL, + 'url.path': APIS.mistral.CHAT_COMPLETE.ENDPOINT, + 'http.max.retries': originalContext?._client?.maxRetries, + 'http.timeout': originalContext?._client?.timeout, + 'gen_ai.request.stream': args[0]?.stream, + 'gen_ai.request.temperature': args[0]?.temperature, + 'gen_ai.request.top_p': args[0]?.top_p, + 'gen_ai.user': args[0]?.user, + 'gen_ai.request.max_tokens': args[0]?.max_tokens, + 'gen_ai.request.tools': JSON.stringify(args[0]?.tools), + ...customAttributes + } + if (args[0]?.functions !== undefined) { + const functionsToTools = args[0].functions.map((func: any) => { + return { + function: func, + type: 'function' + } + }) + attributes['gen_ai.request.tools'] = JSON.stringify(functionsToTools) + } + if (!stream) { + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? APIS.mistral.CHAT_COMPLETE.METHOD + const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes }, context.active()) + return await context.with( + trace.setSpan(context.active(), span), + async () => { + try { + // eslint-disable-next-line no-console + const resp = await originalMethod.apply(this, args) + const responses = resp?.choices?.map((choice: any) => { + const result = { + role: choice?.message?.role, + content: choice?.message?.content !== undefined && choice?.message?.content !== null + ? choice?.message?.content + : choice?.message?.function_call !== undefined + ? JSON.stringify(choice?.message?.function_call) + : JSON.stringify(choice?.message?.tool_calls) + } + return result + }) + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(args[0]?.messages) }) + addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify(responses) }) + const responseAttributes: Partial = { + 'gen_ai.response.model': resp.model, + 'gen_ai.usage.input_tokens': resp.usage.prompt_tokens, + 'gen_ai.usage.output_tokens': resp.usage.completion_tokens, + 'gen_ai.usage.total_tokens': resp.usage.total_tokens + } + span.setAttributes({ ...attributes, ...responseAttributes }) + span.setStatus({ code: SpanStatusCode.OK }) + return resp + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + throw error + } finally { + span.end() + } + } + ) + } else { + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? APIS.mistral.CHAT_STREAM.METHOD + const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes }, context.active()) + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(args[0]?.messages) }) + return await context.with( + trace.setSpan( + context.active(), + span + ), + async () => { + const resp = await originalMethod.apply(this, args) + return createStreamProxy(resp, handleStreamResponse( + span, + resp, + attributes + )) + } + ) + } + } +} + +async function * handleStreamResponse ( + span: Span, + stream: any, + inputAttributes: Partial +): any { + const result: string[] = [] + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + addSpanEvent(span, Event.STREAM_START) + try { + let model = '' + let completionTokens = 0 + let promptTokens = 0 + for await (const chunk of stream) { + if (model === '') { + model = chunk.data.model + } + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + const content = chunk.data.choices[0]?.delta?.content || '' + promptTokens = chunk.data.usage?.promptTokens ?? 0 + completionTokens = chunk.data.usage?.completionTokens ?? 0 + result.push(content as string) + yield chunk + } + addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': result.length > 0 ? JSON.stringify([{ role: 'assistant', content: result.join('') }]) : undefined }) + span.setStatus({ code: SpanStatusCode.OK }) + const attributes: Partial = { + 'gen_ai.response.model': model, + 'gen_ai.usage.output_tokens': promptTokens, + 'gen_ai.usage.input_tokens': completionTokens, + 'gen_ai.usage.total_tokens': promptTokens + completionTokens, + ...customAttributes + } + span.setAttributes({ ...inputAttributes, ...attributes }) + addSpanEvent(span, Event.STREAM_END) + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + throw error + } finally { + span.end() + } +} + +export function embeddingsCreate ( + originalMethod: (...args: any[]) => any, + tracer: Tracer, + langtraceVersion: string, + version?: string +): (...args: any[]) => any { + return async function (this: any, ...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const originalContext = this + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + // Determine the service provider + const serviceProvider: string = Vendors.MISTRAL + const attributes: LLMSpanAttributes = { + 'langtrace.sdk.name': '@langtrase/typescript-sdk', + 'gen_ai.operation.name': 'embed', + 'langtrace.service.name': serviceProvider, + 'langtrace.service.type': 'llm', + 'langtrace.service.version': version, + 'langtrace.version': langtraceVersion, + 'url.full': originalContext?._client?.baseURL, + 'url.path': APIS.mistral.EMBEDDINGS_CREATE.ENDPOINT, + 'gen_ai.request.model': args[0]?.model, + 'http.max.retries': originalContext?._client?.maxRetries, + 'http.timeout': originalContext?._client?.timeout, + 'gen_ai.request.embedding_inputs': JSON.stringify([args[0]?.input]), + 'gen_ai.request.encoding_formats': args[0]?.encoding_format === undefined ? undefined : [args[0]?.encoding_format], + 'gen_ai.request.dimensions': args[0]?.dimensions, + 'gen_ai.user': args[0]?.user, + ...customAttributes + } + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? APIS.mistral.EMBEDDINGS_CREATE.METHOD + const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes }, context.active()) + const f = await context.with( + trace.setSpan(context.active(), span), + async () => { + try { + const resp = await originalMethod.apply(originalContext, args) + + span.setStatus({ code: SpanStatusCode.OK }) + span.end() + return resp + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + span.end() + throw error + } + } + ) + return f + } +} From 05e491dadcc61fcaf5bdd892e7f2d21e5b9dc146 Mon Sep 17 00:00:00 2001 From: Rohit Kadhe Date: Mon, 9 Sep 2024 16:02:02 -0600 Subject: [PATCH 09/25] support otel env vars --- CHANGELOG.md | 5 + package-lock.json | 282 +++++++++--------- package.json | 4 +- .../langtraceexporter/langtrace_exporter.ts | 7 +- src/init/init.ts | 11 +- 5 files changed, 156 insertions(+), 153 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f69e3a..cf81c92e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # @langtrase/typescript-sdk +## 5.4.0 + +### Minor Changes + +- Support OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS env vars ## 5.3.2 diff --git a/package-lock.json b/package-lock.json index c06cdf84..86e97cac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.3.2", + "version": "5.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/typescript-sdk", - "version": "5.3.2", + "version": "5.4.0", "license": "Apache-2.0", "dependencies": { "@langtrase/trace-attributes": "7.3.0", @@ -28,7 +28,7 @@ "@changesets/cli": "^2.27.1", "@google-cloud/vertexai": "^1.5.0", "@google/generative-ai": "^0.1.3", - "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", + "@opentelemetry/exporter-trace-otlp-http": "^0.53.0", "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", "@typescript-eslint/eslint-plugin": "^5.62.0", @@ -2300,16 +2300,16 @@ } }, "node_modules/@opentelemetry/exporter-trace-otlp-http": { - "version": "0.52.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.52.1.tgz", - "integrity": "sha512-05HcNizx0BxcFKKnS5rwOV+2GevLTVIRA0tRgWYyw4yCgR53Ic/xk83toYKts7kbzcI+dswInUg/4s8oyA+tqg==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/exporter-trace-otlp-http/-/exporter-trace-otlp-http-0.53.0.tgz", + "integrity": "sha512-m7F5ZTq+V9mKGWYpX8EnZ7NjoqAU7VemQ1E2HAG+W/u0wpY1x0OmbxAXfGKFHCspdJk8UKlwPGrpcB8nay3P8A==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/otlp-exporter-base": "0.52.1", - "@opentelemetry/otlp-transformer": "0.52.1", - "@opentelemetry/resources": "1.25.1", - "@opentelemetry/sdk-trace-base": "1.25.1" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/otlp-exporter-base": "0.53.0", + "@opentelemetry/otlp-transformer": "0.53.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/sdk-trace-base": "1.26.0" }, "engines": { "node": ">=14" @@ -2319,12 +2319,12 @@ } }, "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", - "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", + "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2334,13 +2334,13 @@ } }, "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/resources": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", - "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", + "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2350,14 +2350,14 @@ } }, "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz", - "integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", + "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/resources": "1.25.1", - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2367,9 +2367,9 @@ } }, "node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", - "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", "dev": true, "engines": { "node": ">=14" @@ -2395,13 +2395,13 @@ } }, "node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.52.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.52.1.tgz", - "integrity": "sha512-z175NXOtX5ihdlshtYBe5RpGeBoTXVCKPPLiQlD6FHvpM4Ch+p2B0yWKYSrBfLH24H9zjJiBdTrtD+hLlfnXEQ==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.53.0.tgz", + "integrity": "sha512-UCWPreGQEhD6FjBaeDuXhiMf6kkBODF0ZQzrk/tuQcaVDJ+dDQ/xhJp192H9yWnKxVpEjFrSSLnpqmX4VwX+eA==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/otlp-transformer": "0.52.1" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/otlp-transformer": "0.53.0" }, "engines": { "node": ">=14" @@ -2411,12 +2411,12 @@ } }, "node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/core": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", - "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", + "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2426,39 +2426,39 @@ } }, "node_modules/@opentelemetry/otlp-exporter-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", - "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", "dev": true, "engines": { "node": ">=14" } }, "node_modules/@opentelemetry/otlp-transformer": { - "version": "0.52.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.52.1.tgz", - "integrity": "sha512-I88uCZSZZtVa0XniRqQWKbjAUm73I8tpEy/uJYPPYw5d7BRdVk0RfTBQw8kSUl01oVWEuqxLDa802222MYyWHg==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-transformer/-/otlp-transformer-0.53.0.tgz", + "integrity": "sha512-rM0sDA9HD8dluwuBxLetUmoqGJKSAbWenwD65KY9iZhUxdBHRLrIdrABfNDP7aiTjcgK8XFyTn5fhDz7N+W6DA==", "dev": true, "dependencies": { - "@opentelemetry/api-logs": "0.52.1", - "@opentelemetry/core": "1.25.1", - "@opentelemetry/resources": "1.25.1", - "@opentelemetry/sdk-logs": "0.52.1", - "@opentelemetry/sdk-metrics": "1.25.1", - "@opentelemetry/sdk-trace-base": "1.25.1", + "@opentelemetry/api-logs": "0.53.0", + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/sdk-logs": "0.53.0", + "@opentelemetry/sdk-metrics": "1.26.0", + "@opentelemetry/sdk-trace-base": "1.26.0", "protobufjs": "^7.3.0" }, "engines": { "node": ">=14" }, "peerDependencies": { - "@opentelemetry/api": ">=1.3.0 <1.10.0" + "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/api-logs": { - "version": "0.52.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.1.tgz", - "integrity": "sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", "dev": true, "dependencies": { "@opentelemetry/api": "^1.0.0" @@ -2468,12 +2468,12 @@ } }, "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/core": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", - "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", + "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2483,13 +2483,13 @@ } }, "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/resources": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", - "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", + "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2499,14 +2499,14 @@ } }, "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz", - "integrity": "sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", + "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/resources": "1.25.1", - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2516,9 +2516,9 @@ } }, "node_modules/@opentelemetry/otlp-transformer/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", - "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", "dev": true, "engines": { "node": ">=14" @@ -2531,9 +2531,9 @@ "dev": true }, "node_modules/@opentelemetry/otlp-transformer/node_modules/protobufjs": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", - "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", + "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -2598,14 +2598,14 @@ } }, "node_modules/@opentelemetry/sdk-logs": { - "version": "0.52.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.52.1.tgz", - "integrity": "sha512-MBYh+WcPPsN8YpRHRmK1Hsca9pVlyyKd4BxOC4SsgHACnl/bPp4Cri9hWhVm5+2tiQ9Zf4qSc1Jshw9tOLGWQA==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-logs/-/sdk-logs-0.53.0.tgz", + "integrity": "sha512-dhSisnEgIj/vJZXZV6f6KcTnyLDx/VuQ6l3ejuZpMpPlh9S1qMHiZU9NMmOkVkwwHkMy3G6mEBwdP23vUZVr4g==", "dev": true, "dependencies": { - "@opentelemetry/api-logs": "0.52.1", - "@opentelemetry/core": "1.25.1", - "@opentelemetry/resources": "1.25.1" + "@opentelemetry/api-logs": "0.53.0", + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0" }, "engines": { "node": ">=14" @@ -2615,9 +2615,9 @@ } }, "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs": { - "version": "0.52.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.52.1.tgz", - "integrity": "sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", "dev": true, "dependencies": { "@opentelemetry/api": "^1.0.0" @@ -2627,12 +2627,12 @@ } }, "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", - "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", + "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2642,13 +2642,13 @@ } }, "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", - "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", + "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2658,23 +2658,22 @@ } }, "node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", - "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", "dev": true, "engines": { "node": ">=14" } }, "node_modules/@opentelemetry/sdk-metrics": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz", - "integrity": "sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz", + "integrity": "sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/resources": "1.25.1", - "lodash.merge": "^4.6.2" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0" }, "engines": { "node": ">=14" @@ -2684,12 +2683,12 @@ } }, "node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/core": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", - "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", + "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2699,13 +2698,13 @@ } }, "node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/resources": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", - "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", + "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", "dev": true, "dependencies": { - "@opentelemetry/core": "1.25.1", - "@opentelemetry/semantic-conventions": "1.25.1" + "@opentelemetry/core": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" }, "engines": { "node": ">=14" @@ -2715,9 +2714,9 @@ } }, "node_modules/@opentelemetry/sdk-metrics/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", - "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", "dev": true, "engines": { "node": ">=14" @@ -3509,24 +3508,6 @@ "integrity": "sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==", "dev": true }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -4173,6 +4154,14 @@ "acorn": "^8" } }, + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "peerDependencies": { + "acorn": "^8" + } + }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -5690,9 +5679,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", - "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -9018,9 +9007,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", @@ -14183,9 +14172,9 @@ } }, "node_modules/svelte": { - "version": "4.2.18", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.18.tgz", - "integrity": "sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==", + "version": "4.2.19", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.19.tgz", + "integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==", "dev": true, "peer": true, "dependencies": { @@ -14954,20 +14943,19 @@ } }, "node_modules/webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", diff --git a/package.json b/package.json index 3d5dfc79..f33181c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.3.2", + "version": "5.4.0", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -40,7 +40,7 @@ "@changesets/cli": "^2.27.1", "@google-cloud/vertexai": "^1.5.0", "@google/generative-ai": "^0.1.3", - "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", + "@opentelemetry/exporter-trace-otlp-http": "^0.53.0", "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", "@typescript-eslint/eslint-plugin": "^5.62.0", diff --git a/src/extensions/langtraceexporter/langtrace_exporter.ts b/src/extensions/langtraceexporter/langtrace_exporter.ts index 22361c47..f11e3905 100644 --- a/src/extensions/langtraceexporter/langtrace_exporter.ts +++ b/src/extensions/langtraceexporter/langtrace_exporter.ts @@ -23,6 +23,7 @@ import axios from 'axios' export class LangTraceExporter implements SpanExporter { private readonly apiKey: string private readonly apiHost: string + private readonly headers: Record /** * @@ -30,9 +31,10 @@ export class LangTraceExporter implements SpanExporter { * @param apiHost The host of the LangTrace API. Default is https://langtrace.ai/api/trace. If set a POST request will be made to this URL with an array of ReadableSpan objects. * See https://github.com/open-telemetry/opentelemetry-js/blob/3c8c29ac8fdd71cd1ef78d2b35c65ced81db16f4/packages/opentelemetry-sdk-trace-base/src/export/ReadableSpan.ts#L29 */ - constructor (apiKey: string, apiHost: string) { + constructor (apiKey: string, apiHost: string, headers?: Record) { this.apiKey = apiKey this.apiHost = apiHost === LANGTRACE_REMOTE_URL ? `${LANGTRACE_REMOTE_URL}/api/trace` : apiHost + this.headers = headers ?? {} } async export (spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): Promise { @@ -65,7 +67,8 @@ export class LangTraceExporter implements SpanExporter { const headers: Record = { 'Content-Type': 'application/json', Accept: 'application/json', - 'User-Agent': 'LangTraceExporter' + 'User-Agent': 'LangTraceExporter', + ...this.headers } if (this.apiKey.length > 0) { headers['x-api-key'] = this.apiKey diff --git a/src/init/init.ts b/src/init/init.ts index 0cc804b8..d588d744 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -94,8 +94,15 @@ export const init: LangTraceInit = ({ resource: new Resource({ 'service.name': process.env.OTEL_SERVICE_NAME ?? service_name ?? __filename ?? 'unknown' }) } ) - const host = (process.env.LANGTRACE_API_HOST ?? api_host ?? LANGTRACE_REMOTE_URL) - const remoteWriteExporter = new LangTraceExporter(api_key ?? process.env.LANGTRACE_API_KEY ?? '', host) + const host = process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? process.env.LANGTRACE_API_HOST ?? api_host ?? LANGTRACE_REMOTE_URL + const otelHttpHeaders = process.env.OTEL_EXPORTER_OTLP_HEADERS?.split(',') + .reduce((acc, header) => { + const [key, value] = header.split('=') + acc[key] = value + return acc + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + }, {} as Record) + const remoteWriteExporter = new LangTraceExporter(api_key ?? process.env.LANGTRACE_API_KEY ?? '', host, otelHttpHeaders) const consoleExporter = new ConsoleSpanExporter() const batchProcessorRemote = new BatchSpanProcessor(remoteWriteExporter) const simpleProcessorRemote = new SimpleSpanProcessor(remoteWriteExporter) From c19922850da670d9ff802744c6181a7d2bd1e7b5 Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Mon, 9 Sep 2024 23:13:54 +0100 Subject: [PATCH 10/25] bump version adn add chat stream method --- package.json | 5 +++-- src/examples/entrypoint.ts | 2 +- src/instrumentation/mistral/instrumentation.ts | 17 ++++++++++++----- src/instrumentation/mistral/patch.ts | 1 - 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 3d5dfc79..fe649322 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.3.2", + "version": "5.4.0", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -21,7 +21,7 @@ "author": "Scale3 Labs", "license": "Apache-2.0", "dependencies": { - "@langtrase/trace-attributes": "7.3.0", + "@langtrase/trace-attributes": "7.4.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -40,6 +40,7 @@ "@changesets/cli": "^2.27.1", "@google-cloud/vertexai": "^1.5.0", "@google/generative-ai": "^0.1.3", + "@mistralai/mistralai": "^1.0.4", "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", diff --git a/src/examples/entrypoint.ts b/src/examples/entrypoint.ts index c432a9b5..5313853d 100644 --- a/src/examples/entrypoint.ts +++ b/src/examples/entrypoint.ts @@ -1,3 +1,3 @@ -import { chatCompletion } from '@langtrace-examples/mistral/basic' +import { chatCompletion } from '@langtrace-examples/mistral/chat-complete' void chatCompletion() diff --git a/src/instrumentation/mistral/instrumentation.ts b/src/instrumentation/mistral/instrumentation.ts index d17df481..03b270e3 100644 --- a/src/instrumentation/mistral/instrumentation.ts +++ b/src/instrumentation/mistral/instrumentation.ts @@ -67,6 +67,14 @@ class MistralInstrumentation extends InstrumentationBase { } ) + this._wrap( + mistral.Mistral.prototype.chat, + 'stream', + (originalMethod: (...args: any[]) => any) => { + return chatComplete(originalMethod, this.tracer, this.instrumentationVersion, moduleVersion, true) + } + ) + this._wrap( mistral.Mistral.prototype.embeddings, 'create', @@ -75,11 +83,10 @@ class MistralInstrumentation extends InstrumentationBase { ) } - private _unpatch (openai: any): void { - this._unwrap(openai.OpenAI.Chat.Completions.prototype, 'create') - this._unwrap(openai.OpenAI.Images.prototype, 'generate') - this._unwrap(openai.OpenAI.Images.prototype, 'edit') - this._unwrap(openai.OpenAI.Embeddings.prototype, 'create') + private _unpatch (mistral: any): void { + this._unwrap(mistral.Mistral.prototype.chat, 'complete') + this._unwrap(mistral.Mistral.prototype.chat, 'stream') + this._unwrap(mistral.Mistral.prototype.embeddings, 'create') } } diff --git a/src/instrumentation/mistral/patch.ts b/src/instrumentation/mistral/patch.ts index b38357c8..ecbf8d1d 100644 --- a/src/instrumentation/mistral/patch.ts +++ b/src/instrumentation/mistral/patch.ts @@ -76,7 +76,6 @@ export function chatComplete ( trace.setSpan(context.active(), span), async () => { try { - // eslint-disable-next-line no-console const resp = await originalMethod.apply(this, args) const responses = resp?.choices?.map((choice: any) => { const result = { From 50aaca4c1c17dbdb9e5510259a22d49ba155bd04 Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Mon, 9 Sep 2024 23:14:11 +0100 Subject: [PATCH 11/25] add examples --- src/examples/mistral/chat-complete.ts | 18 ++++++++++++++++++ src/examples/mistral/chat-stream.ts | 19 +++++++++++++++++++ src/examples/mistral/embeddings.ts | 18 ++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 src/examples/mistral/chat-complete.ts create mode 100644 src/examples/mistral/chat-stream.ts create mode 100644 src/examples/mistral/embeddings.ts diff --git a/src/examples/mistral/chat-complete.ts b/src/examples/mistral/chat-complete.ts new file mode 100644 index 00000000..51f3b319 --- /dev/null +++ b/src/examples/mistral/chat-complete.ts @@ -0,0 +1,18 @@ +import { init } from '@langtrace-init/init' +import { Mistral } from '@mistralai/mistralai' + +init({ write_spans_to_console: false, batch: false }) + +export async function chatCompletion (): Promise { + const client = new Mistral() + + const response = await client.chat.complete({ + model: 'mistral-tiny', + messages: [ + { role: 'user', content: 'What are the best French cheeses?' } + ], + stream: false + }) + + console.info(response) +} diff --git a/src/examples/mistral/chat-stream.ts b/src/examples/mistral/chat-stream.ts new file mode 100644 index 00000000..88587bdf --- /dev/null +++ b/src/examples/mistral/chat-stream.ts @@ -0,0 +1,19 @@ +import { init } from '@langtrace-init/init' +import { Mistral } from '@mistralai/mistralai' + +init({ write_spans_to_console: false, batch: false }) + +const client = new Mistral() + +export async function chatStream (): Promise { + const stream = await client.chat.stream({ + model: 'mistral-tiny', + messages: [{ role: 'user', content: 'What is the best French cheese?' }] + }) + for await (const chunk of stream) { + if (chunk.data.choices[0].delta.content !== undefined) { + const streamText = chunk.data.choices[0].delta.content + console.log(streamText) + } + } +} diff --git a/src/examples/mistral/embeddings.ts b/src/examples/mistral/embeddings.ts new file mode 100644 index 00000000..2990075d --- /dev/null +++ b/src/examples/mistral/embeddings.ts @@ -0,0 +1,18 @@ +import { init } from '@langtrace-init/init' +import { withLangTraceRootSpan } from '@langtrace-utils/instrumentation' +import { Mistral } from '@mistralai/mistralai' + +init({ write_spans_to_console: false, batch: false }) + +const client = new Mistral() + +export async function embedText (): Promise { + await withLangTraceRootSpan(async () => { + const embedding = await client.embeddings.create({ + model: 'mistral-embed', + inputs: 'What is the best French cheese?' + }) + console.log('Embedding:', embedding.data[0].embedding) + return embedding + }) +} From b306de0ea9db5298d8865d2af1597e3f44c17b30 Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Mon, 9 Sep 2024 23:18:44 +0100 Subject: [PATCH 12/25] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4fe35e6a..722643d4 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ Langtrace automatically captures traces from the following vendors: | Groq | LLM | :x: | :white_check_mark: | | Perplexity | LLM | :white_check_mark: | :white_check_mark: | | Gemini | LLM | :white_check_mark: | :white_check_mark: | -| Mistral | LLM | :x: | :white_check_mark: | +| Mistral | LLM | :white_check_mark: | :white_check_mark: | | Langchain | Framework | :x: | :white_check_mark: | | LlamaIndex | Framework | :white_check_mark: | :white_check_mark: | | Langgraph | Framework | :x: | :white_check_mark: | From db582f7f1d77b1126cc69cebf072ca5c2dc4214c Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Tue, 10 Sep 2024 18:22:15 +0100 Subject: [PATCH 13/25] update package-lock --- package-lock.json | 54 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index c06cdf84..80b9312d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.3.2", + "version": "5.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/typescript-sdk", - "version": "5.3.2", + "version": "5.4.0", "license": "Apache-2.0", "dependencies": { - "@langtrase/trace-attributes": "7.3.0", + "@langtrase/trace-attributes": "7.4.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -28,6 +28,7 @@ "@changesets/cli": "^2.27.1", "@google-cloud/vertexai": "^1.5.0", "@google/generative-ai": "^0.1.3", + "@mistralai/mistralai": "^1.0.4", "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", @@ -2100,9 +2101,9 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" }, "node_modules/@langtrase/trace-attributes": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.3.0.tgz", - "integrity": "sha512-AbBwRT/0RZ36sNZZRLWgV7ELLz537dyO99Uj8m0Nm2ToH58LYLa+ESYaBVv9x7Wro28yUlu/yOi4ZwXjI2L9Qg==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.4.0.tgz", + "integrity": "sha512-LmaUGdr03ouh/08nQkBz01W6BLGUyw6V99z2f9CHJKrq1X+VU+aXzEuiW6goEmwWFxrn7LRhEOo5l2j0CAYD2w==", "license": "MIT", "dependencies": { "js-tiktoken": "^1.0.14", @@ -2190,12 +2191,12 @@ } }, "node_modules/@mistralai/mistralai": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-0.0.10.tgz", - "integrity": "sha512-fZOt7A32DcPSff58wTa44pKUBoJBH5toAuzNI9yoM7s5NjTupa1IYcSqqk2LigO8M5EtOEkFsD/XzdyWPnhaRA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-1.0.4.tgz", + "integrity": "sha512-fLFBD8r4KvITCkKlKcq2ievnNyLd7Oob4xMY7MkY04BqR4nffkTS49DqapnVkemuldtrmHidwPzwD7UT+yFC4A==", "dev": true, - "dependencies": { - "node-fetch": "^2.6.7" + "peerDependencies": { + "zod": ">= 3" } }, "node_modules/@mongodb-js/saslprep": { @@ -8652,6 +8653,37 @@ "undici-types": "~5.26.4" } }, + "node_modules/llamaindex/node_modules/@mistralai/mistralai": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-0.0.10.tgz", + "integrity": "sha512-fZOt7A32DcPSff58wTa44pKUBoJBH5toAuzNI9yoM7s5NjTupa1IYcSqqk2LigO8M5EtOEkFsD/XzdyWPnhaRA==", + "dev": true, + "license": "ISC", + "dependencies": { + "node-fetch": "^2.6.7" + } + }, + "node_modules/llamaindex/node_modules/@mistralai/mistralai/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/llamaindex/node_modules/chromadb": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/chromadb/-/chromadb-1.7.3.tgz", From a40f9cc92e083cb592bb0d21ffdf6c3cc773b63e Mon Sep 17 00:00:00 2001 From: Rohit Kadhe Date: Tue, 10 Sep 2024 15:06:17 -0600 Subject: [PATCH 14/25] Add sentry integration --- README.md | 4 + package-lock.json | 1637 ++++++++++++++++++++++++++++++-- package.json | 2 + src/constants/common.ts | 1 + src/examples/pinecone/basic.ts | 2 +- src/init/init.ts | 18 + 6 files changed, 1604 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 4fe35e6a..4b6bc8d8 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ import * as Langtrace from '@langtrase/typescript-sdk' // Must precede any llm m Langtrace.init({ custom_remote_exporter: , batch:}) ``` +### Error Reporting to Langtrace + +By default all sdk errors are reported to langtrace via Sentry. This can be disabled by setting the following enviroment variable to `False` like so `LANGTRACE_ERROR_REPORTING=False` + ## Additional Customization - [withLangTraceRootSpan](https://docs.langtrace.ai/features/grouptraces) - this function is designed to organize and relate different spans, in a hierarchical manner. When you're performing multiple operations that you want to monitor together as a unit, this function helps by establishing a "parent" (`LangtraceRootSpan` or whatever is passed to `name`) span. Then, any calls to the LLM APIs made within the given function (fn) will be considered "children" of this parent span. This setup is especially useful for tracking the performance or behavior of a group of operations collectively, rather than individually. See [example](https://docs.langtrace.ai/features/grouptraces) diff --git a/package-lock.json b/package-lock.json index c06cdf84..19f37f8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,8 @@ "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", "@opentelemetry/sdk-trace-node": "^1.22.0", + "@sentry/node": "^8.30.0", + "@sentry/profiling-node": "^8.30.0", "@types/webpack": "^5.28.5", "ansi-colors": "^4.1.3", "axios": "^1.6.7", @@ -2394,6 +2396,1279 @@ "@opentelemetry/api": "^1.3.0" } }, + "node_modules/@opentelemetry/instrumentation-connect": { + "version": "0.39.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.39.0.tgz", + "integrity": "sha512-pGBiKevLq7NNglMgqzmeKczF4XQMTOUOTkK8afRHMZMnrK3fcETyTH7lVaSozwiOM3Ws+SuEmXZT7DYrrhxGlg==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0", + "@types/connect": "3.4.36" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-connect/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-connect/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-connect/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-connect/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-express": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.42.0.tgz", + "integrity": "sha512-YNcy7ZfGnLsVEqGXQPT+S0G1AE46N21ORY7i7yUQyfhGAL4RBjnZUqefMI0NwqIl6nGbr1IpF0rZGoN8Q7x12Q==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-express/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-express/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-express/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-express/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-fastify": { + "version": "0.39.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.39.0.tgz", + "integrity": "sha512-SS9uSlKcsWZabhBp2szErkeuuBDgxOUlllwkS92dVaWRnMmwysPhcEgHKB8rUe3BHg/GnZC1eo1hbTZv4YhfoA==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-fastify/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-fastify/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-fastify/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-fastify/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-fs": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.15.0.tgz", + "integrity": "sha512-JWVKdNLpu1skqZQA//jKOcKdJC66TWKqa2FUFq70rKohvaSq47pmXlnabNO+B/BvLfmidfiaN35XakT5RyMl2Q==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.53.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-fs/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-fs/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-fs/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-generic-pool": { + "version": "0.39.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.39.0.tgz", + "integrity": "sha512-y4v8Y+tSfRB3NNBvHjbjrn7rX/7sdARG7FuK6zR8PGb28CTa0kHpEGCJqvL9L8xkTNvTXo+lM36ajFGUaK1aNw==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-generic-pool/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-generic-pool/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-generic-pool/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-graphql": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.43.0.tgz", + "integrity": "sha512-aI3YMmC2McGd8KW5du1a2gBA0iOMOGLqg4s9YjzwbjFwjlmMNFSK1P3AIg374GWg823RPUGfVTIgZ/juk9CVOA==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-graphql/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-graphql/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-graphql/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi": { + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.41.0.tgz", + "integrity": "sha512-jKDrxPNXDByPlYcMdZjNPYCvw0SQJjN+B1A+QH+sx+sAHsKSAf9hwFiJSrI6C4XdOls43V/f/fkp9ITkHhKFbQ==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-hapi/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-http": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.53.0.tgz", + "integrity": "sha512-H74ErMeDuZfj7KgYCTOFGWF5W9AfaPnqLQQxeFq85+D29wwV2yqHbz2IKLYpkOh7EI6QwDEl7rZCIxjJLyc/CQ==", + "dependencies": { + "@opentelemetry/core": "1.26.0", + "@opentelemetry/instrumentation": "0.53.0", + "@opentelemetry/semantic-conventions": "1.27.0", + "semver": "^7.5.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/core": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", + "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-http/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.43.0.tgz", + "integrity": "sha512-i3Dke/LdhZbiUAEImmRG3i7Dimm/BD7t8pDDzwepSvIQ6s2X6FPia7561gw+64w+nx0+G9X14D7rEfaMEmmjig==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-ioredis/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-kafkajs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.3.0.tgz", + "integrity": "sha512-UnkZueYK1ise8FXQeKlpBd7YYUtC7mM8J0wzUSccEfc/G8UqHQqAzIyYCUOUPUKp8GsjLnWOOK/3hJc4owb7Jg==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-kafkajs/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-kafkajs/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-kafkajs/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-kafkajs/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-koa": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.43.0.tgz", + "integrity": "sha512-lDAhSnmoTIN6ELKmLJBplXzT/Jqs5jGZehuG22EdSMaTwgjMpxMDI1YtlKEhiWPWkrz5LUsd0aOO0ZRc9vn3AQ==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-koa/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-koa/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-koa/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-koa/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb": { + "version": "0.47.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.47.0.tgz", + "integrity": "sha512-yqyXRx2SulEURjgOQyJzhCECSh5i1uM49NUaq9TqLd6fA7g26OahyJfsr9NE38HFqGRHpi4loyrnfYGdrsoVjQ==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/sdk-metrics": "^1.9.1", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-mongodb/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.42.0.tgz", + "integrity": "sha512-AnWv+RaR86uG3qNEMwt3plKX1ueRM7AspfszJYVkvkehiicC3bHQA6vWdb6Zvy5HAE14RyFbu9+2hUUjR2NSyg==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-mongoose/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql": { + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.41.0.tgz", + "integrity": "sha512-jnvrV6BsQWyHS2qb2fkfbfSb1R/lmYwqEZITwufuRl37apTopswu9izc0b1CYRp/34tUG/4k/V39PND6eyiNvw==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0", + "@types/mysql": "2.15.26" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2": { + "version": "0.41.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.41.0.tgz", + "integrity": "sha512-REQB0x+IzVTpoNgVmy5b+UnH1/mDByrneimP6sbDHkp1j8QOl1HyWOrBH/6YWR0nrbU3l825Em5PlybjT3232g==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0", + "@opentelemetry/sql-common": "^0.40.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-mysql2/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-nestjs-core": { + "version": "0.40.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.40.0.tgz", + "integrity": "sha512-WF1hCUed07vKmf5BzEkL0wSPinqJgH7kGzOjjMAiTGacofNXjb/y4KQ8loj2sNsh5C/NN7s1zxQuCgbWbVTGKg==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-nestjs-core/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-nestjs-core/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-nestjs-core/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-nestjs-core/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-pg": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.44.0.tgz", + "integrity": "sha512-oTWVyzKqXud1BYEGX1loo2o4k4vaU1elr3vPO8NZolrBtFvQ34nx4HgUaexUDuEog00qQt+MLR5gws/p+JXMLQ==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/semantic-conventions": "^1.27.0", + "@opentelemetry/sql-common": "^0.40.1", + "@types/pg": "8.6.1", + "@types/pg-pool": "2.0.6" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/@types/pg": { + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz", + "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==", + "dependencies": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^2.2.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@opentelemetry/instrumentation-pg/node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@opentelemetry/instrumentation-redis-4": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.42.0.tgz", + "integrity": "sha512-NaD+t2JNcOzX/Qa7kMy68JbmoVIV37fT/fJYzLKu2Wwd+0NCxt+K2OOsOakA8GVg8lSpFdbx4V/suzZZ2Pvdjg==", + "dependencies": { + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/semantic-conventions": "^1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-redis-4/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-redis-4/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-redis-4/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-redis-4/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@opentelemetry/instrumentation-undici": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.6.0.tgz", + "integrity": "sha512-ABJBhm5OdhGmbh0S/fOTE4N69IZ00CsHC5ijMYfzbw3E5NwLgpQk5xsljaECrJ8wz1SfXbO03FiSuu5AyRAkvQ==", + "dependencies": { + "@opentelemetry/core": "^1.8.0", + "@opentelemetry/instrumentation": "^0.53.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.7.0" + } + }, + "node_modules/@opentelemetry/instrumentation-undici/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@opentelemetry/instrumentation-undici/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@opentelemetry/instrumentation-undici/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, "node_modules/@opentelemetry/otlp-exporter-base": { "version": "0.52.1", "resolved": "https://registry.npmjs.org/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.52.1.tgz", @@ -2582,6 +3857,14 @@ "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, + "node_modules/@opentelemetry/redis-common": { + "version": "0.36.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz", + "integrity": "sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==", + "engines": { + "node": ">=14" + } + }, "node_modules/@opentelemetry/resources": { "version": "1.25.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.0.tgz", @@ -2670,7 +3953,6 @@ "version": "1.25.1", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz", "integrity": "sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q==", - "dev": true, "dependencies": { "@opentelemetry/core": "1.25.1", "@opentelemetry/resources": "1.25.1", @@ -2687,7 +3969,6 @@ "version": "1.25.1", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.25.1.tgz", "integrity": "sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ==", - "dev": true, "dependencies": { "@opentelemetry/semantic-conventions": "1.25.1" }, @@ -2702,7 +3983,6 @@ "version": "1.25.1", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.25.1.tgz", "integrity": "sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ==", - "dev": true, "dependencies": { "@opentelemetry/core": "1.25.1", "@opentelemetry/semantic-conventions": "1.25.1" @@ -2718,7 +3998,6 @@ "version": "1.25.1", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz", "integrity": "sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ==", - "dev": true, "engines": { "node": ">=14" } @@ -2766,6 +4045,20 @@ "node": ">=14" } }, + "node_modules/@opentelemetry/sql-common": { + "version": "0.40.1", + "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz", + "integrity": "sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==", + "dependencies": { + "@opentelemetry/core": "^1.1.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0" + } + }, "node_modules/@pinecone-database/pinecone": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/@pinecone-database/pinecone/-/pinecone-2.2.2.tgz", @@ -2790,6 +4083,16 @@ "node": ">=14" } }, + "node_modules/@prisma/instrumentation": { + "version": "5.19.1", + "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-5.19.1.tgz", + "integrity": "sha512-VLnzMQq7CWroL5AeaW0Py2huiNKeoMfCH3SUxstdzPrlWQi6UQ9UrfcbUkNHlVFqOMacqy8X/8YtE0kuKDpD9w==", + "dependencies": { + "@opentelemetry/api": "^1.8", + "@opentelemetry/instrumentation": "^0.49 || ^0.50 || ^0.51 || ^0.52.0", + "@opentelemetry/sdk-trace-base": "^1.22" + } + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -2882,6 +4185,224 @@ "pnpm": ">=8" } }, + "node_modules/@sentry/core": { + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.30.0.tgz", + "integrity": "sha512-CJ/FuWLw0QEKGKXGL/nm9eaOdajEcmPekLuHAuOCxID7N07R9l9laz3vFbAkUZ97GGDv3sYrJZgywfY3Moropg==", + "dependencies": { + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/node": { + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-8.30.0.tgz", + "integrity": "sha512-Tog0Ag7sU3lNj4cPUZy1KRJXyYXZlWiwlk34KYNNxAk0vDiK6W0bF8mvS+aaUukgb7FO5A0eu9l+VApdBJOr3Q==", + "dependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/context-async-hooks": "^1.25.1", + "@opentelemetry/core": "^1.25.1", + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/instrumentation-connect": "0.39.0", + "@opentelemetry/instrumentation-express": "0.42.0", + "@opentelemetry/instrumentation-fastify": "0.39.0", + "@opentelemetry/instrumentation-fs": "0.15.0", + "@opentelemetry/instrumentation-generic-pool": "0.39.0", + "@opentelemetry/instrumentation-graphql": "0.43.0", + "@opentelemetry/instrumentation-hapi": "0.41.0", + "@opentelemetry/instrumentation-http": "0.53.0", + "@opentelemetry/instrumentation-ioredis": "0.43.0", + "@opentelemetry/instrumentation-kafkajs": "0.3.0", + "@opentelemetry/instrumentation-koa": "0.43.0", + "@opentelemetry/instrumentation-mongodb": "0.47.0", + "@opentelemetry/instrumentation-mongoose": "0.42.0", + "@opentelemetry/instrumentation-mysql": "0.41.0", + "@opentelemetry/instrumentation-mysql2": "0.41.0", + "@opentelemetry/instrumentation-nestjs-core": "0.40.0", + "@opentelemetry/instrumentation-pg": "0.44.0", + "@opentelemetry/instrumentation-redis-4": "0.42.0", + "@opentelemetry/instrumentation-undici": "0.6.0", + "@opentelemetry/resources": "^1.26.0", + "@opentelemetry/sdk-trace-base": "^1.26.0", + "@opentelemetry/semantic-conventions": "^1.27.0", + "@prisma/instrumentation": "5.19.1", + "@sentry/core": "8.30.0", + "@sentry/opentelemetry": "8.30.0", + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0", + "import-in-the-middle": "^1.11.0" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/node/node_modules/@opentelemetry/api-logs": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", + "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "dependencies": { + "@opentelemetry/api": "^1.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sentry/node/node_modules/@opentelemetry/context-async-hooks": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.26.0.tgz", + "integrity": "sha512-HedpXXYzzbaoutw6DFLWLDket2FwLkLpil4hGCZ1xYEIMTcivdfwEOISgdbLEWyG3HW52gTq2V9mOVJrONgiwg==", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@sentry/node/node_modules/@opentelemetry/core": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", + "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", + "dependencies": { + "@opentelemetry/semantic-conventions": "1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@sentry/node/node_modules/@opentelemetry/instrumentation": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", + "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "dependencies": { + "@opentelemetry/api-logs": "0.53.0", + "@types/shimmer": "^1.2.0", + "import-in-the-middle": "^1.8.1", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.2", + "shimmer": "^1.2.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" + } + }, + "node_modules/@sentry/node/node_modules/@opentelemetry/resources": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", + "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", + "dependencies": { + "@opentelemetry/core": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@sentry/node/node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz", + "integrity": "sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==", + "dependencies": { + "@opentelemetry/core": "1.26.0", + "@opentelemetry/resources": "1.26.0", + "@opentelemetry/semantic-conventions": "1.27.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.10.0" + } + }, + "node_modules/@sentry/node/node_modules/@opentelemetry/semantic-conventions": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", + "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@sentry/node/node_modules/@sentry/opentelemetry": { + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-8.30.0.tgz", + "integrity": "sha512-6mCIP2zvxAiEsNEoF8kv+UUD4XGWSKJU6RY5BF1U26HLitXv1fNPtzaTR96Ehv9h0zktjLfqfpVUZ7DGkdBvLA==", + "dependencies": { + "@sentry/core": "8.30.0", + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0" + }, + "engines": { + "node": ">=14.18" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/core": "^1.25.1", + "@opentelemetry/instrumentation": "^0.53.0", + "@opentelemetry/sdk-trace-base": "^1.26.0", + "@opentelemetry/semantic-conventions": "^1.27.0" + } + }, + "node_modules/@sentry/node/node_modules/import-in-the-middle": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.11.0.tgz", + "integrity": "sha512-5DimNQGoe0pLUHbR9qK84iWaWjjbsxiqXnw6Qz64+azRgleqv9k2kTt5fw7QsOpmaGYtuxxursnPPsnTKEx10Q==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-attributes": "^1.9.5", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" + } + }, + "node_modules/@sentry/profiling-node": { + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/profiling-node/-/profiling-node-8.30.0.tgz", + "integrity": "sha512-HKjIjHRtgEpUjO8LXadWEA/G8fwZ4Ej/KVfUK3tdZYimY6ISwzLQj/PFIoROOdqqWEw5z1mcF89AgIhGoKaH+Q==", + "hasInstallScript": true, + "dependencies": { + "@sentry/core": "8.30.0", + "@sentry/node": "8.30.0", + "@sentry/types": "8.30.0", + "@sentry/utils": "8.30.0", + "detect-libc": "^2.0.2", + "node-abi": "^3.61.0" + }, + "bin": { + "sentry-prune-profiler-binaries": "scripts/prune-profiler-binaries.js" + }, + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/types": { + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.30.0.tgz", + "integrity": "sha512-kgWW2BCjBmVlSQRG32GonHEVyeDbys74xf9mLPvynwHTgw3+NUlNAlEdu05xnb2ow4bCTHfbkS5G1zRgyv5k4Q==", + "engines": { + "node": ">=14.18" + } + }, + "node_modules/@sentry/utils": { + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.30.0.tgz", + "integrity": "sha512-wZxU2HWlzsnu8214Xy7S7cRIuD6h8Z5DnnkojJfX0i0NLooepZQk2824el1Q13AakLb7/S8CHSHXOMnCtoSduw==", + "dependencies": { + "@sentry/types": "8.30.0" + }, + "engines": { + "node": ">=14.18" + } + }, "node_modules/@sevinf/maybe": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@sevinf/maybe/-/maybe-0.5.0.tgz", @@ -3503,30 +5024,20 @@ "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", "dev": true }, + "node_modules/@types/connect": { + "version": "3.4.36", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", + "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/diff-match-patch": { "version": "1.0.36", "resolved": "https://registry.npmjs.org/@types/diff-match-patch/-/diff-match-patch-1.0.36.tgz", "integrity": "sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==", "dev": true }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -3569,6 +5080,14 @@ "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==", "dev": true }, + "node_modules/@types/mysql": { + "version": "2.15.26", + "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.26.tgz", + "integrity": "sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "18.19.34", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.34.tgz", @@ -3606,13 +5125,20 @@ "version": "8.11.6", "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.11.6.tgz", "integrity": "sha512-/2WmmBXHLsfRqzfHW7BNZ8SbYzE8OSk7i3WjFYvfgRHj7S1xj+16Je5fUKv3lVdVzk/zn9TXOqf+avFCFIE0yQ==", - "dev": true, "dependencies": { "@types/node": "*", "pg-protocol": "*", "pg-types": "^4.0.1" } }, + "node_modules/@types/pg-pool": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.6.tgz", + "integrity": "sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ==", + "dependencies": { + "@types/pg": "*" + } + }, "node_modules/@types/qs": { "version": "6.9.15", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", @@ -3626,9 +5152,9 @@ "dev": true }, "node_modules/@types/shimmer": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.0.5.tgz", - "integrity": "sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz", + "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==" }, "node_modules/@types/triple-beam": { "version": "1.3.5", @@ -4173,6 +5699,14 @@ "acorn": "^8" } }, + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "peerDependencies": { + "acorn": "^8" + } + }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", @@ -5560,7 +7094,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", - "dev": true, "engines": { "node": ">=8" } @@ -5690,9 +7223,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", - "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -8798,8 +10331,7 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "node_modules/lodash.startcase": { "version": "4.4.0", @@ -9018,9 +10550,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", @@ -9289,7 +10821,6 @@ "version": "3.63.0", "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.63.0.tgz", "integrity": "sha512-vAszCsOUrUxjGAmdnM/pq7gUgie0IRteCQMX6d4A534fQCR93EJU5qgzBvU6EkFfK27s0T3HEV3BOyJIr7OMYw==", - "dev": true, "dependencies": { "semver": "^7.3.5" }, @@ -11880,8 +13411,7 @@ "node_modules/obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", - "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", - "dev": true + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==" }, "node_modules/ollama": { "version": "0.5.2", @@ -12278,7 +13808,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "dev": true, "engines": { "node": ">=4.0.0" } @@ -12287,7 +13816,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz", "integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==", - "dev": true, "engines": { "node": ">=4" } @@ -12304,14 +13832,12 @@ "node_modules/pg-protocol": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.1.tgz", - "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==", - "dev": true + "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==" }, "node_modules/pg-types": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.2.tgz", "integrity": "sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==", - "dev": true, "dependencies": { "pg-int8": "1.0.1", "pg-numeric": "1.0.2", @@ -12524,7 +14050,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz", "integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==", - "dev": true, "engines": { "node": ">=12" } @@ -12533,7 +14058,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz", "integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==", - "dev": true, "dependencies": { "obuf": "~1.1.2" }, @@ -12545,7 +14069,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.1.0.tgz", "integrity": "sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==", - "dev": true, "engines": { "node": ">=12" } @@ -12554,7 +14077,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz", "integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==", - "dev": true, "engines": { "node": ">=12" } @@ -12562,8 +14084,7 @@ "node_modules/postgres-range": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.4.tgz", - "integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==", - "dev": true + "integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==" }, "node_modules/prebuild-install": { "version": "7.1.2", @@ -14183,9 +15704,9 @@ } }, "node_modules/svelte": { - "version": "4.2.18", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.18.tgz", - "integrity": "sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==", + "version": "4.2.19", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.19.tgz", + "integrity": "sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==", "dev": true, "peer": true, "dependencies": { @@ -14954,20 +16475,19 @@ } }, "node_modules/webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -15310,7 +16830,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, "engines": { "node": ">=0.4" } diff --git a/package.json b/package.json index 3d5dfc79..0ae7ecdf 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,8 @@ "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", "@opentelemetry/sdk-trace-node": "^1.22.0", + "@sentry/node": "^8.30.0", + "@sentry/profiling-node": "^8.30.0", "@types/webpack": "^5.28.5", "ansi-colors": "^4.1.3", "axios": "^1.6.7", diff --git a/src/constants/common.ts b/src/constants/common.ts index 8c2d6af4..9c09dd65 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -15,3 +15,4 @@ */ export const LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY = Symbol('langtrace_additional_attributes') +export const SENTRY_DSN = 'https://ab324a1e261bf0585dfebb7f8b902800@o1419498.ingest.us.sentry.io/4507929994395648' diff --git a/src/examples/pinecone/basic.ts b/src/examples/pinecone/basic.ts index b7a70b66..045183c9 100644 --- a/src/examples/pinecone/basic.ts +++ b/src/examples/pinecone/basic.ts @@ -5,10 +5,10 @@ import dotenv from 'dotenv' import OpenAI from 'openai' import { withLangTraceRootSpan } from '@langtrace-utils/instrumentation' dotenv.config() +init({ batch: false, write_spans_to_console: false, disable_instrumentations: { all_except: ['openai', 'pinecone'] } }) const pc = new Pinecone() const openai = new OpenAI() -init({ batch: false, write_spans_to_console: false, disable_instrumentations: { all_except: ['openai', 'pinecone'] } }) export async function basic (): Promise { await withLangTraceRootSpan(async () => { diff --git a/src/init/init.ts b/src/init/init.ts index 0cc804b8..020f65b5 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -41,6 +41,9 @@ import { Vendor } from '@langtrase/trace-attributes' import { vercelAIInstrumentation } from '@langtrace-instrumentation/vercel/instrumentation' import { DropAttributesProcessor } from '@langtrace-extensions/spanprocessors/DropAttributesProcessor' import { vertexAIInstrumentation } from '@langtrace-instrumentation/vertexai/instrumentation' +import * as Sentry from '@sentry/node' +import { SENTRY_DSN } from '@langtrace-constants/common' +import { nodeProfilingIntegration } from '@sentry/profiling-node' /** * Initializes the LangTrace sdk with custom options. @@ -194,6 +197,21 @@ export const init: LangTraceInit = ({ registerInstrumentations({ tracerProvider: provider }) disableInstrumentations(disable_instrumentations, allInstrumentations, instrumentations) } + const enableErrorReporting = process.env.LANGTRACE_ERROR_REPORTING ?? 'True' + if (enableErrorReporting === 'True') { + Sentry.init({ + dsn: SENTRY_DSN, + tracesSampleRate: 1.0, + profilesSampleRate: 1.0, + skipOpenTelemetrySetup: true, + integrations: [nodeProfilingIntegration()] + }) + const context = Object.entries(initOptions).reduce>((acc, [key, value]) => { + acc[key] = JSON.stringify(value) + return acc + }, {}) + Sentry.setContext('sdk_init_options', context) + } global.langtrace_initalized = true global.langtrace_options = initOptions From d211714d84f5bc435ff3c7d1ecf2625c2f703acb Mon Sep 17 00:00:00 2001 From: Rohit Kadhe Date: Fri, 13 Sep 2024 09:26:32 -0600 Subject: [PATCH 15/25] merge with dev --- package.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/package.json b/package.json index 462ab6ba..344cefda 100644 --- a/package.json +++ b/package.json @@ -42,12 +42,7 @@ "@changesets/cli": "^2.27.1", "@google-cloud/vertexai": "^1.5.0", "@google/generative-ai": "^0.1.3", -<<<<<<< HEAD "@opentelemetry/exporter-trace-otlp-http": "^0.53.0", -======= - "@mistralai/mistralai": "^1.0.4", - "@opentelemetry/exporter-trace-otlp-http": "^0.52.1", ->>>>>>> 2f3e4ba8659186d97b6605657d4415f716df4361 "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", "@typescript-eslint/eslint-plugin": "^5.62.0", @@ -70,4 +65,4 @@ "typescript": "^4.9.5", "weaviate-ts-client": "^2.2.0" } -} +} \ No newline at end of file From 9c1e2d00a6aa563bac1c76071cf1dc9973597757 Mon Sep 17 00:00:00 2001 From: Rohit Kadhe Date: Tue, 17 Sep 2024 13:12:23 -0600 Subject: [PATCH 16/25] llama index enhacements --- package-lock.json | 288 +++++++++++++++--- package.json | 8 +- src/examples/entrypoint.ts | 4 +- src/examples/llamaindex/basic.ts | 106 +++++-- .../llamaindex/instrumentation.ts | 159 +++------- src/instrumentation/llamaindex/patch.ts | 77 ++--- 6 files changed, 394 insertions(+), 248 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3916115..3aed652c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,8 +20,7 @@ "ansi-colors": "^4.1.3", "axios": "^1.6.7", "js-tiktoken": "^1.0.14", - "node-loader": "^2.0.0", - "npm": "^10.8.2" + "node-loader": "^2.0.0" }, "devDependencies": { "@ai-sdk/anthropic": "^0.0.41", @@ -30,6 +29,7 @@ "@changesets/cli": "^2.27.1", "@google-cloud/vertexai": "^1.5.0", "@google/generative-ai": "^0.1.3", + "@mistralai/mistralai": "^1.0.4", "@opentelemetry/exporter-trace-otlp-http": "^0.53.0", "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", @@ -45,7 +45,9 @@ "eslint-plugin-promise": "^6.0.1", "eslint-plugin-unused-imports": "^2.0.0", "groq-sdk": "^0.3.3", + "i": "^0.3.7", "llamaindex": "^0.1.21", + "npm": "^10.8.3", "ollama": "^0.5.2", "openai": "^4.47.1", "pgvector": "^0.1.8", @@ -3953,7 +3955,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-metrics/-/sdk-metrics-1.26.0.tgz", "integrity": "sha512-0SvDXmou/JjzSDOjUmetAAvcKQW6ZrvosU0rkbDGpXvvZN+pQF6JbK/Kd4hNdK4q/22yeruqvukXEJyySTzyTQ==", - "dev": true, "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/resources": "1.26.0" @@ -3969,7 +3970,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.26.0.tgz", "integrity": "sha512-1iKxXXE8415Cdv0yjG3G6hQnB5eVEsJce3QaawX8SjDn0mAS0ZM8fAbZZJD4ajvhC15cePvosSCut404KrIIvQ==", - "dev": true, "dependencies": { "@opentelemetry/semantic-conventions": "1.27.0" }, @@ -3984,7 +3984,6 @@ "version": "1.26.0", "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.26.0.tgz", "integrity": "sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==", - "dev": true, "dependencies": { "@opentelemetry/core": "1.26.0", "@opentelemetry/semantic-conventions": "1.27.0" @@ -4000,7 +3999,6 @@ "version": "1.27.0", "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "dev": true, "engines": { "node": ">=14" } @@ -9185,6 +9183,15 @@ "ms": "^2.0.0" } }, + "node_modules/i": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.7.tgz", + "integrity": "sha512-FYz4wlXgkQwIPqhzC5TdNMLSE5+GS1IIDJZY/1ZiEPCT2S3COUVZeT5OW4BmW4r5LHLQuOosSwsvnroG9GR59Q==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -10365,7 +10372,8 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true }, "node_modules/lodash.startcase": { "version": "4.4.0", @@ -10992,9 +11000,9 @@ } }, "node_modules/npm": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/npm/-/npm-10.8.2.tgz", - "integrity": "sha512-x/AIjFIKRllrhcb48dqUNAAZl0ig9+qMuN91RpZo3Cb2+zuibfh+KISl6+kVVyktDz230JKc208UkQwwMqyB+w==", + "version": "10.8.3", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.8.3.tgz", + "integrity": "sha512-0IQlyAYvVtQ7uOhDFYZCGK8kkut2nh8cpAdA9E6FvRSJaTgtZRZgNjlC5ZCct//L73ygrpY93CxXpRJDtNqPVg==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -11065,6 +11073,7 @@ "which", "write-file-atomic" ], + "dev": true, "workspaces": [ "docs", "smoke-tests", @@ -11085,13 +11094,13 @@ "@sigstore/tuf": "^2.3.4", "abbrev": "^2.0.0", "archy": "~1.0.0", - "cacache": "^18.0.3", + "cacache": "^18.0.4", "chalk": "^5.3.0", "ci-info": "^4.0.0", "cli-columns": "^4.0.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.4.2", + "glob": "^10.4.5", "graceful-fs": "^4.2.11", "hosted-git-info": "^7.0.2", "ini": "^4.1.3", @@ -11100,7 +11109,7 @@ "json-parse-even-better-errors": "^3.0.2", "libnpmaccess": "^8.0.6", "libnpmdiff": "^6.1.4", - "libnpmexec": "^8.1.3", + "libnpmexec": "^8.1.4", "libnpmfund": "^5.0.12", "libnpmhook": "^10.0.5", "libnpmorg": "^6.0.6", @@ -11114,12 +11123,12 @@ "minipass": "^7.1.1", "minipass-pipeline": "^1.2.4", "ms": "^2.1.2", - "node-gyp": "^10.1.0", + "node-gyp": "^10.2.0", "nopt": "^7.2.1", "normalize-package-data": "^6.0.2", "npm-audit-report": "^5.0.0", "npm-install-checks": "^6.3.0", - "npm-package-arg": "^11.0.2", + "npm-package-arg": "^11.0.3", "npm-pick-manifest": "^9.1.0", "npm-profile": "^10.0.0", "npm-registry-fetch": "^17.1.0", @@ -11130,7 +11139,7 @@ "proc-log": "^4.2.0", "qrcode-terminal": "^0.12.0", "read": "^3.0.1", - "semver": "^7.6.2", + "semver": "^7.6.3", "spdx-expression-parse": "^4.0.0", "ssri": "^10.0.6", "supports-color": "^9.4.0", @@ -11152,6 +11161,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11168,6 +11178,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11179,11 +11190,13 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11200,6 +11213,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11214,11 +11228,13 @@ }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/@npmcli/agent": { "version": "2.2.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11234,6 +11250,7 @@ }, "node_modules/npm/node_modules/@npmcli/arborist": { "version": "7.5.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11282,6 +11299,7 @@ }, "node_modules/npm/node_modules/@npmcli/config": { "version": "8.3.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11300,6 +11318,7 @@ }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11311,6 +11330,7 @@ }, "node_modules/npm/node_modules/@npmcli/git": { "version": "5.0.8", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11330,6 +11350,7 @@ }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11345,6 +11366,7 @@ }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { "version": "3.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11359,6 +11381,7 @@ }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { "version": "7.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11374,6 +11397,7 @@ }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11382,6 +11406,7 @@ }, "node_modules/npm/node_modules/@npmcli/node-gyp": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11390,6 +11415,7 @@ }, "node_modules/npm/node_modules/@npmcli/package-json": { "version": "5.2.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11407,6 +11433,7 @@ }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11418,6 +11445,7 @@ }, "node_modules/npm/node_modules/@npmcli/query": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11429,6 +11457,7 @@ }, "node_modules/npm/node_modules/@npmcli/redact": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11437,6 +11466,7 @@ }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "8.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11453,6 +11483,7 @@ }, "node_modules/npm/node_modules/@pkgjs/parseargs": { "version": "0.11.0", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -11462,6 +11493,7 @@ }, "node_modules/npm/node_modules/@sigstore/bundle": { "version": "2.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -11473,6 +11505,7 @@ }, "node_modules/npm/node_modules/@sigstore/core": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -11481,6 +11514,7 @@ }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { "version": "0.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -11489,6 +11523,7 @@ }, "node_modules/npm/node_modules/@sigstore/sign": { "version": "2.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -11505,6 +11540,7 @@ }, "node_modules/npm/node_modules/@sigstore/tuf": { "version": "2.3.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -11517,6 +11553,7 @@ }, "node_modules/npm/node_modules/@sigstore/verify": { "version": "1.2.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -11530,6 +11567,7 @@ }, "node_modules/npm/node_modules/@tufjs/canonical-json": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11538,6 +11576,7 @@ }, "node_modules/npm/node_modules/@tufjs/models": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11550,6 +11589,7 @@ }, "node_modules/npm/node_modules/abbrev": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11558,6 +11598,7 @@ }, "node_modules/npm/node_modules/agent-base": { "version": "7.1.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11569,6 +11610,7 @@ }, "node_modules/npm/node_modules/aggregate-error": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11581,6 +11623,7 @@ }, "node_modules/npm/node_modules/ansi-regex": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11589,6 +11632,7 @@ }, "node_modules/npm/node_modules/ansi-styles": { "version": "6.2.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11600,21 +11644,25 @@ }, "node_modules/npm/node_modules/aproba": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/bin-links": { "version": "4.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11629,6 +11677,7 @@ }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.3.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11640,6 +11689,7 @@ }, "node_modules/npm/node_modules/brace-expansion": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11647,7 +11697,8 @@ } }, "node_modules/npm/node_modules/cacache": { - "version": "18.0.3", + "version": "18.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11670,6 +11721,7 @@ }, "node_modules/npm/node_modules/chalk": { "version": "5.3.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11681,6 +11733,7 @@ }, "node_modules/npm/node_modules/chownr": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11689,6 +11742,7 @@ }, "node_modules/npm/node_modules/ci-info": { "version": "4.0.0", + "dev": true, "funding": [ { "type": "github", @@ -11703,6 +11757,7 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -11714,6 +11769,7 @@ }, "node_modules/npm/node_modules/clean-stack": { "version": "2.2.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11722,6 +11778,7 @@ }, "node_modules/npm/node_modules/cli-columns": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11734,6 +11791,7 @@ }, "node_modules/npm/node_modules/cmd-shim": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11742,6 +11800,7 @@ }, "node_modules/npm/node_modules/color-convert": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11753,16 +11812,19 @@ }, "node_modules/npm/node_modules/color-name": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/cross-spawn": { "version": "7.0.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11776,6 +11838,7 @@ }, "node_modules/npm/node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11790,6 +11853,7 @@ }, "node_modules/npm/node_modules/cssesc": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -11800,7 +11864,8 @@ } }, "node_modules/npm/node_modules/debug": { - "version": "4.3.5", + "version": "4.3.6", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11817,11 +11882,13 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/diff": { "version": "5.2.0", + "dev": true, "inBundle": true, "license": "BSD-3-Clause", "engines": { @@ -11830,16 +11897,19 @@ }, "node_modules/npm/node_modules/eastasianwidth": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/emoji-regex": { "version": "8.0.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -11849,6 +11919,7 @@ }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11857,16 +11928,19 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "Apache-2.0" }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.16", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11874,7 +11948,8 @@ } }, "node_modules/npm/node_modules/foreground-child": { - "version": "3.2.1", + "version": "3.3.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11890,6 +11965,7 @@ }, "node_modules/npm/node_modules/fs-minipass": { "version": "3.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11900,7 +11976,8 @@ } }, "node_modules/npm/node_modules/glob": { - "version": "10.4.2", + "version": "10.4.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11914,20 +11991,19 @@ "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/npm/node_modules/graceful-fs": { "version": "4.2.11", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/hosted-git-info": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11939,11 +12015,13 @@ }, "node_modules/npm/node_modules/http-cache-semantics": { "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11956,6 +12034,7 @@ }, "node_modules/npm/node_modules/https-proxy-agent": { "version": "7.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11968,6 +12047,7 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -11980,6 +12060,7 @@ }, "node_modules/npm/node_modules/ignore-walk": { "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11991,6 +12072,7 @@ }, "node_modules/npm/node_modules/imurmurhash": { "version": "0.1.4", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11999,6 +12081,7 @@ }, "node_modules/npm/node_modules/indent-string": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12007,6 +12090,7 @@ }, "node_modules/npm/node_modules/ini": { "version": "4.1.3", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12015,6 +12099,7 @@ }, "node_modules/npm/node_modules/init-package-json": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12032,6 +12117,7 @@ }, "node_modules/npm/node_modules/ip-address": { "version": "9.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12044,6 +12130,7 @@ }, "node_modules/npm/node_modules/ip-regex": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12055,6 +12142,7 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "5.1.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12066,6 +12154,7 @@ }, "node_modules/npm/node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12074,24 +12163,24 @@ }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/jackspeak": { - "version": "3.4.0", + "version": "3.4.3", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": ">=14" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -12101,11 +12190,13 @@ }, "node_modules/npm/node_modules/jsbn": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "3.0.2", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12114,6 +12205,7 @@ }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -12122,6 +12214,7 @@ }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", + "dev": true, "engines": [ "node >= 0.2.0" ], @@ -12130,16 +12223,19 @@ }, "node_modules/npm/node_modules/just-diff": { "version": "6.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff-apply": { "version": "5.5.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { "version": "8.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12152,6 +12248,7 @@ }, "node_modules/npm/node_modules/libnpmdiff": { "version": "6.1.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12169,7 +12266,8 @@ } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "8.1.3", + "version": "8.1.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12190,6 +12288,7 @@ }, "node_modules/npm/node_modules/libnpmfund": { "version": "5.0.12", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12201,6 +12300,7 @@ }, "node_modules/npm/node_modules/libnpmhook": { "version": "10.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12213,6 +12313,7 @@ }, "node_modules/npm/node_modules/libnpmorg": { "version": "6.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12225,6 +12326,7 @@ }, "node_modules/npm/node_modules/libnpmpack": { "version": "7.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12239,6 +12341,7 @@ }, "node_modules/npm/node_modules/libnpmpublish": { "version": "9.0.9", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12257,6 +12360,7 @@ }, "node_modules/npm/node_modules/libnpmsearch": { "version": "7.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12268,6 +12372,7 @@ }, "node_modules/npm/node_modules/libnpmteam": { "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12280,6 +12385,7 @@ }, "node_modules/npm/node_modules/libnpmversion": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12294,15 +12400,14 @@ } }, "node_modules/npm/node_modules/lru-cache": { - "version": "10.2.2", + "version": "10.4.3", + "dev": true, "inBundle": true, - "license": "ISC", - "engines": { - "node": "14 || >=16.14" - } + "license": "ISC" }, "node_modules/npm/node_modules/make-fetch-happen": { "version": "13.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12325,6 +12430,7 @@ }, "node_modules/npm/node_modules/minimatch": { "version": "9.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12339,6 +12445,7 @@ }, "node_modules/npm/node_modules/minipass": { "version": "7.1.2", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12347,6 +12454,7 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12358,6 +12466,7 @@ }, "node_modules/npm/node_modules/minipass-fetch": { "version": "3.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12374,6 +12483,7 @@ }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12385,6 +12495,7 @@ }, "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12396,6 +12507,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12407,6 +12519,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12418,6 +12531,7 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12429,6 +12543,7 @@ }, "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12440,6 +12555,7 @@ }, "node_modules/npm/node_modules/minizlib": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12452,6 +12568,7 @@ }, "node_modules/npm/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12463,6 +12580,7 @@ }, "node_modules/npm/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -12474,11 +12592,13 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12487,6 +12607,7 @@ }, "node_modules/npm/node_modules/negotiator": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12494,7 +12615,8 @@ } }, "node_modules/npm/node_modules/node-gyp": { - "version": "10.1.0", + "version": "10.2.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12504,9 +12626,9 @@ "graceful-fs": "^4.2.6", "make-fetch-happen": "^13.0.0", "nopt": "^7.0.0", - "proc-log": "^3.0.0", + "proc-log": "^4.1.0", "semver": "^7.3.5", - "tar": "^6.1.2", + "tar": "^6.2.1", "which": "^4.0.0" }, "bin": { @@ -12516,16 +12638,9 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/npm/node_modules/node-gyp/node_modules/proc-log": { - "version": "3.0.0", - "inBundle": true, - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/npm/node_modules/nopt": { "version": "7.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12540,6 +12655,7 @@ }, "node_modules/npm/node_modules/normalize-package-data": { "version": "6.0.2", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12553,6 +12669,7 @@ }, "node_modules/npm/node_modules/npm-audit-report": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12561,6 +12678,7 @@ }, "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12572,6 +12690,7 @@ }, "node_modules/npm/node_modules/npm-install-checks": { "version": "6.3.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12583,6 +12702,7 @@ }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12590,7 +12710,8 @@ } }, "node_modules/npm/node_modules/npm-package-arg": { - "version": "11.0.2", + "version": "11.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12605,6 +12726,7 @@ }, "node_modules/npm/node_modules/npm-packlist": { "version": "8.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12616,6 +12738,7 @@ }, "node_modules/npm/node_modules/npm-pick-manifest": { "version": "9.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12630,6 +12753,7 @@ }, "node_modules/npm/node_modules/npm-profile": { "version": "10.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12642,6 +12766,7 @@ }, "node_modules/npm/node_modules/npm-registry-fetch": { "version": "17.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12660,6 +12785,7 @@ }, "node_modules/npm/node_modules/npm-user-validate": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "engines": { @@ -12668,6 +12794,7 @@ }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12682,11 +12809,13 @@ }, "node_modules/npm/node_modules/package-json-from-dist": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0" }, "node_modules/npm/node_modules/pacote": { "version": "18.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12717,6 +12846,7 @@ }, "node_modules/npm/node_modules/parse-conflict-json": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12730,6 +12860,7 @@ }, "node_modules/npm/node_modules/path-key": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12738,6 +12869,7 @@ }, "node_modules/npm/node_modules/path-scurry": { "version": "1.11.1", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -12752,7 +12884,8 @@ } }, "node_modules/npm/node_modules/postcss-selector-parser": { - "version": "6.1.0", + "version": "6.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12765,6 +12898,7 @@ }, "node_modules/npm/node_modules/proc-log": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12773,6 +12907,7 @@ }, "node_modules/npm/node_modules/proggy": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12781,6 +12916,7 @@ }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -12789,6 +12925,7 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -12797,11 +12934,13 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12814,6 +12953,7 @@ }, "node_modules/npm/node_modules/promzard": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12825,6 +12965,7 @@ }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", + "dev": true, "inBundle": true, "bin": { "qrcode-terminal": "bin/qrcode-terminal.js" @@ -12832,6 +12973,7 @@ }, "node_modules/npm/node_modules/read": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12843,6 +12985,7 @@ }, "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12851,6 +12994,7 @@ }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12863,6 +13007,7 @@ }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12871,12 +13016,14 @@ }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "optional": true }, "node_modules/npm/node_modules/semver": { - "version": "7.6.2", + "version": "7.6.3", + "dev": true, "inBundle": true, "license": "ISC", "bin": { @@ -12888,6 +13035,7 @@ }, "node_modules/npm/node_modules/shebang-command": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12899,6 +13047,7 @@ }, "node_modules/npm/node_modules/shebang-regex": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12907,6 +13056,7 @@ }, "node_modules/npm/node_modules/signal-exit": { "version": "4.1.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12918,6 +13068,7 @@ }, "node_modules/npm/node_modules/sigstore": { "version": "2.3.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -12934,6 +13085,7 @@ }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12943,6 +13095,7 @@ }, "node_modules/npm/node_modules/socks": { "version": "2.8.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12956,6 +13109,7 @@ }, "node_modules/npm/node_modules/socks-proxy-agent": { "version": "8.0.4", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12969,6 +13123,7 @@ }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.2.0", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -12978,6 +13133,7 @@ }, "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12987,11 +13143,13 @@ }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.5.0", + "dev": true, "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13001,16 +13159,19 @@ }, "node_modules/npm/node_modules/spdx-license-ids": { "version": "3.0.18", + "dev": true, "inBundle": true, "license": "CC0-1.0" }, "node_modules/npm/node_modules/sprintf-js": { "version": "1.1.3", + "dev": true, "inBundle": true, "license": "BSD-3-Clause" }, "node_modules/npm/node_modules/ssri": { "version": "10.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13022,6 +13183,7 @@ }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13036,6 +13198,7 @@ "node_modules/npm/node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13049,6 +13212,7 @@ }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13061,6 +13225,7 @@ "node_modules/npm/node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13072,6 +13237,7 @@ }, "node_modules/npm/node_modules/supports-color": { "version": "9.4.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13083,6 +13249,7 @@ }, "node_modules/npm/node_modules/tar": { "version": "6.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13099,6 +13266,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13110,6 +13278,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13121,6 +13290,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/minipass": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13129,16 +13299,19 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/treeverse": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13147,6 +13320,7 @@ }, "node_modules/npm/node_modules/tuf-js": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13160,6 +13334,7 @@ }, "node_modules/npm/node_modules/unique-filename": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13171,6 +13346,7 @@ }, "node_modules/npm/node_modules/unique-slug": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13182,11 +13358,13 @@ }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -13196,6 +13374,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13205,6 +13384,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13213,11 +13393,13 @@ }, "node_modules/npm/node_modules/walk-up-path": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/which": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13232,6 +13414,7 @@ }, "node_modules/npm/node_modules/which/node_modules/isexe": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13240,6 +13423,7 @@ }, "node_modules/npm/node_modules/wrap-ansi": { "version": "8.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13257,6 +13441,7 @@ "node_modules/npm/node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13273,6 +13458,7 @@ }, "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13287,6 +13473,7 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13298,11 +13485,13 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { "version": "9.2.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13319,6 +13508,7 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "7.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13333,6 +13523,7 @@ }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13345,6 +13536,7 @@ }, "node_modules/npm/node_modules/yallist": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, @@ -16955,4 +17147,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 344cefda..e9c48b76 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,7 @@ "ansi-colors": "^4.1.3", "axios": "^1.6.7", "js-tiktoken": "^1.0.14", - "node-loader": "^2.0.0", - "npm": "^10.8.2" + "node-loader": "^2.0.0" }, "devDependencies": { "@ai-sdk/anthropic": "^0.0.41", @@ -42,6 +41,7 @@ "@changesets/cli": "^2.27.1", "@google-cloud/vertexai": "^1.5.0", "@google/generative-ai": "^0.1.3", + "@mistralai/mistralai": "^1.0.4", "@opentelemetry/exporter-trace-otlp-http": "^0.53.0", "@pinecone-database/pinecone": "^2.0.1", "@qdrant/js-client-rest": "^1.9.0", @@ -57,7 +57,9 @@ "eslint-plugin-promise": "^6.0.1", "eslint-plugin-unused-imports": "^2.0.0", "groq-sdk": "^0.3.3", + "i": "^0.3.7", "llamaindex": "^0.1.21", + "npm": "^10.8.3", "ollama": "^0.5.2", "openai": "^4.47.1", "pgvector": "^0.1.8", @@ -65,4 +67,4 @@ "typescript": "^4.9.5", "weaviate-ts-client": "^2.2.0" } -} \ No newline at end of file +} diff --git a/src/examples/entrypoint.ts b/src/examples/entrypoint.ts index 5313853d..a3076595 100644 --- a/src/examples/entrypoint.ts +++ b/src/examples/entrypoint.ts @@ -1,3 +1,3 @@ -import { chatCompletion } from '@langtrace-examples/mistral/chat-complete' +import { basic } from '@langtrace-examples/llamaindex/basic' -void chatCompletion() +void basic() diff --git a/src/examples/llamaindex/basic.ts b/src/examples/llamaindex/basic.ts index be8f8e7b..9f2dd7c7 100644 --- a/src/examples/llamaindex/basic.ts +++ b/src/examples/llamaindex/basic.ts @@ -1,38 +1,89 @@ + import { init } from '@langtrace-init/init' -import type { BaseReader, Metadata } from 'llamaindex' +import type { BaseReader, Metadata, NodeWithScore } from 'llamaindex' import { withLangTraceRootSpan } from '@langtrace-utils/instrumentation' import dotenv from 'dotenv' import { + CorrectnessEvaluator, Document, - FILE_EXT_TO_READER, IngestionPipeline, QuestionsAnsweredExtractor, - SimpleDirectoryReader, - TextFileReader, + ResponseSynthesizer, + TextNode, TitleExtractor, - VectorStoreIndex + VectorStoreIndex, + SentenceSplitter } from 'llamaindex' dotenv.config() -init({ batch: false, write_spans_to_console: true }) +init({ batch: false, api_key: '986fd03796f14f6a1009f6a65866e39ae850cd14e1f7348260dfc04ef5ab38a7' }) +// Initialize the root span to trace the operations export async function basic (): Promise { await withLangTraceRootSpan(async (spanId, traceId) => { - // // Create Document object with essay - const document = new Document({ text: "Author of 'React' and 'Redux' books. He is a software engineer at Facebook. He studied at the University of Moscow and studied engineering" }) + // Step 1: Load documents using the loader function + const documents = await loader() + + // Step 2: Split documents into sentences using SentenceSplitter before indexing + const splitter = new SentenceSplitter({ chunkSize: 20 }) + const splitDocuments: Document[] = [] + + for (const doc of documents) { + const sentenceChunks = splitter.splitText(doc.text) + console.info('Sentence Chunks:', sentenceChunks) + sentenceChunks.forEach((chunk, index) => { + splitDocuments.push(new Document({ text: chunk, metadata: { part: index + 1 } })) + }) + } + console.info('Split Documents:', splitDocuments) - // // Split text and create embeddings. Store them in a VectorStoreIndex - const index = await VectorStoreIndex.fromDocuments([document]) + // Step 3: Create a VectorStoreIndex from the split documents + const index = await VectorStoreIndex.fromDocuments(splitDocuments) - // Query the index + // Step 4: Query the index using QueryEngine const queryEngine = index.asQueryEngine() - const response = await queryEngine.query({ query: 'What did the author do in college?' }) - // Output response - console.info(response.toString()) + const query = 'What did the author do in college?' + const response = await queryEngine.query({ query }) + console.info('Query Response:', response.toString()) + + // Step 5: Retrieve additional data using Retriever + const retriever = index.asRetriever() + const retrievedDocuments = await retriever.retrieve(query) + console.info('Retrieved Documents:', retrievedDocuments) + + // Step 6: Evaluate the query response using CorrectnessEvaluator + const evaluator = new CorrectnessEvaluator({}) + const evaluationResult = await evaluator.evaluateResponse({ query, response }) + const evaluationResult2 = await evaluator.evaluate({ query, response: response.response.toString() }) + console.info('Evaluation Result:', evaluationResult) + console.info('Evaluation Result 2:', evaluationResult2) + + // Step 7: Run the ingestion pipeline with transformations + const nodes = await runIngestionPipeline() + console.info('Transformed Nodes:', nodes) + + // Step 8: Synthesize a response using the ResponseSynthesizer + const responseSynthesizer = new ResponseSynthesizer() + const nodesWithScore: NodeWithScore[] = [ + { + node: new TextNode({ text: 'I am 10 years old.' }), + score: 1 + }, + { + node: new TextNode({ text: 'John is 20 years old.' }), + score: 0.5 + } + ] + const synthesizeResponse = await responseSynthesizer.synthesize({ + query: 'What age am I?', + nodesWithScore + }) + console.info('Synthesized Response:', synthesizeResponse) }) } -export async function extractor (): Promise { +// Ingestion pipeline to extract metadata and transform documents +export async function runIngestionPipeline (): Promise>> { const pipeline = new IngestionPipeline({ transformations: [ new TitleExtractor(), @@ -45,31 +96,20 @@ export async function extractor (): Promise { new Document({ text: 'I am 10 years old. John is 20 years old.' }) ] }) - - for (const node of nodes) { - console.info(node.metadata) - } + return nodes.map((node) => new Document(node)) } -export async function loader (): Promise { +// Loader function to read data +export async function loader (): Promise { class ZipReader implements BaseReader { // eslint-disable-next-line @typescript-eslint/require-await async loadData (): Promise>> { - throw new Error('Implement me') + return await runIngestionPipeline() } } - const reader = new SimpleDirectoryReader() - const documents = await reader.loadData({ - directoryPath: 'src/examples/llamaindex/data', - defaultReader: new TextFileReader(), - fileExtToReader: { - ...FILE_EXT_TO_READER, - zip: new ZipReader() - } - }) + const reader = new ZipReader() + const documents = await reader.loadData() - documents.forEach((doc) => { - console.info(`document (${doc.id_}):`, doc.getText()) - }) + return documents } diff --git a/src/instrumentation/llamaindex/instrumentation.ts b/src/instrumentation/llamaindex/instrumentation.ts index e10bb2d9..3e267035 100644 --- a/src/instrumentation/llamaindex/instrumentation.ts +++ b/src/instrumentation/llamaindex/instrumentation.ts @@ -26,8 +26,20 @@ import { import { version, name } from '../../../package.json' class LlamaIndexInstrumentation extends InstrumentationBase { + private readonly methodsToPatch: string[] constructor () { super(name, version) + this.methodsToPatch = + [ + 'query', 'retrieve', 'chat', + 'call', 'extract', 'loadData', + 'run', 'evaluateResponse', + 'evaluate', '_getPrompts', '_updatePrompts', + 'transform', 'fromDocuments', + 'getNodesFromDocuments', + 'synthesize', 'validatePrompts', + 'splitText' + ] } public manualPatch (llamaIndex: any): void { @@ -56,119 +68,29 @@ class LlamaIndexInstrumentation extends InstrumentationBase { } private _patch (llama: any, moduleVersion?: string): void { - // Note: Instrumenting only the core concepts of LlamaIndex SDK // https://github.com/run-llama/LlamaIndexTS?tab=readme-ov-file - for (const key in llama) { const cls = (llama)[key] if (cls.prototype !== undefined) { - if (cls.prototype.query !== undefined) { - if (isWrapped(cls.prototype)) { - this._unwrap(cls.prototype, 'query') - } - this._wrap( - cls.prototype, - 'query', - (originalMethod: (...args: any[]) => any) => - genericPatch( - originalMethod, - `llamaindex.${key}.query`, - 'query', - this.tracer, - this.instrumentationVersion, - moduleVersion - ) - ) - } - if (cls.prototype.retrieve !== undefined) { - if (isWrapped(cls.prototype)) { - this._unwrap(cls.prototype, 'retrieve') - } - this._wrap( - cls.prototype, - 'retrieve', - (originalMethod: (...args: any[]) => any) => - genericPatch( - originalMethod, - `llamaindex.${key}.retrieve`, - 'retrieve_data', - this.tracer, - this.instrumentationVersion, - moduleVersion - ) - ) - } - if (cls.prototype.chat !== undefined) { - if (isWrapped(cls.prototype)) { - this._unwrap(cls.prototype, 'chat') - } - this._wrap( - cls.prototype, - 'chat', - (originalMethod: (...args: any[]) => any) => - genericPatch( - originalMethod, - `llamaindex.${key}.chat`, - 'chat', - this.tracer, - this.instrumentationVersion, - moduleVersion - ) - ) - } - if (cls.prototype.call !== undefined) { - if (isWrapped(cls.prototype)) { - this._unwrap(cls.prototype, 'call') - } - this._wrap( - cls.prototype, - 'call', - (originalMethod: (...args: any[]) => any) => - genericPatch( - originalMethod, - `llamaindex.${key}.call`, - 'prompt', - this.tracer, - this.instrumentationVersion, - moduleVersion - ) - ) - } - if (cls.prototype.extract !== undefined) { - if (isWrapped(cls.prototype)) { - this._unwrap(cls.prototype, 'extract') - } - this._wrap( - cls.prototype, - 'extract', - (originalMethod: (...args: any[]) => any) => - genericPatch( - originalMethod, - `llamaindex.${key}.extract`, - 'extract_data', - this.tracer, - this.instrumentationVersion, - moduleVersion - ) - ) - } - if (cls.prototype.loadData !== undefined) { - if (isWrapped(cls.prototype)) { - this._unwrap(cls.prototype, 'loadData') + for (const method of this.methodsToPatch) { + if (cls.prototype[method] !== undefined) { + if (isWrapped(cls.prototype)) { + this._unwrap(cls.prototype, method) + } + this._wrap( + cls.prototype, + method, + (originalMethod: (...args: any[]) => any) => + genericPatch( + originalMethod, + `llamaindex.${key}.${method}`, + method, + this.tracer, + this.instrumentationVersion, + moduleVersion + ) + ) } - this._wrap( - cls.prototype, - 'loadData', - (originalMethod: (...args: any[]) => any) => - genericPatch( - originalMethod, - `llamaindex.${key}.loadData`, - 'load_data', - this.tracer, - this.instrumentationVersion, - moduleVersion - ) - ) } } } @@ -178,23 +100,10 @@ class LlamaIndexInstrumentation extends InstrumentationBase { for (const key in llama) { const cls = (llama)[key] if (cls.prototype !== undefined) { - if (cls.prototype.query !== undefined) { - this._unwrap(cls.prototype, 'query') - } - if (cls.prototype.retrieve !== undefined) { - this._unwrap(cls.prototype, 'retrieve') - } - if (cls.prototype.chat !== undefined) { - this._unwrap(cls.prototype, 'chat') - } - if (cls.prototype.call !== undefined) { - this._unwrap(cls.prototype, 'call') - } - if (cls.prototype.extract !== undefined) { - this._unwrap(cls.prototype, 'extract') - } - if (cls.prototype.loadData !== undefined) { - this._unwrap(cls.prototype, 'loadData') + for (const method of this.methodsToPatch) { + if (isWrapped(cls.prototype)) { + this._unwrap(cls.prototype, method) + } } } } diff --git a/src/instrumentation/llamaindex/patch.ts b/src/instrumentation/llamaindex/patch.ts index dc05a6ec..1f85c7e6 100644 --- a/src/instrumentation/llamaindex/patch.ts +++ b/src/instrumentation/llamaindex/patch.ts @@ -1,29 +1,6 @@ -/* - * Copyright (c) 2024 Scale3 Labs - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' import { FrameworkSpanAttributes, Vendors } from '@langtrase/trace-attributes' -import { - Exception, - SpanKind, - SpanStatusCode, - Tracer, - context, - trace -} from '@opentelemetry/api' +import { Tracer, context, SpanKind, SpanStatusCode, Exception, trace } from '@opentelemetry/api' export function genericPatch ( originalMethod: (...args: any[]) => any, @@ -33,7 +10,7 @@ export function genericPatch ( langtraceVersion: string, version?: string ): (...args: any[]) => any { - return async function (this: any, ...args: any[]) { + return function (this: any, ...args: any[]) { // eslint-disable-next-line @typescript-eslint/no-unsafe-return const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} const attributes: FrameworkSpanAttributes = { @@ -45,23 +22,49 @@ export function genericPatch ( 'llamaindex.task.name': task, ...customAttributes } + if (task !== 'llamaindex.SimpleVectorStore.query') { + attributes['llamaindex.inputs'] = JSON.stringify(args) + } const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? method const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes }, context.active()) - return await context.with( - trace.setSpan(context.active(), span), - async () => { - try { - const response = await originalMethod.apply(this, args) + + const invokeMethod = (): any => { + try { + const result = originalMethod.apply(this, args) + if (result instanceof Promise) { + // Handle async function + return result + .then((response: any) => { + if (task !== 'llamaindex.SimpleVectorStore.query') { + span.setAttributes({ 'llamaindex.outputs': JSON.stringify(response) }) + } + span.setStatus({ code: SpanStatusCode.OK }) + span.end() + return response + }) + .catch((error: any) => { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + span.end() + throw error + }) + } else { + // Handle sync function + if (task !== 'llamaindex.SimpleVectorStore.query') { + span.setAttributes({ 'llamaindex.outputs': JSON.stringify(result) }) + } span.setStatus({ code: SpanStatusCode.OK }) span.end() - return response - } catch (error: any) { - span.recordException(error as Exception) - span.setStatus({ code: SpanStatusCode.ERROR }) - span.end() - throw error + return result } + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + span.end() + throw error } - ) + } + + return context.with(trace.setSpan(context.active(), span), invokeMethod) } } From 6fc7ee7a415548b9be2b1c9173b611faf25f48bf Mon Sep 17 00:00:00 2001 From: Rohit Kadhe Date: Fri, 20 Sep 2024 14:35:55 -0600 Subject: [PATCH 17/25] sentry to filter non langtrace exceptions --- src/errors/sdk_error.ts | 11 +++++++++ src/init/init.ts | 32 +++++++++++++++++++++++-- src/instrumentation/anthropic/patch.ts | 5 ++-- src/instrumentation/chroma/patch.ts | 3 ++- src/instrumentation/cohere/patch.ts | 29 +++++++++++----------- src/instrumentation/gemini/patch.ts | 5 ++-- src/instrumentation/groq/patch.ts | 5 ++-- src/instrumentation/llamaindex/patch.ts | 4 ++-- src/instrumentation/mistral/patch.ts | 7 +++--- src/instrumentation/ollama/patch.ts | 24 +++++++++++-------- src/instrumentation/openai/patch.ts | 11 +++++---- src/instrumentation/pg/patch.ts | 3 ++- src/instrumentation/pinecone/patch.ts | 3 ++- src/instrumentation/qdrant/patch.ts | 3 ++- src/instrumentation/vercel/anthropic.ts | 11 +++++---- src/instrumentation/vercel/openai.ts | 9 +++---- src/instrumentation/vertexai/patch.ts | 5 ++-- src/instrumentation/weaviate/patch.ts | 3 ++- src/utils/instrumentation.ts | 3 ++- src/utils/langtrace.ts | 7 +++--- 20 files changed, 121 insertions(+), 62 deletions(-) create mode 100644 src/errors/sdk_error.ts diff --git a/src/errors/sdk_error.ts b/src/errors/sdk_error.ts new file mode 100644 index 00000000..041cbd5a --- /dev/null +++ b/src/errors/sdk_error.ts @@ -0,0 +1,11 @@ +export class LangtraceSdkError extends Error { + message: string + name: string + stack?: string | undefined + constructor (message: string, stack?: string) { + super(message) + this.message = message + this.stack = stack + this.name = 'LangTraceSdkError' + } +} diff --git a/src/init/init.ts b/src/init/init.ts index a772c7fc..5ae9b261 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-argument */ /* * Copyright (c) 2024 Scale3 Labs * @@ -45,6 +46,7 @@ import * as Sentry from '@sentry/node' import { SENTRY_DSN } from '@langtrace-constants/common' import { nodeProfilingIntegration } from '@sentry/profiling-node' import { mistralInstrumentation } from '@langtrace-instrumentation/mistral/instrumentation' +import { LangtraceSdkError } from 'errors/sdk_error' /** * Initializes the LangTrace sdk with custom options. @@ -213,7 +215,25 @@ export const init: LangTraceInit = ({ tracesSampleRate: 1.0, profilesSampleRate: 1.0, skipOpenTelemetrySetup: true, - integrations: [nodeProfilingIntegration()] + integrations: [nodeProfilingIntegration()], + beforeSend: (event, hint) => { + let result: Sentry.ErrorEvent | null = null + const original: any = hint?.originalException + if (original instanceof Promise) { + original.catch((error: any) => { + // Check if it's a LangTraceSdkError and capture it + if (error.name === 'LangTraceSdkError') { + result = event // Send this event + } + }) + } + // Handle regular errors (non-Promise exceptions) + if (original.name === 'LangtraceSdkError') { + result = event + } + + return result + } }) const context = Object.entries(initOptions).reduce>((acc, [key, value]) => { acc[key] = JSON.stringify(value) @@ -221,6 +241,14 @@ export const init: LangTraceInit = ({ }, {}) Sentry.setContext('sdk_init_options', context) } + // Global handler for unhandled promise rejections + process.on('unhandledRejection', (reason, promise) => { + // console.error('Unhandled Rejection at:', promise, 'reason:', reason) + Sentry.captureException(reason) // Capture unhandled promise rejections + }) + process.on('uncaughtException', (error) => { + Sentry.captureException(error) // Capture uncaught + }) global.langtrace_initalized = true global.langtrace_options = initOptions @@ -229,7 +257,7 @@ export const init: LangTraceInit = ({ const disableInstrumentations = (disable_instrumentations: { all_except?: string[], only?: string[] }, allInstrumentations: Record, modules?: { [key in Vendor]?: any }): InstrumentationBase[] => { if (disable_instrumentations.only !== undefined && disable_instrumentations.all_except !== undefined) { - throw new Error('Cannot specify both only and all_except in disable_instrumentations') + throw new LangtraceSdkError('Cannot specify both only and all_except in disable_instrumentations') } const instrumentations = Object.fromEntries(Object.entries(allInstrumentations) .filter(([key, instrumentation]) => { diff --git a/src/instrumentation/anthropic/patch.ts b/src/instrumentation/anthropic/patch.ts index 15d80772..c6248b66 100644 --- a/src/instrumentation/anthropic/patch.ts +++ b/src/instrumentation/anthropic/patch.ts @@ -28,6 +28,7 @@ import { context, trace } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export function messagesCreate ( originalMethod: (...args: any[]) => any, @@ -97,7 +98,7 @@ export function messagesCreate ( } catch (error: any) { span.setStatus({ code: SpanStatusCode.ERROR }) span.recordException(error as Exception) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -149,7 +150,7 @@ async function * handleStreamResponse (span: Span, stream: any, attributes: LLMS } catch (error: any) { span.setStatus({ code: SpanStatusCode.ERROR }) span.recordException(error as Exception) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } diff --git a/src/instrumentation/chroma/patch.ts b/src/instrumentation/chroma/patch.ts index fe8448bc..5b872a55 100644 --- a/src/instrumentation/chroma/patch.ts +++ b/src/instrumentation/chroma/patch.ts @@ -26,6 +26,7 @@ import { context, trace } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export function collectionPatch ( originalMethod: (...args: any[]) => any, @@ -78,7 +79,7 @@ export function collectionPatch ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) diff --git a/src/instrumentation/cohere/patch.ts b/src/instrumentation/cohere/patch.ts index ab598f9a..c67ef28f 100644 --- a/src/instrumentation/cohere/patch.ts +++ b/src/instrumentation/cohere/patch.ts @@ -37,6 +37,7 @@ import { } from '@langtrace-instrumentation/cohere/types' import { APIS, LLMSpanAttributes, Event } from '@langtrase/trace-attributes' import { addSpanEvent, createStreamProxy } from '@langtrace-utils/misc' +import { LangtraceSdkError } from 'errors/sdk_error' export const chatPatch = (original: ChatFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string) => { return async function (this: ICohereClient, request: IChatRequest, requestOptions?: IRequestOptions): Promise { @@ -97,10 +98,10 @@ export const chatPatch = (original: ChatFn, tracer: Tracer, langtraceVersion: st span.setStatus({ code: SpanStatusCode.OK }) return response }) - } catch (e: unknown) { - span.recordException(e as Exception) + } catch (error: any) { + span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw e + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -187,10 +188,10 @@ export const embedPatch = (original: EmbedFn, tracer: Tracer, langtraceVersion: span.setStatus({ code: SpanStatusCode.OK }) return response }) - } catch (e: unknown) { - span.recordException(e as Exception) + } catch (error: any) { + span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw e + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -230,10 +231,10 @@ export const embedJobsCreatePatch = (original: EmbedJobsCreateFn, tracer: Tracer span.setStatus({ code: SpanStatusCode.OK }) return response }) - } catch (e: any) { + } catch (error: any) { span.setStatus({ code: SpanStatusCode.ERROR }) - span.recordException(e as Exception) - throw e + span.recordException(error as Exception) + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -276,10 +277,10 @@ export const rerankPatch = (original: RerankFn, tracer: Tracer, langtraceVersion span.setStatus({ code: SpanStatusCode.OK }) return response }) - } catch (e: unknown) { - span.recordException(e as Exception) + } catch (error: any) { + span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw e + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -311,10 +312,10 @@ async function * handleStream (stream: any, attributes: LLMSpanAttributes, span: span.setAttributes(attributes) span.setStatus({ code: SpanStatusCode.OK }) - } catch (error: unknown) { + } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } diff --git a/src/instrumentation/gemini/patch.ts b/src/instrumentation/gemini/patch.ts index 704a4325..a276c2d3 100644 --- a/src/instrumentation/gemini/patch.ts +++ b/src/instrumentation/gemini/patch.ts @@ -34,6 +34,7 @@ import { trace, Tracer } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export function generateContentPatch ( originalMethod: (...args: any[]) => any, @@ -131,7 +132,7 @@ export function generateContentPatch ( } catch (error: any) { span.setStatus({ code: SpanStatusCode.ERROR }) span.recordException(error as Exception) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) @@ -179,7 +180,7 @@ async function * handleStreamResponse ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } diff --git a/src/instrumentation/groq/patch.ts b/src/instrumentation/groq/patch.ts index 30b68ef5..6e95d248 100644 --- a/src/instrumentation/groq/patch.ts +++ b/src/instrumentation/groq/patch.ts @@ -5,6 +5,7 @@ import { import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' import { APIS, LLMSpanAttributes, Event } from '@langtrase/trace-attributes' import { addSpanEvent, createStreamProxy } from '@langtrace-utils/misc' +import { LangtraceSdkError } from 'errors/sdk_error' export const chatPatch = (original: ChatStreamFn | ChatFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string) => { return async function (this: IGroqClient, body: IChatCompletionCreateParamsStreaming | IChatCompletionCreateParamsNonStreaming, @@ -132,10 +133,10 @@ async function * handleStream (stream: AsyncIterable, attributes: LLMSpanAt addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify([{ role: 'assistant', content: responseReconstructed.join('') }]) }) span.setAttributes(attributes) span.setStatus({ code: SpanStatusCode.OK }) - } catch (error: unknown) { + } catch (error: any) { span.recordException(error as Error) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } diff --git a/src/instrumentation/llamaindex/patch.ts b/src/instrumentation/llamaindex/patch.ts index 1f85c7e6..7a9420cc 100644 --- a/src/instrumentation/llamaindex/patch.ts +++ b/src/instrumentation/llamaindex/patch.ts @@ -1,6 +1,7 @@ import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' import { FrameworkSpanAttributes, Vendors } from '@langtrase/trace-attributes' import { Tracer, context, SpanKind, SpanStatusCode, Exception, trace } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export function genericPatch ( originalMethod: (...args: any[]) => any, @@ -58,10 +59,9 @@ export function genericPatch ( return result } } catch (error: any) { - span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } diff --git a/src/instrumentation/mistral/patch.ts b/src/instrumentation/mistral/patch.ts index ecbf8d1d..fab60dde 100644 --- a/src/instrumentation/mistral/patch.ts +++ b/src/instrumentation/mistral/patch.ts @@ -26,6 +26,7 @@ import { context, trace } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export function chatComplete ( originalMethod: (...args: any[]) => any, @@ -102,7 +103,7 @@ export function chatComplete ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -167,7 +168,7 @@ async function * handleStreamResponse ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -218,7 +219,7 @@ export function embeddingsCreate ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) diff --git a/src/instrumentation/ollama/patch.ts b/src/instrumentation/ollama/patch.ts index 9a51a6ab..04e003a1 100644 --- a/src/instrumentation/ollama/patch.ts +++ b/src/instrumentation/ollama/patch.ts @@ -1,11 +1,12 @@ /* eslint-disable no-console */ -import { Span, SpanKind, SpanStatusCode, Tracer, context, trace } from '@opentelemetry/api' +import { Exception, Span, SpanKind, SpanStatusCode, Tracer, context, trace } from '@opentelemetry/api' import { ChatFn, ChatStreamFn, EmbeddingsFn, GenerateFn, GenerateStreamFn, IChatRequest, IChatResponse, IEmbeddingsRequest, IEmbeddingsResponse, IGenerateRequest, IGenerateResponse, IOllamaClient } from '@langtrace-instrumentation/ollama/types' import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' import { LLMSpanAttributes, Event, APIS } from '@langtrase/trace-attributes' import { addSpanEvent, createStreamProxy } from '@langtrace-utils/misc' +import { LangtraceSdkError } from 'errors/sdk_error' export const chatPatch = (original: ChatStreamFn | ChatFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string) => { return async function (this: IOllamaClient, chatRequest: IChatRequest): Promise> { @@ -227,9 +228,10 @@ export const embeddingsPatch = (original: EmbeddingsFn, tracer: Tracer, langtrac span.setStatus({ code: SpanStatusCode.OK }) return resp }) - } catch (e: unknown) { - span.setStatus({ code: SpanStatusCode.ERROR, message: (e as Error).message }) - throw e + } catch (error: any) { + span.setStatus({ code: SpanStatusCode.ERROR }) + span.recordException(error as Exception) + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -254,9 +256,10 @@ async function * handleChatStream (stream: AsyncIterable, attributes: LLMSp addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify({ role: 'assistant', content: responseReconstructed.join('') }) }) span.setAttributes(attributes) span.setStatus({ code: SpanStatusCode.OK }) - } catch (error: unknown) { - span.setStatus({ code: SpanStatusCode.ERROR, message: (error as Error).message }) - throw error + } catch (error: any) { + span.setStatus({ code: SpanStatusCode.ERROR }) + span.recordException(error as Exception) + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -280,9 +283,10 @@ async function * handleGenerateStream (stream: AsyncIterable, attributes: L addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify({ role: 'assistant', content: responseReconstructed.join('') }) }) span.setAttributes(attributes) span.setStatus({ code: SpanStatusCode.OK }) - } catch (error: unknown) { - span.setStatus({ code: SpanStatusCode.ERROR, message: (error as Error).message }) - throw error + } catch (error: any) { + span.setStatus({ code: SpanStatusCode.ERROR }) + span.recordException(error as Exception) + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } diff --git a/src/instrumentation/openai/patch.ts b/src/instrumentation/openai/patch.ts index 97f43aef..8dd1277e 100644 --- a/src/instrumentation/openai/patch.ts +++ b/src/instrumentation/openai/patch.ts @@ -27,6 +27,7 @@ import { context, trace } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export function imageEdit ( originalMethod: (...args: any[]) => any, @@ -78,7 +79,7 @@ export function imageEdit ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) @@ -133,7 +134,7 @@ export function imagesGenerate ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) @@ -222,7 +223,7 @@ export function chatCompletionCreate ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -294,7 +295,7 @@ async function * handleStreamResponse ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -348,7 +349,7 @@ export function embeddingsCreate ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) diff --git a/src/instrumentation/pg/patch.ts b/src/instrumentation/pg/patch.ts index 874428cc..9991789d 100644 --- a/src/instrumentation/pg/patch.ts +++ b/src/instrumentation/pg/patch.ts @@ -2,6 +2,7 @@ import { DatabaseSpanAttributes, Vendors, Event, APIS } from '@langtrase/trace-a import { context, Exception, SpanKind, SpanStatusCode, trace, Tracer } from '@opentelemetry/api' import { addSpanEvent, stringify } from '@langtrace-utils/misc' import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' +import { LangtraceSdkError } from 'errors/sdk_error' export const patchPgQuery = (original: any, tracer: Tracer, sdkName: string, langtraceVersion: string, version?: string): any => { return async function (this: any, queryOrTextConfig: any, values: any, callback: any) { @@ -35,7 +36,7 @@ export const patchPgQuery = (original: any, tracer: Tracer, sdkName: string, lan span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } }) } diff --git a/src/instrumentation/pinecone/patch.ts b/src/instrumentation/pinecone/patch.ts index 8f9b1cf6..42365045 100644 --- a/src/instrumentation/pinecone/patch.ts +++ b/src/instrumentation/pinecone/patch.ts @@ -19,6 +19,7 @@ import { APIS, DatabaseSpanAttributes, Event, Vendors } from '@langtrase/trace-a import { Tracer, context, trace, SpanKind, SpanStatusCode, Exception } from '@opentelemetry/api' import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' import { addSpanEvent } from '@langtrace-utils/misc' +import { LangtraceSdkError } from 'errors/sdk_error' export function genericPatch ( originalMethod: (...args: any[]) => any, @@ -76,7 +77,7 @@ export function genericPatch ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) diff --git a/src/instrumentation/qdrant/patch.ts b/src/instrumentation/qdrant/patch.ts index 273b26cb..ff343cc6 100644 --- a/src/instrumentation/qdrant/patch.ts +++ b/src/instrumentation/qdrant/patch.ts @@ -18,6 +18,7 @@ import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/c import { addSpanEvent } from '@langtrace-utils/misc' import { APIS, DatabaseSpanAttributes, Event, Vendors } from '@langtrase/trace-attributes' import { Exception, SpanKind, SpanStatusCode, Tracer, context, trace } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export function genericCollectionPatch ( originalMethod: (...args: any[]) => any, @@ -59,7 +60,7 @@ export function genericCollectionPatch ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) diff --git a/src/instrumentation/vercel/anthropic.ts b/src/instrumentation/vercel/anthropic.ts index 14a69b5b..18b16b48 100644 --- a/src/instrumentation/vercel/anthropic.ts +++ b/src/instrumentation/vercel/anthropic.ts @@ -16,6 +16,7 @@ import { import { calculatePromptTokens, estimateTokens } from '@langtrace-utils/llm' import { addSpanEvent } from '@langtrace-utils/misc' +import { LangtraceSdkError } from 'errors/sdk_error' export async function generateTextPatchAnthropic ( this: any, @@ -87,7 +88,7 @@ export async function generateTextPatchAnthropic ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -174,7 +175,7 @@ export async function streamTextPatchAnthropic ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } }) } @@ -249,7 +250,7 @@ export async function generateObjectPatchAnthropic ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -336,7 +337,7 @@ export async function streamObjectPatchAnthropic ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } }) } @@ -383,7 +384,7 @@ async function * handleAnthropicStreamResponse ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } diff --git a/src/instrumentation/vercel/openai.ts b/src/instrumentation/vercel/openai.ts index 43b28038..0bccb0b5 100644 --- a/src/instrumentation/vercel/openai.ts +++ b/src/instrumentation/vercel/openai.ts @@ -3,6 +3,7 @@ import { calculatePromptTokens, estimateTokens } from '@langtrace-utils/llm' import { addSpanEvent } from '@langtrace-utils/misc' import { FrameworkSpanAttributes, LLMSpanAttributes, Vendors, Event } from '@langtrase/trace-attributes' import { Tracer, context, SpanKind, trace, Exception, SpanStatusCode, Span } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export async function streamTextPatchOpenAI ( this: any, @@ -78,7 +79,7 @@ export async function streamTextPatchOpenAI ( span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) @@ -152,7 +153,7 @@ export async function generateTextPatchOpenAI ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -220,7 +221,7 @@ export async function embedPatchOpenAI ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } @@ -263,7 +264,7 @@ async function * handleOpenAIStreamResponse ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } diff --git a/src/instrumentation/vertexai/patch.ts b/src/instrumentation/vertexai/patch.ts index 0834793b..5ac00e78 100644 --- a/src/instrumentation/vertexai/patch.ts +++ b/src/instrumentation/vertexai/patch.ts @@ -40,6 +40,7 @@ import { trace, Tracer } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' export function generateContentPatch ( originalMethod: (...args: any[]) => any, @@ -210,7 +211,7 @@ export function generateContentPatch ( } catch (error: any) { span.setStatus({ code: SpanStatusCode.ERROR }) span.recordException(error as Exception) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) @@ -272,7 +273,7 @@ async function * handleStreamResponse ( } catch (error: any) { span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { span.end() } diff --git a/src/instrumentation/weaviate/patch.ts b/src/instrumentation/weaviate/patch.ts index 48267119..08a879d4 100644 --- a/src/instrumentation/weaviate/patch.ts +++ b/src/instrumentation/weaviate/patch.ts @@ -18,6 +18,7 @@ import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/c import { setValueFromPath, getValueFromPath, addSpanEvent } from '@langtrace-utils/misc' import { DatabaseSpanAttributes, queryTypeToFunctionToProps, Event, Vendors } from '@langtrase/trace-attributes' import { Exception, SpanKind, SpanStatusCode, Tracer, context, trace } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' interface PatchBuilderArgs { clientInstance: any @@ -91,7 +92,7 @@ export const patchBuilderFunctions = function (this: any, { clientInstance, clie span.recordException(error as Exception) span.setStatus({ code: SpanStatusCode.ERROR }) span.end() - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } } ) diff --git a/src/utils/instrumentation.ts b/src/utils/instrumentation.ts index fe7a778e..577d3f7f 100644 --- a/src/utils/instrumentation.ts +++ b/src/utils/instrumentation.ts @@ -16,6 +16,7 @@ import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' import { SpanKind, trace, context, SpanStatusCode } from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' /** * * @param fn The function to be executed within the context of the root span. The function should accept the spanId and traceId as arguments @@ -45,7 +46,7 @@ export async function withLangTraceRootSpan ( code: SpanStatusCode.ERROR, message: error.message }) - throw error + throw new LangtraceSdkError(error.message as string, error.stack as string) } finally { // Ensure the root span is ended after function execution rootSpan.end() diff --git a/src/utils/langtrace.ts b/src/utils/langtrace.ts index 3924f8a2..2e914049 100644 --- a/src/utils/langtrace.ts +++ b/src/utils/langtrace.ts @@ -16,6 +16,7 @@ */ import { EvaluationAPIData, LangTraceEvaluation, LangtracePrompt } from '@langtrace-utils/types' import axios from 'axios' +import { LangtraceSdkError } from 'errors/sdk_error' /** * Fetches a prompt from the registry. @@ -40,7 +41,7 @@ export const getPromptFromRegistry = async (promptRegistryId: string, options?: const response = await axios.get(`${process.env.LANGTRACE_API_HOST}/api/promptset?${queryParams.toString()}`, { headers: { 'x-api-key': process.env.LANGTRACE_API_KEY } }) return response.data.prompts[0] as LangtracePrompt } catch (err: any) { - throw Error(`An error occured when trying to get the prompt from registry ${process.env.LANGTRACE_API_HOST}/api/promptset?${queryParams.toString()} ${JSON.stringify(err.stack)}`) + throw new LangtraceSdkError(`An error occured when trying to get the prompt from registry ${process.env.LANGTRACE_API_HOST}/api/promptset?${queryParams.toString()} ${JSON.stringify(err.stack)}`) } } @@ -65,7 +66,7 @@ export const sendUserFeedback = async ({ userId, userScore, traceId, spanId }: E await axios.post(`${process.env.LANGTRACE_API_HOST}/api/evaluation`, { userId, userScore, spanId, traceId }, { headers: { 'x-api-key': process.env.LANGTRACE_API_KEY } }) } } catch (err: any) { - throw Error(`An error occured while sending user feedback to langtrace ${process.env.LANGTRACE_API_HOST}/api/evaluation ${JSON.stringify(err.stack)}`) + throw new LangtraceSdkError(`An error occured while sending user feedback to langtrace ${process.env.LANGTRACE_API_HOST}/api/evaluation ${JSON.stringify(err.stack)}`) } } @@ -79,6 +80,6 @@ const getEvaluation = async (spanId: string): Promise Date: Tue, 8 Oct 2024 16:31:39 -0700 Subject: [PATCH 18/25] Fix ingestion url (#181) --- package.json | 2 +- src/constants/exporter/langtrace_exporter.ts | 2 +- src/extensions/langtraceexporter/langtrace_exporter.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e9c48b76..dae98ab1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.4.0", + "version": "6.0.0", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/constants/exporter/langtrace_exporter.ts b/src/constants/exporter/langtrace_exporter.ts index 2363d2e9..62d772dc 100644 --- a/src/constants/exporter/langtrace_exporter.ts +++ b/src/constants/exporter/langtrace_exporter.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export const LANGTRACE_REMOTE_URL = 'https://langtrace.ai' +export const LANGTRACE_REMOTE_URL = 'https://app.langtrace.ai' diff --git a/src/extensions/langtraceexporter/langtrace_exporter.ts b/src/extensions/langtraceexporter/langtrace_exporter.ts index f11e3905..578adf1d 100644 --- a/src/extensions/langtraceexporter/langtrace_exporter.ts +++ b/src/extensions/langtraceexporter/langtrace_exporter.ts @@ -28,7 +28,7 @@ export class LangTraceExporter implements SpanExporter { /** * * @param apiKey Your API key. If not set, the value will be read from the LANGTRACE_API_KEY environment variable - * @param apiHost The host of the LangTrace API. Default is https://langtrace.ai/api/trace. If set a POST request will be made to this URL with an array of ReadableSpan objects. + * @param apiHost The host of the LangTrace API. Default is https://app.langtrace.ai/api/trace. If set a POST request will be made to this URL with an array of ReadableSpan objects. * See https://github.com/open-telemetry/opentelemetry-js/blob/3c8c29ac8fdd71cd1ef78d2b35c65ced81db16f4/packages/opentelemetry-sdk-trace-base/src/export/ReadableSpan.ts#L29 */ constructor (apiKey: string, apiHost: string, headers?: Record) { From 200e5db475cde6645aed69114f11bd7bca5e47e1 Mon Sep 17 00:00:00 2001 From: obinnascale3 <109410793+obinnascale3@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:31:36 +0100 Subject: [PATCH 19/25] Obinna/s3 en 2724 add bedrock (#184) * add aws bedrock converse implementation * bump version * cleanup and update readme * update service type * fixes --------- Co-authored-by: Obinna Okafor Co-authored-by: Karthik Kalyanaraman --- README.md | 1 + package-lock.json | 1253 +++++++++++------ package.json | 5 +- src/examples/awsbedrock/converse-anthropic.ts | 61 + src/examples/entrypoint.ts | 2 +- src/examples/vercel/basic.ts | 8 +- src/init/init.ts | 2 + .../awsbedrock/instrumentation.ts | 75 + src/instrumentation/awsbedrock/patch.ts | 150 ++ 9 files changed, 1111 insertions(+), 446 deletions(-) create mode 100644 src/examples/awsbedrock/converse-anthropic.ts create mode 100644 src/instrumentation/awsbedrock/instrumentation.ts create mode 100644 src/instrumentation/awsbedrock/patch.ts diff --git a/README.md b/README.md index 8e189816..b7878067 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ Langtrace automatically captures traces from the following vendors: | Langchain | Framework | :x: | :white_check_mark: | | LlamaIndex | Framework | :white_check_mark: | :white_check_mark: | | Langgraph | Framework | :x: | :white_check_mark: | +| AWS Bedrock | Framework | :white_check_mark: | :x: | | DSPy | Framework | :x: | :white_check_mark: | | CrewAI | Framework | :x: | :white_check_mark: | | Ollama | Framework | :white_check_mark: | :white_check_mark: | diff --git a/package-lock.json b/package-lock.json index 3aed652c..7a921ac2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,16 @@ { "name": "@langtrase/typescript-sdk", - "version": "5.4.0", + "version": "6.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/typescript-sdk", - "version": "5.4.0", + "version": "6.1.0", "license": "Apache-2.0", "dependencies": { - "@langtrase/trace-attributes": "7.4.0", + "@aws-sdk/client-bedrock-runtime": "^3.670.0", + "@langtrase/trace-attributes": "7.5.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -495,7 +496,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", - "dev": true, "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", "@aws-crypto/supports-web-crypto": "^5.2.0", @@ -510,7 +510,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", - "dev": true, "dependencies": { "@aws-sdk/types": "^3.222.0", "@smithy/util-utf8": "^2.0.0", @@ -521,7 +520,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", - "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -533,7 +531,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", - "dev": true, "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" @@ -546,7 +543,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", - "dev": true, "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" @@ -559,7 +555,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", - "dev": true, "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", @@ -573,7 +568,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", - "dev": true, "dependencies": { "@aws-sdk/types": "^3.222.0", "@smithy/util-utf8": "^2.0.0", @@ -584,7 +578,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", - "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -596,7 +589,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", - "dev": true, "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" @@ -609,7 +601,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", - "dev": true, "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" @@ -622,7 +613,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", - "dev": true, "dependencies": { "tslib": "^2.6.2" } @@ -644,6 +634,518 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "node_modules/@aws-sdk/client-bedrock-runtime": { + "version": "3.670.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-bedrock-runtime/-/client-bedrock-runtime-3.670.0.tgz", + "integrity": "sha512-kDtXgyypCWc2cV8LJC0UXxlDWPBcs42b+NB1HiUn1U/jmPtDjPnIxnneRTnfJKZ03M3K2Ew20BOcpgXUXSZiiw==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.670.0", + "@aws-sdk/client-sts": "3.670.0", + "@aws-sdk/core": "3.667.0", + "@aws-sdk/credential-provider-node": "3.670.0", + "@aws-sdk/middleware-host-header": "3.667.0", + "@aws-sdk/middleware-logger": "3.667.0", + "@aws-sdk/middleware-recursion-detection": "3.667.0", + "@aws-sdk/middleware-user-agent": "3.669.0", + "@aws-sdk/region-config-resolver": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@aws-sdk/util-endpoints": "3.667.0", + "@aws-sdk/util-user-agent-browser": "3.670.0", + "@aws-sdk/util-user-agent-node": "3.669.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/eventstream-serde-browser": "^3.0.10", + "@smithy/eventstream-serde-config-resolver": "^3.0.7", + "@smithy/eventstream-serde-node": "^3.0.9", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-stream": "^3.1.9", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/client-sso": { + "version": "3.670.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.670.0.tgz", + "integrity": "sha512-J+oz6uSsDvk4pimMDnKJb1wsV216zTrejvMTIL4RhUD1QPIVVOpteTdUShcjZUIZnkcJZGI+cym/SFK0kuzTpg==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.667.0", + "@aws-sdk/middleware-host-header": "3.667.0", + "@aws-sdk/middleware-logger": "3.667.0", + "@aws-sdk/middleware-recursion-detection": "3.667.0", + "@aws-sdk/middleware-user-agent": "3.669.0", + "@aws-sdk/region-config-resolver": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@aws-sdk/util-endpoints": "3.667.0", + "@aws-sdk/util-user-agent-browser": "3.670.0", + "@aws-sdk/util-user-agent-node": "3.669.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.670.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.670.0.tgz", + "integrity": "sha512-4qDK2L36Q4J1lfemaHHd9ZxqKRaos3STp44qPAHf/8QyX6Uk5sXgZNVO2yWM7SIEtVKwwBh/fZAsdBkGPBfZcw==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.667.0", + "@aws-sdk/credential-provider-node": "3.670.0", + "@aws-sdk/middleware-host-header": "3.667.0", + "@aws-sdk/middleware-logger": "3.667.0", + "@aws-sdk/middleware-recursion-detection": "3.667.0", + "@aws-sdk/middleware-user-agent": "3.669.0", + "@aws-sdk/region-config-resolver": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@aws-sdk/util-endpoints": "3.667.0", + "@aws-sdk/util-user-agent-browser": "3.670.0", + "@aws-sdk/util-user-agent-node": "3.669.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.670.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/client-sts": { + "version": "3.670.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.670.0.tgz", + "integrity": "sha512-bExrNo8ZVWorS3cjMZKQnA2HWqDmAzcZoSN/cPVoPFNkHwdl1lzPxvcLzmhpIr48JHgKfybBjrbluDZfIYeEog==", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/client-sso-oidc": "3.670.0", + "@aws-sdk/core": "3.667.0", + "@aws-sdk/credential-provider-node": "3.670.0", + "@aws-sdk/middleware-host-header": "3.667.0", + "@aws-sdk/middleware-logger": "3.667.0", + "@aws-sdk/middleware-recursion-detection": "3.667.0", + "@aws-sdk/middleware-user-agent": "3.669.0", + "@aws-sdk/region-config-resolver": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@aws-sdk/util-endpoints": "3.667.0", + "@aws-sdk/util-user-agent-browser": "3.670.0", + "@aws-sdk/util-user-agent-node": "3.669.0", + "@smithy/config-resolver": "^3.0.9", + "@smithy/core": "^2.4.8", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/hash-node": "^3.0.7", + "@smithy/invalid-dependency": "^3.0.7", + "@smithy/middleware-content-length": "^3.0.9", + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-base64": "^3.0.0", + "@smithy/util-body-length-browser": "^3.0.0", + "@smithy/util-body-length-node": "^3.0.0", + "@smithy/util-defaults-mode-browser": "^3.0.23", + "@smithy/util-defaults-mode-node": "^3.0.23", + "@smithy/util-endpoints": "^2.1.3", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", + "@smithy/util-utf8": "^3.0.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/core": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.667.0.tgz", + "integrity": "sha512-pMcDVI7Tmdsc8R3sDv0Omj/4iRParGY+uJtAfF669WnZfDfaBQaix2Mq7+Mu08vdjqO9K3gicFvjk9S1VLmOKA==", + "dependencies": { + "@aws-sdk/types": "3.667.0", + "@smithy/core": "^2.4.8", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/property-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/signature-v4": "^4.2.0", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-middleware": "^3.0.7", + "fast-xml-parser": "4.4.1", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-env": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.667.0.tgz", + "integrity": "sha512-zZbrkkaPc54WXm+QAnpuv0LPNfsts0HPPd+oCECGs7IQRaFsGj187cwvPg9RMWDFZqpm64MdBDoA8OQHsqzYCw==", + "dependencies": { + "@aws-sdk/core": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-http": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.667.0.tgz", + "integrity": "sha512-sjtybFfERZWiqTY7fswBxKQLvUkiCucOWyqh3IaPo/4nE1PXRnaZCVG0+kRBPrYIxWqiVwytvZzMJy8sVZcG0A==", + "dependencies": { + "@aws-sdk/core": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-stream": "^3.1.9", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.670.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.670.0.tgz", + "integrity": "sha512-TB1gacUj75leaTt2JsCTzygDSIk4ksv9uZoR7VenlgFPRktyOeT+fapwIVBeB2Qg7b9uxAY2K5XkKstDZyBEEw==", + "dependencies": { + "@aws-sdk/core": "3.667.0", + "@aws-sdk/credential-provider-env": "3.667.0", + "@aws-sdk/credential-provider-http": "3.667.0", + "@aws-sdk/credential-provider-process": "3.667.0", + "@aws-sdk/credential-provider-sso": "3.670.0", + "@aws-sdk/credential-provider-web-identity": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.670.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-node": { + "version": "3.670.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.670.0.tgz", + "integrity": "sha512-zwNrRYzubk4CaZ7zebeDhxsm8QtNWkbGKopZPOaZSnd5uqUGRcmx4ccVRngWUK68XDP44aEUWC8iU5Pc7btpHQ==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.667.0", + "@aws-sdk/credential-provider-http": "3.667.0", + "@aws-sdk/credential-provider-ini": "3.670.0", + "@aws-sdk/credential-provider-process": "3.667.0", + "@aws-sdk/credential-provider-sso": "3.670.0", + "@aws-sdk/credential-provider-web-identity": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-process": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.667.0.tgz", + "integrity": "sha512-HZHnvop32fKgsNHkdhVaul7UzQ25sEc0j9yqA4bjhtbk0ECl42kj3f1pJ+ZU/YD9ut8lMJs/vVqiOdNThVdeBw==", + "dependencies": { + "@aws-sdk/core": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.670.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.670.0.tgz", + "integrity": "sha512-5PkA8BOy4q57Vhe9AESoHKZ7vjRbElNPKjXA4qC01xY+DitClRFz4O3B9sMzFp0PHlz9nDVSXXKgq0yzF/nAag==", + "dependencies": { + "@aws-sdk/client-sso": "3.670.0", + "@aws-sdk/core": "3.667.0", + "@aws-sdk/token-providers": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.667.0.tgz", + "integrity": "sha512-t8CFlZMD/1p/8Cli3rvRiTJpjr/8BO64gw166AHgFZYSN2h95L2l1tcW0jpsc3PprA32nLg1iQVKYt4WGM4ugw==", + "dependencies": { + "@aws-sdk/core": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sts": "^3.667.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-host-header": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.667.0.tgz", + "integrity": "sha512-Z7fIAMQnPegs7JjAQvlOeWXwpMRfegh5eCoIP6VLJIeR6DLfYKbP35JBtt98R6DXslrN2RsbTogjbxPEDQfw1w==", + "dependencies": { + "@aws-sdk/types": "3.667.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-logger": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.667.0.tgz", + "integrity": "sha512-PtTRNpNm/5c746jRgZCNg4X9xEJIwggkGJrF0GP9AB1ANg4pc/sF2Fvn1NtqPe9wtQ2stunJprnm5WkCHN7QiA==", + "dependencies": { + "@aws-sdk/types": "3.667.0", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.667.0.tgz", + "integrity": "sha512-U5glWD3ehFohzpUpopLtmqAlDurGWo2wRGPNgi4SwhWU7UDt6LS7E/UvJjqC0CUrjlzOw+my2A+Ncf+fisMhxQ==", + "dependencies": { + "@aws-sdk/types": "3.667.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.669.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.669.0.tgz", + "integrity": "sha512-K8ScPi45zjJrj5Y2gRqVsvKKQCQbvQBfYGcBw9ZOx9TTavH80bOCBjWg/GFnvs4f37tqVc1wMN2oGvcTF6HveQ==", + "dependencies": { + "@aws-sdk/core": "3.667.0", + "@aws-sdk/types": "3.667.0", + "@aws-sdk/util-endpoints": "3.667.0", + "@smithy/core": "^2.4.8", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/region-config-resolver": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.667.0.tgz", + "integrity": "sha512-iNr+JhhA902JMKHG9IwT9YdaEx6KGl6vjAL5BRNeOjfj4cZYMog6Lz/IlfOAltMtT0w88DAHDEFrBd2uO0l2eg==", + "dependencies": { + "@aws-sdk/types": "3.667.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", + "@smithy/util-config-provider": "^3.0.0", + "@smithy/util-middleware": "^3.0.7", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/token-providers": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.667.0.tgz", + "integrity": "sha512-ZecJlG8p6D4UTYlBHwOWX6nknVtw/OBJ3yPXTSajBjhUlj9lE2xvejI8gl4rqkyLXk7z3bki+KR4tATbMaM9yg==", + "dependencies": { + "@aws-sdk/types": "3.667.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-sso-oidc": "^3.667.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/types": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.667.0.tgz", + "integrity": "sha512-gYq0xCsqFfQaSL/yT1Gl1vIUjtsg7d7RhnUfsXaHt8xTxOKRTdH9GjbesBjXOzgOvB0W0vfssfreSNGFlOOMJg==", + "dependencies": { + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-endpoints": { + "version": "3.667.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.667.0.tgz", + "integrity": "sha512-X22SYDAuQJWnkF1/q17pkX3nGw5XMD9YEUbmt87vUnRq7iyJ3JOpl6UKOBeUBaL838wA5yzdbinmCITJ/VZ1QA==", + "dependencies": { + "@aws-sdk/types": "3.667.0", + "@smithy/types": "^3.5.0", + "@smithy/util-endpoints": "^2.1.3", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.670.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.670.0.tgz", + "integrity": "sha512-iRynWWazqEcCKwGMcQcywKTDLdLvqts1Yx474U64I9OKQXXwhOwhXbF5CAPSRta86lkVNAVYJa/0Bsv45pNn1A==", + "dependencies": { + "@aws-sdk/types": "3.667.0", + "@smithy/types": "^3.5.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/client-bedrock-runtime/node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.669.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.669.0.tgz", + "integrity": "sha512-9jxCYrgggy2xd44ZASqI7AMiRVaSiFp+06Kg8BQSU0ijKpBJlwcsqIS8pDT/n6LxuOw2eV5ipvM2C0r1iKzrGA==", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.669.0", + "@aws-sdk/types": "3.667.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, "node_modules/@aws-sdk/client-cognito-identity": { "version": "3.632.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.632.0.tgz", @@ -1360,7 +1862,6 @@ "version": "3.609.0", "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.609.0.tgz", "integrity": "sha512-+Tqnh9w0h2LcrUsdXyT1F8mNhXz+tVYBtP19LpeEGntmvHwa2XzvLUCWpoIAIVsHp5+HdB2X9Sn0KAtmbFXc2Q==", - "dev": true, "dependencies": { "@smithy/types": "^3.3.0", "tslib": "^2.6.2" @@ -1388,7 +1889,6 @@ "version": "3.568.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.568.0.tgz", "integrity": "sha512-3nh4TINkXYr+H41QaPelCceEB2FXP3fxp93YZXB/kqJvX0U9j0N0Uk45gvsjmEPzG8XxkPEeLIfT2I1M7A6Lig==", - "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -2104,10 +2604,9 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" }, "node_modules/@langtrase/trace-attributes": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.4.0.tgz", - "integrity": "sha512-LmaUGdr03ouh/08nQkBz01W6BLGUyw6V99z2f9CHJKrq1X+VU+aXzEuiW6goEmwWFxrn7LRhEOo5l2j0CAYD2w==", - "license": "MIT", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.5.0.tgz", + "integrity": "sha512-U+2dMRJaRv0R6i9qrzh1hXREkrqg01EboCDfrovXeXySFsVGCuvSD8iavXzheOSWVLy9XbiM6gJjekdUFhAhQg==", "dependencies": { "js-tiktoken": "^1.0.14", "json-schema-to-typescript": "^14.1.0", @@ -4417,12 +4916,11 @@ "dev": true }, "node_modules/@smithy/abort-controller": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.1.tgz", - "integrity": "sha512-MBJBiidoe+0cTFhyxT8g+9g7CeVccLM0IOKKUMCNQ1CNMJ/eIfoo0RTfVrXOONEI1UCN1W+zkiHSbzUNE9dZtQ==", - "dev": true, + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-3.1.5.tgz", + "integrity": "sha512-DhNPnqTqPoG8aZ5dWkFOgsuY+i0GQ3CI6hMmvCoduNsnU9gUZWZBwGfDQsTTB7NvFPkom1df7jMIJWU90kuXXg==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4430,15 +4928,14 @@ } }, "node_modules/@smithy/config-resolver": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.5.tgz", - "integrity": "sha512-SkW5LxfkSI1bUC74OtfBbdz+grQXYiPYolyu8VfpLIjEoN/sHVBlLeGXMQ1vX4ejkgfv6sxVbQJ32yF2cl1veA==", - "dev": true, + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-3.0.9.tgz", + "integrity": "sha512-5d9oBf40qC7n2xUoHmntKLdqsyTMMo/r49+eqSIjJ73eDfEtljAxEhzIQ3bkgXJtR3xiv7YzMT/3FF3ORkjWdg==", "dependencies": { - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", "@smithy/util-config-provider": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", + "@smithy/util-middleware": "^3.0.7", "tslib": "^2.6.2" }, "engines": { @@ -4446,19 +4943,18 @@ } }, "node_modules/@smithy/core": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.4.0.tgz", - "integrity": "sha512-cHXq+FneIF/KJbt4q4pjN186+Jf4ZB0ZOqEaZMBhT79srEyGDDBV31NqBRBjazz8ppQ1bJbDJMY9ba5wKFV36w==", - "dev": true, - "dependencies": { - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-retry": "^3.0.15", - "@smithy/middleware-serde": "^3.0.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-2.4.8.tgz", + "integrity": "sha512-x4qWk7p/a4dcf7Vxb2MODIf4OIcqNbK182WxRvZ/3oKPrf/6Fdic5sSElhO1UtXpWKBazWfqg0ZEK9xN1DsuHA==", + "dependencies": { + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-retry": "^3.0.23", + "@smithy/middleware-serde": "^3.0.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", "@smithy/util-body-length-browser": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", + "@smithy/util-middleware": "^3.0.7", "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" }, @@ -4467,15 +4963,14 @@ } }, "node_modules/@smithy/credential-provider-imds": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.2.0.tgz", - "integrity": "sha512-0SCIzgd8LYZ9EJxUjLXBmEKSZR/P/w6l7Rz/pab9culE/RWuqelAKGJvn5qUOl8BgX8Yj5HWM50A5hiB/RzsgA==", - "dev": true, + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-3.2.4.tgz", + "integrity": "sha512-S9bb0EIokfYEuar4kEbLta+ivlKCWOCFsLZuilkNy9i0uEUEHSi47IFLPaxqqCl+0ftKmcOTHayY5nQhAuq7+w==", "dependencies": { - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/property-provider": "^3.1.7", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", "tslib": "^2.6.2" }, "engines": { @@ -4518,26 +5013,144 @@ "node": ">=14.0.0" } }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-3.0.10.tgz", + "integrity": "sha512-1i9aMY6Pl/SmA6NjvidxnfBLHMPzhKu2BP148pEt5VwhMdmXn36PE2kWKGa9Hj8b0XGtCTRucpCncylevCtI7g==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^3.0.9", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-3.0.7.tgz", + "integrity": "sha512-eVzhGQBPEqXXYHvIUku0jMTxd4gDvenRzUQPTmKVWdRvp9JUCKrbAXGQRYiGxUYq9+cqQckRm0wq3kTWnNtDhw==", + "dependencies": { + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-3.0.9.tgz", + "integrity": "sha512-JE0Guqvt0xsmfQ5y1EI342/qtJqznBv8cJqkHZV10PwC8GWGU5KNgFbQnsVCcX+xF+qIqwwfRmeWoJCjuOLmng==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^3.0.9", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-3.0.9.tgz", + "integrity": "sha512-bydfgSisfepCufw9kCEnWRxqxJFzX/o8ysXWv+W9F2FIyiaEwZ/D8bBKINbh4ONz3i05QJ1xE7A5OKYvgJsXaw==", + "dependencies": { + "@smithy/eventstream-codec": "^3.1.6", + "@smithy/types": "^3.5.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal/node_modules/@aws-crypto/crc32": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-5.2.0.tgz", + "integrity": "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal/node_modules/@aws-crypto/util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", + "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/eventstream-serde-universal/node_modules/@smithy/eventstream-codec": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-3.1.6.tgz", + "integrity": "sha512-SBiOYPBH+5wOyPS7lfI150ePfGLhnp/eTu5RnV9xvhGvRiKfnl6HzRK9wehBph+il8FxS9KTeadx7Rcmf1GLPQ==", + "dependencies": { + "@aws-crypto/crc32": "5.2.0", + "@smithy/types": "^3.5.0", + "@smithy/util-hex-encoding": "^3.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@smithy/eventstream-serde-universal/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@smithy/fetch-http-handler": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-3.2.4.tgz", - "integrity": "sha512-kBprh5Gs5h7ug4nBWZi1FZthdqSM+T7zMmsZxx0IBvWUn7dK3diz2SHn7Bs4dQGFDk8plDv375gzenDoNwrXjg==", - "dev": true, + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-3.2.9.tgz", + "integrity": "sha512-hYNVQOqhFQ6vOpenifFME546f0GfJn2OiQ3M0FDmuUu8V/Uiwy2wej7ZXxFBNqdx0R5DZAqWM1l6VRhGz8oE6A==", "dependencies": { - "@smithy/protocol-http": "^4.1.0", - "@smithy/querystring-builder": "^3.0.3", - "@smithy/types": "^3.3.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/querystring-builder": "^3.0.7", + "@smithy/types": "^3.5.0", "@smithy/util-base64": "^3.0.0", "tslib": "^2.6.2" } }, "node_modules/@smithy/hash-node": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.3.tgz", - "integrity": "sha512-2ctBXpPMG+B3BtWSGNnKELJ7SH9e4TNefJS0cd2eSkOOROeBnnVBnAy9LtJ8tY4vUEoe55N4CNPxzbWvR39iBw==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-3.0.7.tgz", + "integrity": "sha512-SAGHN+QkrwcHFjfWzs/czX94ZEjPJ0CrWJS3M43WswDXVEuP4AVy9gJ3+AF6JQHZD13bojmuf/Ap/ItDeZ+Qfw==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "@smithy/util-buffer-from": "^3.0.0", "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" @@ -4547,12 +5160,11 @@ } }, "node_modules/@smithy/invalid-dependency": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.3.tgz", - "integrity": "sha512-ID1eL/zpDULmHJbflb864k72/SNOZCADRc9i7Exq3RUNJw6raWUSlFEQ+3PX3EYs++bTxZB2dE9mEHTQLv61tw==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-3.0.7.tgz", + "integrity": "sha512-Bq00GsAhHeYSuZX8Kpu4sbI9agH2BNYnqUmmbTGWOhki9NVsWn2jFr896vvoTMH8KAjNX/ErC/8t5QHuEXG+IA==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" } }, @@ -4560,7 +5172,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-3.0.0.tgz", "integrity": "sha512-+Fsu6Q6C4RSJiy81Y8eApjEB5gVtM+oFKTffg+jSuwtvomJJrhUJBu2zS8wjXSgH/g1MKEWrzyChTBe6clb5FQ==", - "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -4569,13 +5180,12 @@ } }, "node_modules/@smithy/middleware-content-length": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-3.0.5.tgz", - "integrity": "sha512-ILEzC2eyxx6ncej3zZSwMpB5RJ0zuqH7eMptxC4KN3f+v9bqT8ohssKbhNR78k/2tWW+KS5Spw+tbPF4Ejyqvw==", - "dev": true, + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-3.0.9.tgz", + "integrity": "sha512-t97PidoGElF9hTtLCrof32wfWMqC5g2SEJNxaVH3NjlatuNGsdxXRYO/t+RPnxA15RpYiS0f+zG7FuE2DeGgjA==", "dependencies": { - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4583,17 +5193,16 @@ } }, "node_modules/@smithy/middleware-endpoint": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.1.0.tgz", - "integrity": "sha512-5y5aiKCEwg9TDPB4yFE7H6tYvGFf1OJHNczeY10/EFF8Ir8jZbNntQJxMWNfeQjC1mxPsaQ6mR9cvQbf+0YeMw==", - "dev": true, - "dependencies": { - "@smithy/middleware-serde": "^3.0.3", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", - "@smithy/url-parser": "^3.0.3", - "@smithy/util-middleware": "^3.0.3", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-3.1.4.tgz", + "integrity": "sha512-/ChcVHekAyzUbyPRI8CzPPLj6y8QRAfJngWcLMgsWxKVzw/RzBV69mSOzJYDD3pRwushA1+5tHtPF8fjmzBnrQ==", + "dependencies": { + "@smithy/middleware-serde": "^3.0.7", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", + "@smithy/url-parser": "^3.0.7", + "@smithy/util-middleware": "^3.0.7", "tslib": "^2.6.2" }, "engines": { @@ -4601,18 +5210,17 @@ } }, "node_modules/@smithy/middleware-retry": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.15.tgz", - "integrity": "sha512-iTMedvNt1ApdvkaoE8aSDuwaoc+BhvHqttbA/FO4Ty+y/S5hW6Ci/CTScG7vam4RYJWZxdTElc3MEfHRVH6cgQ==", - "dev": true, - "dependencies": { - "@smithy/node-config-provider": "^3.1.4", - "@smithy/protocol-http": "^4.1.0", - "@smithy/service-error-classification": "^3.0.3", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", - "@smithy/util-middleware": "^3.0.3", - "@smithy/util-retry": "^3.0.3", + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-3.0.23.tgz", + "integrity": "sha512-x9PbGXxkcXIpm6L26qRSCC+eaYcHwybRmqU8LO/WM2RRlW0g8lz6FIiKbKgGvHuoK3dLZRiQVSQJveiCzwnA5A==", + "dependencies": { + "@smithy/node-config-provider": "^3.1.8", + "@smithy/protocol-http": "^4.1.4", + "@smithy/service-error-classification": "^3.0.7", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", + "@smithy/util-middleware": "^3.0.7", + "@smithy/util-retry": "^3.0.7", "tslib": "^2.6.2", "uuid": "^9.0.1" }, @@ -4621,12 +5229,11 @@ } }, "node_modules/@smithy/middleware-serde": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.3.tgz", - "integrity": "sha512-puUbyJQBcg9eSErFXjKNiGILJGtiqmuuNKEYNYfUD57fUl4i9+mfmThtQhvFXU0hCVG0iEJhvQUipUf+/SsFdA==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-3.0.7.tgz", + "integrity": "sha512-VytaagsQqtH2OugzVTq4qvjkLNbWehHfGcGr0JLJmlDRrNCeZoWkWsSOw1nhS/4hyUUWF/TLGGml4X/OnEep5g==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4634,12 +5241,11 @@ } }, "node_modules/@smithy/middleware-stack": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.3.tgz", - "integrity": "sha512-r4klY9nFudB0r9UdSMaGSyjyQK5adUyPnQN/ZM6M75phTxOdnc/AhpvGD1fQUvgmqjQEBGCwpnPbDm8pH5PapA==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-3.0.7.tgz", + "integrity": "sha512-EyTbMCdqS1DoeQsO4gI7z2Gzq1MoRFAeS8GkFYIwbedB7Lp5zlLHJdg+56tllIIG5Hnf9ZWX48YKSHlsKvugGA==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4647,14 +5253,13 @@ } }, "node_modules/@smithy/node-config-provider": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-3.1.4.tgz", - "integrity": "sha512-YvnElQy8HR4vDcAjoy7Xkx9YT8xZP4cBXcbJSgm/kxmiQu08DwUwj8rkGnyoJTpfl/3xYHH+d8zE+eHqoDCSdQ==", - "dev": true, + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-3.1.8.tgz", + "integrity": "sha512-E0rU0DglpeJn5ge64mk8wTGEXcQwmpUTY5Zr7IzTpDLmHKiIamINERNZYrPQjg58Ck236sEKSwRSHA4CwshU6Q==", "dependencies": { - "@smithy/property-provider": "^3.1.3", - "@smithy/shared-ini-file-loader": "^3.1.4", - "@smithy/types": "^3.3.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/shared-ini-file-loader": "^3.1.8", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4662,15 +5267,14 @@ } }, "node_modules/@smithy/node-http-handler": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.1.4.tgz", - "integrity": "sha512-+UmxgixgOr/yLsUxcEKGH0fMNVteJFGkmRltYFHnBMlogyFdpzn2CwqWmxOrfJELhV34v0WSlaqG1UtE1uXlJg==", - "dev": true, + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-3.2.4.tgz", + "integrity": "sha512-49reY3+JgLMFNm7uTAKBWiKCA6XSvkNp9FqhVmusm2jpVnHORYFeFZ704LShtqWfjZW/nhX+7Iexyb6zQfXYIQ==", "dependencies": { - "@smithy/abort-controller": "^3.1.1", - "@smithy/protocol-http": "^4.1.0", - "@smithy/querystring-builder": "^3.0.3", - "@smithy/types": "^3.3.0", + "@smithy/abort-controller": "^3.1.5", + "@smithy/protocol-http": "^4.1.4", + "@smithy/querystring-builder": "^3.0.7", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4678,12 +5282,11 @@ } }, "node_modules/@smithy/property-provider": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.3.tgz", - "integrity": "sha512-zahyOVR9Q4PEoguJ/NrFP4O7SMAfYO1HLhB18M+q+Z4KFd4V2obiMnlVoUFzFLSPeVt1POyNWneHHrZaTMoc/g==", - "dev": true, + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-3.1.7.tgz", + "integrity": "sha512-QfzLi1GPMisY7bAM5hOUqBdGYnY5S2JAlr201pghksrQv139f8iiiMalXtjczIP5f6owxFn3MINLNUNvUkgtPw==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4691,12 +5294,11 @@ } }, "node_modules/@smithy/protocol-http": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.1.0.tgz", - "integrity": "sha512-dPVoHYQ2wcHooGXg3LQisa1hH0e4y0pAddPMeeUPipI1tEOqL6A4N0/G7abeq+K8wrwSgjk4C0wnD1XZpJm5aA==", - "dev": true, + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-4.1.4.tgz", + "integrity": "sha512-MlWK8eqj0JlpZBnWmjQLqmFp71Ug00P+m72/1xQB3YByXD4zZ+y9N4hYrR0EDmrUCZIkyATWHOXFgtavwGDTzQ==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4704,12 +5306,11 @@ } }, "node_modules/@smithy/querystring-builder": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.3.tgz", - "integrity": "sha512-vyWckeUeesFKzCDaRwWLUA1Xym9McaA6XpFfAK5qI9DKJ4M33ooQGqvM4J+LalH4u/Dq9nFiC8U6Qn1qi0+9zw==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-3.0.7.tgz", + "integrity": "sha512-65RXGZZ20rzqqxTsChdqSpbhA6tdt5IFNgG6o7e1lnPVLCe6TNWQq4rTl4N87hTDD8mV4IxJJnvyE7brbnRkQw==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "@smithy/util-uri-escape": "^3.0.0", "tslib": "^2.6.2" }, @@ -4718,12 +5319,11 @@ } }, "node_modules/@smithy/querystring-parser": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.3.tgz", - "integrity": "sha512-zahM1lQv2YjmznnfQsWbYojFe55l0SLG/988brlLv1i8z3dubloLF+75ATRsqPBboUXsW6I9CPGE5rQgLfY0vQ==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-3.0.7.tgz", + "integrity": "sha512-Fouw4KJVWqqUVIu1gZW8BH2HakwLz6dvdrAhXeXfeymOBrZw+hcqaWs+cS1AZPVp4nlbeIujYrKA921ZW2WMPA==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4731,24 +5331,22 @@ } }, "node_modules/@smithy/service-error-classification": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.3.tgz", - "integrity": "sha512-Jn39sSl8cim/VlkLsUhRFq/dKDnRUFlfRkvhOJaUbLBXUsLRLNf9WaxDv/z9BjuQ3A6k/qE8af1lsqcwm7+DaQ==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-3.0.7.tgz", + "integrity": "sha512-91PRkTfiBf9hxkIchhRKJfl1rsplRDyBnmyFca3y0Z3x/q0JJN480S83LBd8R6sBCkm2bBbqw2FHp0Mbh+ecSA==", "dependencies": { - "@smithy/types": "^3.3.0" + "@smithy/types": "^3.5.0" }, "engines": { "node": ">=16.0.0" } }, "node_modules/@smithy/shared-ini-file-loader": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.4.tgz", - "integrity": "sha512-qMxS4hBGB8FY2GQqshcRUy1K6k8aBWP5vwm8qKkCT3A9K2dawUwOIJfqh9Yste/Bl0J2lzosVyrXDj68kLcHXQ==", - "dev": true, + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-3.1.8.tgz", + "integrity": "sha512-0NHdQiSkeGl0ICQKcJQ2lCOKH23Nb0EaAa7RDRId6ZqwXkw4LJyIyZ0t3iusD4bnKYDPLGy2/5e2rfUhrt0Acw==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4756,16 +5354,15 @@ } }, "node_modules/@smithy/signature-v4": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-4.1.0.tgz", - "integrity": "sha512-aRryp2XNZeRcOtuJoxjydO6QTaVhxx/vjaR+gx7ZjaFgrgPRyZ3HCTbfwqYj6ZWEBHkCSUfcaymKPURaByukag==", - "dev": true, + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-4.2.0.tgz", + "integrity": "sha512-LafbclHNKnsorMgUkKm7Tk7oJ7xizsZ1VwqhGKqoCIrXh4fqDDp73fK99HOEEgcsQbtemmeY/BPv0vTVYYUNEQ==", "dependencies": { "@smithy/is-array-buffer": "^3.0.0", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", "@smithy/util-hex-encoding": "^3.0.0", - "@smithy/util-middleware": "^3.0.3", + "@smithy/util-middleware": "^3.0.7", "@smithy/util-uri-escape": "^3.0.0", "@smithy/util-utf8": "^3.0.0", "tslib": "^2.6.2" @@ -4775,16 +5372,15 @@ } }, "node_modules/@smithy/smithy-client": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.2.0.tgz", - "integrity": "sha512-pDbtxs8WOhJLJSeaF/eAbPgXg4VVYFlRcL/zoNYA5WbG3wBL06CHtBSg53ppkttDpAJ/hdiede+xApip1CwSLw==", - "dev": true, - "dependencies": { - "@smithy/middleware-endpoint": "^3.1.0", - "@smithy/middleware-stack": "^3.0.3", - "@smithy/protocol-http": "^4.1.0", - "@smithy/types": "^3.3.0", - "@smithy/util-stream": "^3.1.3", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-3.4.0.tgz", + "integrity": "sha512-nOfJ1nVQsxiP6srKt43r2My0Gp5PLWCW2ASqUioxIiGmu6d32v4Nekidiv5qOmmtzIrmaD+ADX5SKHUuhReeBQ==", + "dependencies": { + "@smithy/middleware-endpoint": "^3.1.4", + "@smithy/middleware-stack": "^3.0.7", + "@smithy/protocol-http": "^4.1.4", + "@smithy/types": "^3.5.0", + "@smithy/util-stream": "^3.1.9", "tslib": "^2.6.2" }, "engines": { @@ -4792,10 +5388,9 @@ } }, "node_modules/@smithy/types": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.3.0.tgz", - "integrity": "sha512-IxvBBCTFDHbVoK7zIxqA1ZOdc4QfM5HM7rGleCuHi7L1wnKv5Pn69xXJQ9hgxH60ZVygH9/JG0jRgtUncE3QUA==", - "dev": true, + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-3.5.0.tgz", + "integrity": "sha512-QN0twHNfe8mNJdH9unwsCK13GURU7oEAZqkBI+rsvpv1jrmserO+WnLE7jidR9W/1dxwZ0u/CB01mV2Gms/K2Q==", "dependencies": { "tslib": "^2.6.2" }, @@ -4804,13 +5399,12 @@ } }, "node_modules/@smithy/url-parser": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.3.tgz", - "integrity": "sha512-pw3VtZtX2rg+s6HMs6/+u9+hu6oY6U7IohGhVNnjbgKy86wcIsSZwgHrFR+t67Uyxvp4Xz3p3kGXXIpTNisq8A==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-3.0.7.tgz", + "integrity": "sha512-70UbSSR8J97c1rHZOWhl+VKiZDqHWxs/iW8ZHrHp5fCCPLSBE7GcUlUvKSle3Ca+J9LLbYCj/A79BxztBvAfpA==", "dependencies": { - "@smithy/querystring-parser": "^3.0.3", - "@smithy/types": "^3.3.0", + "@smithy/querystring-parser": "^3.0.7", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" } }, @@ -4818,7 +5412,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-3.0.0.tgz", "integrity": "sha512-Kxvoh5Qtt0CDsfajiZOCpJxgtPHXOKwmM+Zy4waD43UoEMA+qPxxa98aE/7ZhdnBFZFXMOiBR5xbcaMhLtznQQ==", - "dev": true, "dependencies": { "@smithy/util-buffer-from": "^3.0.0", "@smithy/util-utf8": "^3.0.0", @@ -4832,7 +5425,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-3.0.0.tgz", "integrity": "sha512-cbjJs2A1mLYmqmyVl80uoLTJhAcfzMOyPgjwAYusWKMdLeNtzmMz9YxNl3/jRLoxSS3wkqkf0jwNdtXWtyEBaQ==", - "dev": true, "dependencies": { "tslib": "^2.6.2" } @@ -4841,7 +5433,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-3.0.0.tgz", "integrity": "sha512-Tj7pZ4bUloNUP6PzwhN7K386tmSmEET9QtQg0TgdNOnxhZvCssHji+oZTUIuzxECRfG8rdm2PMw2WCFs6eIYkA==", - "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -4853,7 +5444,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", "integrity": "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA==", - "dev": true, "dependencies": { "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" @@ -4866,7 +5456,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-3.0.0.tgz", "integrity": "sha512-pbjk4s0fwq3Di/ANL+rCvJMKM5bzAQdE5S/6RL5NXgMExFAi6UgQMPOm5yPaIWPpr+EOXKXRonJ3FoxKf4mCJQ==", - "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -4875,14 +5464,13 @@ } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.15.tgz", - "integrity": "sha512-FZ4Psa3vjp8kOXcd3HJOiDPBCWtiilLl57r0cnNtq/Ga9RSDrM5ERL6xt+tO43+2af6Pn5Yp92x2n5vPuduNfg==", - "dev": true, + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.23.tgz", + "integrity": "sha512-Y07qslyRtXDP/C5aWKqxTPBl4YxplEELG3xRrz2dnAQ6Lq/FgNrcKWmV561nNaZmFH+EzeGOX3ZRMbU8p1T6Nw==", "dependencies": { - "@smithy/property-provider": "^3.1.3", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", + "@smithy/property-provider": "^3.1.7", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", "bowser": "^2.11.0", "tslib": "^2.6.2" }, @@ -4891,17 +5479,16 @@ } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.15.tgz", - "integrity": "sha512-KSyAAx2q6d0t6f/S4XB2+3+6aQacm3aLMhs9aLMqn18uYGUepbdssfogW5JQZpc6lXNBnp0tEnR5e9CEKmEd7A==", - "dev": true, - "dependencies": { - "@smithy/config-resolver": "^3.0.5", - "@smithy/credential-provider-imds": "^3.2.0", - "@smithy/node-config-provider": "^3.1.4", - "@smithy/property-provider": "^3.1.3", - "@smithy/smithy-client": "^3.2.0", - "@smithy/types": "^3.3.0", + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.23.tgz", + "integrity": "sha512-9Y4WH7f0vnDGuHUa4lGX9e2p+sMwODibsceSV6rfkZOvMC+BY3StB2LdO1NHafpsyHJLpwAgChxQ38tFyd6vkg==", + "dependencies": { + "@smithy/config-resolver": "^3.0.9", + "@smithy/credential-provider-imds": "^3.2.4", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/property-provider": "^3.1.7", + "@smithy/smithy-client": "^3.4.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4909,13 +5496,12 @@ } }, "node_modules/@smithy/util-endpoints": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.0.5.tgz", - "integrity": "sha512-ReQP0BWihIE68OAblC/WQmDD40Gx+QY1Ez8mTdFMXpmjfxSyz2fVQu3A4zXRfQU9sZXtewk3GmhfOHswvX+eNg==", - "dev": true, + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-2.1.3.tgz", + "integrity": "sha512-34eACeKov6jZdHqS5hxBMJ4KyWKztTMulhuQ2UdOoP6vVxMLrOKUqIXAwJe/wiWMhXhydLW664B02CNpQBQ4Aw==", "dependencies": { - "@smithy/node-config-provider": "^3.1.4", - "@smithy/types": "^3.3.0", + "@smithy/node-config-provider": "^3.1.8", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4926,7 +5512,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-3.0.0.tgz", "integrity": "sha512-eFndh1WEK5YMUYvy3lPlVmYY/fZcQE1D8oSf41Id2vCeIkKJXPcYDCZD+4+xViI6b1XSd7tE+s5AmXzz5ilabQ==", - "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -4935,12 +5520,11 @@ } }, "node_modules/@smithy/util-middleware": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.3.tgz", - "integrity": "sha512-l+StyYYK/eO3DlVPbU+4Bi06Jjal+PFLSMmlWM1BEwyLxZ3aKkf1ROnoIakfaA7mC6uw3ny7JBkau4Yc+5zfWw==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-3.0.7.tgz", + "integrity": "sha512-OVA6fv/3o7TMJTpTgOi1H5OTwnuUa8hzRzhSFDtZyNxi6OZ70L/FHattSmhE212I7b6WSOJAAmbYnvcjTHOJCA==", "dependencies": { - "@smithy/types": "^3.3.0", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4948,13 +5532,12 @@ } }, "node_modules/@smithy/util-retry": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.3.tgz", - "integrity": "sha512-AFw+hjpbtVApzpNDhbjNG5NA3kyoMs7vx0gsgmlJF4s+yz1Zlepde7J58zpIRIsdjc+emhpAITxA88qLkPF26w==", - "dev": true, + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-3.0.7.tgz", + "integrity": "sha512-nh1ZO1vTeo2YX1plFPSe/OXaHkLAHza5jpokNiiKX2M5YpNUv6RxGJZhpfmiR4jSvVHCjIDmILjrxKmP+/Ghug==", "dependencies": { - "@smithy/service-error-classification": "^3.0.3", - "@smithy/types": "^3.3.0", + "@smithy/service-error-classification": "^3.0.7", + "@smithy/types": "^3.5.0", "tslib": "^2.6.2" }, "engines": { @@ -4962,14 +5545,13 @@ } }, "node_modules/@smithy/util-stream": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-3.1.3.tgz", - "integrity": "sha512-FIv/bRhIlAxC0U7xM1BCnF2aDRPq0UaelqBHkM2lsCp26mcBbgI0tCVTv+jGdsQLUmAMybua/bjDsSu8RQHbmw==", - "dev": true, + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-3.1.9.tgz", + "integrity": "sha512-7YAR0Ub3MwTMjDfjnup4qa6W8gygZMxikBhFMPESi6ASsl/rZJhwLpF/0k9TuezScCojsM0FryGdz4LZtjKPPQ==", "dependencies": { - "@smithy/fetch-http-handler": "^3.2.4", - "@smithy/node-http-handler": "^3.1.4", - "@smithy/types": "^3.3.0", + "@smithy/fetch-http-handler": "^3.2.9", + "@smithy/node-http-handler": "^3.2.4", + "@smithy/types": "^3.5.0", "@smithy/util-base64": "^3.0.0", "@smithy/util-buffer-from": "^3.0.0", "@smithy/util-hex-encoding": "^3.0.0", @@ -4984,7 +5566,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-3.0.0.tgz", "integrity": "sha512-LqR7qYLgZTD7nWLBecUi4aqolw8Mhza9ArpNEQ881MJJIU2sE5iHCK6TdyqqzcDLy0OPe10IY4T8ctVdtynubg==", - "dev": true, "dependencies": { "tslib": "^2.6.2" }, @@ -4996,7 +5577,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-3.0.0.tgz", "integrity": "sha512-rUeT12bxFnplYDe815GXbq/oixEGHfRFFtcTF3YdDi/JaENIM6aSYYLJydG83UNzLXeRI5K8abYd/8Sp/QM0kA==", - "dev": true, "dependencies": { "@smithy/util-buffer-from": "^3.0.0", "tslib": "^2.6.2" @@ -6253,8 +6833,7 @@ "node_modules/bowser": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", - "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", - "dev": true + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" }, "node_modules/brace-expansion": { "version": "1.1.11", @@ -8320,7 +8899,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", - "dev": true, "funding": [ { "type": "github", @@ -11161,7 +11739,6 @@ }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11178,7 +11755,6 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { "version": "6.0.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11190,13 +11766,11 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11213,7 +11787,6 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11228,13 +11801,11 @@ }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/@npmcli/agent": { "version": "2.2.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11250,7 +11821,6 @@ }, "node_modules/npm/node_modules/@npmcli/arborist": { "version": "7.5.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11299,7 +11869,6 @@ }, "node_modules/npm/node_modules/@npmcli/config": { "version": "8.3.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11318,7 +11887,6 @@ }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11330,7 +11898,6 @@ }, "node_modules/npm/node_modules/@npmcli/git": { "version": "5.0.8", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11350,7 +11917,6 @@ }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11366,7 +11932,6 @@ }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { "version": "3.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11381,7 +11946,6 @@ }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { "version": "7.1.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11397,7 +11961,6 @@ }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11406,7 +11969,6 @@ }, "node_modules/npm/node_modules/@npmcli/node-gyp": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11415,7 +11977,6 @@ }, "node_modules/npm/node_modules/@npmcli/package-json": { "version": "5.2.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11433,7 +11994,6 @@ }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "7.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11445,7 +12005,6 @@ }, "node_modules/npm/node_modules/@npmcli/query": { "version": "3.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11457,7 +12016,6 @@ }, "node_modules/npm/node_modules/@npmcli/redact": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11466,7 +12024,6 @@ }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "8.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11483,7 +12040,6 @@ }, "node_modules/npm/node_modules/@pkgjs/parseargs": { "version": "0.11.0", - "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -11493,7 +12049,6 @@ }, "node_modules/npm/node_modules/@sigstore/bundle": { "version": "2.3.2", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -11505,7 +12060,6 @@ }, "node_modules/npm/node_modules/@sigstore/core": { "version": "1.1.0", - "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -11514,7 +12068,6 @@ }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { "version": "0.3.2", - "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -11523,7 +12076,6 @@ }, "node_modules/npm/node_modules/@sigstore/sign": { "version": "2.3.2", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -11540,7 +12092,6 @@ }, "node_modules/npm/node_modules/@sigstore/tuf": { "version": "2.3.4", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -11553,7 +12104,6 @@ }, "node_modules/npm/node_modules/@sigstore/verify": { "version": "1.2.1", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -11567,7 +12117,6 @@ }, "node_modules/npm/node_modules/@tufjs/canonical-json": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11576,7 +12125,6 @@ }, "node_modules/npm/node_modules/@tufjs/models": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11589,7 +12137,6 @@ }, "node_modules/npm/node_modules/abbrev": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11598,7 +12145,6 @@ }, "node_modules/npm/node_modules/agent-base": { "version": "7.1.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11610,7 +12156,6 @@ }, "node_modules/npm/node_modules/aggregate-error": { "version": "3.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11623,7 +12168,6 @@ }, "node_modules/npm/node_modules/ansi-regex": { "version": "5.0.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11632,7 +12176,6 @@ }, "node_modules/npm/node_modules/ansi-styles": { "version": "6.2.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11644,25 +12187,21 @@ }, "node_modules/npm/node_modules/aproba": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/bin-links": { "version": "4.0.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11677,7 +12216,6 @@ }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.3.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11689,7 +12227,6 @@ }, "node_modules/npm/node_modules/brace-expansion": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11698,7 +12235,6 @@ }, "node_modules/npm/node_modules/cacache": { "version": "18.0.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11721,7 +12257,6 @@ }, "node_modules/npm/node_modules/chalk": { "version": "5.3.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11733,7 +12268,6 @@ }, "node_modules/npm/node_modules/chownr": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11742,7 +12276,6 @@ }, "node_modules/npm/node_modules/ci-info": { "version": "4.0.0", - "dev": true, "funding": [ { "type": "github", @@ -11757,7 +12290,6 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "4.1.1", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -11769,7 +12301,6 @@ }, "node_modules/npm/node_modules/clean-stack": { "version": "2.2.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11778,7 +12309,6 @@ }, "node_modules/npm/node_modules/cli-columns": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11791,7 +12321,6 @@ }, "node_modules/npm/node_modules/cmd-shim": { "version": "6.0.3", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11800,7 +12329,6 @@ }, "node_modules/npm/node_modules/color-convert": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11812,19 +12340,16 @@ }, "node_modules/npm/node_modules/color-name": { "version": "1.1.4", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/cross-spawn": { "version": "7.0.3", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11838,7 +12363,6 @@ }, "node_modules/npm/node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11853,7 +12377,6 @@ }, "node_modules/npm/node_modules/cssesc": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -11865,7 +12388,6 @@ }, "node_modules/npm/node_modules/debug": { "version": "4.3.6", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11882,13 +12404,11 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/diff": { "version": "5.2.0", - "dev": true, "inBundle": true, "license": "BSD-3-Clause", "engines": { @@ -11897,19 +12417,16 @@ }, "node_modules/npm/node_modules/eastasianwidth": { "version": "0.2.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/emoji-regex": { "version": "8.0.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", - "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -11919,7 +12436,6 @@ }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11928,19 +12444,16 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", - "dev": true, "inBundle": true, "license": "Apache-2.0" }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.16", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11949,7 +12462,6 @@ }, "node_modules/npm/node_modules/foreground-child": { "version": "3.3.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11965,7 +12477,6 @@ }, "node_modules/npm/node_modules/fs-minipass": { "version": "3.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11977,7 +12488,6 @@ }, "node_modules/npm/node_modules/glob": { "version": "10.4.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11997,13 +12507,11 @@ }, "node_modules/npm/node_modules/graceful-fs": { "version": "4.2.11", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/hosted-git-info": { "version": "7.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12015,13 +12523,11 @@ }, "node_modules/npm/node_modules/http-cache-semantics": { "version": "4.1.1", - "dev": true, "inBundle": true, "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { "version": "7.0.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12034,7 +12540,6 @@ }, "node_modules/npm/node_modules/https-proxy-agent": { "version": "7.0.5", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12047,7 +12552,6 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", - "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -12060,7 +12564,6 @@ }, "node_modules/npm/node_modules/ignore-walk": { "version": "6.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12072,7 +12575,6 @@ }, "node_modules/npm/node_modules/imurmurhash": { "version": "0.1.4", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12081,7 +12583,6 @@ }, "node_modules/npm/node_modules/indent-string": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12090,7 +12591,6 @@ }, "node_modules/npm/node_modules/ini": { "version": "4.1.3", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12099,7 +12599,6 @@ }, "node_modules/npm/node_modules/init-package-json": { "version": "6.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12117,7 +12616,6 @@ }, "node_modules/npm/node_modules/ip-address": { "version": "9.0.5", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12130,7 +12628,6 @@ }, "node_modules/npm/node_modules/ip-regex": { "version": "5.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12142,7 +12639,6 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "5.1.0", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12154,7 +12650,6 @@ }, "node_modules/npm/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12163,19 +12658,16 @@ }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/jackspeak": { "version": "3.4.3", - "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -12190,13 +12682,11 @@ }, "node_modules/npm/node_modules/jsbn": { "version": "1.1.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "3.0.2", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12205,7 +12695,6 @@ }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", - "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -12214,7 +12703,6 @@ }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", - "dev": true, "engines": [ "node >= 0.2.0" ], @@ -12223,19 +12711,16 @@ }, "node_modules/npm/node_modules/just-diff": { "version": "6.0.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff-apply": { "version": "5.5.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { "version": "8.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12248,7 +12733,6 @@ }, "node_modules/npm/node_modules/libnpmdiff": { "version": "6.1.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12267,7 +12751,6 @@ }, "node_modules/npm/node_modules/libnpmexec": { "version": "8.1.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12288,7 +12771,6 @@ }, "node_modules/npm/node_modules/libnpmfund": { "version": "5.0.12", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12300,7 +12782,6 @@ }, "node_modules/npm/node_modules/libnpmhook": { "version": "10.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12313,7 +12794,6 @@ }, "node_modules/npm/node_modules/libnpmorg": { "version": "6.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12326,7 +12806,6 @@ }, "node_modules/npm/node_modules/libnpmpack": { "version": "7.0.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12341,7 +12820,6 @@ }, "node_modules/npm/node_modules/libnpmpublish": { "version": "9.0.9", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12360,7 +12838,6 @@ }, "node_modules/npm/node_modules/libnpmsearch": { "version": "7.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12372,7 +12849,6 @@ }, "node_modules/npm/node_modules/libnpmteam": { "version": "6.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12385,7 +12861,6 @@ }, "node_modules/npm/node_modules/libnpmversion": { "version": "6.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12401,13 +12876,11 @@ }, "node_modules/npm/node_modules/lru-cache": { "version": "10.4.3", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/make-fetch-happen": { "version": "13.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12430,7 +12903,6 @@ }, "node_modules/npm/node_modules/minimatch": { "version": "9.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12445,7 +12917,6 @@ }, "node_modules/npm/node_modules/minipass": { "version": "7.1.2", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12454,7 +12925,6 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12466,7 +12936,6 @@ }, "node_modules/npm/node_modules/minipass-fetch": { "version": "3.0.5", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12483,7 +12952,6 @@ }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12495,7 +12963,6 @@ }, "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12507,7 +12974,6 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12519,7 +12985,6 @@ }, "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12531,7 +12996,6 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12543,7 +13007,6 @@ }, "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12555,7 +13018,6 @@ }, "node_modules/npm/node_modules/minizlib": { "version": "2.1.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12568,7 +13030,6 @@ }, "node_modules/npm/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12580,7 +13041,6 @@ }, "node_modules/npm/node_modules/mkdirp": { "version": "1.0.4", - "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -12592,13 +13052,11 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { "version": "1.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12607,7 +13065,6 @@ }, "node_modules/npm/node_modules/negotiator": { "version": "0.6.3", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12616,7 +13073,6 @@ }, "node_modules/npm/node_modules/node-gyp": { "version": "10.2.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12640,7 +13096,6 @@ }, "node_modules/npm/node_modules/nopt": { "version": "7.2.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12655,7 +13110,6 @@ }, "node_modules/npm/node_modules/normalize-package-data": { "version": "6.0.2", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12669,7 +13123,6 @@ }, "node_modules/npm/node_modules/npm-audit-report": { "version": "5.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12678,7 +13131,6 @@ }, "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12690,7 +13142,6 @@ }, "node_modules/npm/node_modules/npm-install-checks": { "version": "6.3.0", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12702,7 +13153,6 @@ }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12711,7 +13161,6 @@ }, "node_modules/npm/node_modules/npm-package-arg": { "version": "11.0.3", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12726,7 +13175,6 @@ }, "node_modules/npm/node_modules/npm-packlist": { "version": "8.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12738,7 +13186,6 @@ }, "node_modules/npm/node_modules/npm-pick-manifest": { "version": "9.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12753,7 +13200,6 @@ }, "node_modules/npm/node_modules/npm-profile": { "version": "10.0.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12766,7 +13212,6 @@ }, "node_modules/npm/node_modules/npm-registry-fetch": { "version": "17.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12785,7 +13230,6 @@ }, "node_modules/npm/node_modules/npm-user-validate": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "BSD-2-Clause", "engines": { @@ -12794,7 +13238,6 @@ }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12809,13 +13252,11 @@ }, "node_modules/npm/node_modules/package-json-from-dist": { "version": "1.0.0", - "dev": true, "inBundle": true, "license": "BlueOak-1.0.0" }, "node_modules/npm/node_modules/pacote": { "version": "18.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12846,7 +13287,6 @@ }, "node_modules/npm/node_modules/parse-conflict-json": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12860,7 +13300,6 @@ }, "node_modules/npm/node_modules/path-key": { "version": "3.1.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12869,7 +13308,6 @@ }, "node_modules/npm/node_modules/path-scurry": { "version": "1.11.1", - "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -12885,7 +13323,6 @@ }, "node_modules/npm/node_modules/postcss-selector-parser": { "version": "6.1.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12898,7 +13335,6 @@ }, "node_modules/npm/node_modules/proc-log": { "version": "4.2.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12907,7 +13343,6 @@ }, "node_modules/npm/node_modules/proggy": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12916,7 +13351,6 @@ }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", - "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -12925,7 +13359,6 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -12934,13 +13367,11 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12953,7 +13384,6 @@ }, "node_modules/npm/node_modules/promzard": { "version": "1.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12965,7 +13395,6 @@ }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", - "dev": true, "inBundle": true, "bin": { "qrcode-terminal": "bin/qrcode-terminal.js" @@ -12973,7 +13402,6 @@ }, "node_modules/npm/node_modules/read": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12985,7 +13413,6 @@ }, "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12994,7 +13421,6 @@ }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13007,7 +13433,6 @@ }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13016,14 +13441,12 @@ }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", - "dev": true, "inBundle": true, "license": "MIT", "optional": true }, "node_modules/npm/node_modules/semver": { "version": "7.6.3", - "dev": true, "inBundle": true, "license": "ISC", "bin": { @@ -13035,7 +13458,6 @@ }, "node_modules/npm/node_modules/shebang-command": { "version": "2.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13047,7 +13469,6 @@ }, "node_modules/npm/node_modules/shebang-regex": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13056,7 +13477,6 @@ }, "node_modules/npm/node_modules/signal-exit": { "version": "4.1.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13068,7 +13488,6 @@ }, "node_modules/npm/node_modules/sigstore": { "version": "2.3.1", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -13085,7 +13504,6 @@ }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13095,7 +13513,6 @@ }, "node_modules/npm/node_modules/socks": { "version": "2.8.3", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13109,7 +13526,6 @@ }, "node_modules/npm/node_modules/socks-proxy-agent": { "version": "8.0.4", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13123,7 +13539,6 @@ }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.2.0", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -13133,7 +13548,6 @@ }, "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13143,13 +13557,11 @@ }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.5.0", - "dev": true, "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13159,19 +13571,16 @@ }, "node_modules/npm/node_modules/spdx-license-ids": { "version": "3.0.18", - "dev": true, "inBundle": true, "license": "CC0-1.0" }, "node_modules/npm/node_modules/sprintf-js": { "version": "1.1.3", - "dev": true, "inBundle": true, "license": "BSD-3-Clause" }, "node_modules/npm/node_modules/ssri": { "version": "10.0.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13183,7 +13592,6 @@ }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13198,7 +13606,6 @@ "node_modules/npm/node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13212,7 +13619,6 @@ }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13225,7 +13631,6 @@ "node_modules/npm/node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13237,7 +13642,6 @@ }, "node_modules/npm/node_modules/supports-color": { "version": "9.4.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13249,7 +13653,6 @@ }, "node_modules/npm/node_modules/tar": { "version": "6.2.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13266,7 +13669,6 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13278,7 +13680,6 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13290,7 +13691,6 @@ }, "node_modules/npm/node_modules/tar/node_modules/minipass": { "version": "5.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13299,19 +13699,16 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/treeverse": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13320,7 +13717,6 @@ }, "node_modules/npm/node_modules/tuf-js": { "version": "2.2.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13334,7 +13730,6 @@ }, "node_modules/npm/node_modules/unique-filename": { "version": "3.0.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13346,7 +13741,6 @@ }, "node_modules/npm/node_modules/unique-slug": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13358,13 +13752,11 @@ }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", - "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -13374,7 +13766,6 @@ }, "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13384,7 +13775,6 @@ }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.1", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13393,13 +13783,11 @@ }, "node_modules/npm/node_modules/walk-up-path": { "version": "3.0.1", - "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/which": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13414,7 +13802,6 @@ }, "node_modules/npm/node_modules/which/node_modules/isexe": { "version": "3.1.1", - "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13423,7 +13810,6 @@ }, "node_modules/npm/node_modules/wrap-ansi": { "version": "8.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13441,7 +13827,6 @@ "node_modules/npm/node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13458,7 +13843,6 @@ }, "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13473,7 +13857,6 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.0.1", - "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13485,13 +13868,11 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { "version": "9.2.2", - "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13508,7 +13889,6 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "7.1.0", - "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13523,7 +13903,6 @@ }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.1", - "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13536,7 +13915,6 @@ }, "node_modules/npm/node_modules/yallist": { "version": "4.0.0", - "dev": true, "inBundle": true, "license": "ISC" }, @@ -15886,8 +16264,7 @@ "node_modules/strnum": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", - "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", - "dev": true + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" }, "node_modules/strtok3": { "version": "7.0.0", @@ -16257,8 +16634,7 @@ "node_modules/tslib": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", - "dev": true + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -16608,7 +16984,6 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true, "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" diff --git a/package.json b/package.json index dae98ab1..9a1d60d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "6.0.0", + "version": "6.1.0", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -21,7 +21,8 @@ "author": "Scale3 Labs", "license": "Apache-2.0", "dependencies": { - "@langtrase/trace-attributes": "7.4.0", + "@aws-sdk/client-bedrock-runtime": "^3.670.0", + "@langtrase/trace-attributes": "7.5.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", diff --git a/src/examples/awsbedrock/converse-anthropic.ts b/src/examples/awsbedrock/converse-anthropic.ts new file mode 100644 index 00000000..0985ad82 --- /dev/null +++ b/src/examples/awsbedrock/converse-anthropic.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { init } from '@langtrace-init/init' +import { + BedrockRuntimeClient, + ConverseCommand, + Message +} from '@aws-sdk/client-bedrock-runtime' +import dotenv from 'dotenv' + +dotenv.config() + +init({ batch: false, write_spans_to_console: false, disable_instrumentations: { all_except: ['anthropic'] } }) + +const client = new BedrockRuntimeClient({ region: 'us-east-1' }) + +const userMessage = + 'Describe the purpose of a hello world program in one line.' +const conversation: Message[] = [ + { + role: 'user', + content: [{ text: userMessage }] + } +] + +const modelId = 'mistral.mistral-large-2402-v1:0' + +export async function basic (): Promise { + // Create a command with the model ID, the message, and a basic configuration. + const command = new ConverseCommand({ + modelId, + messages: conversation, + inferenceConfig: { maxTokens: 512, temperature: 0.5, topP: 0.9 } + }) + + try { + // Send the command to the model and wait for the response + const response = await client.send(command) + + // Extract and print the response text. + const responseText = ((response.output?.message?.content?.length) != null) && response.output.message.content[0].text + console.log(responseText) + } catch (err) { + console.log(`ERROR using '${modelId}'. Reason: ${err}`) + process.exit(1) + } +} diff --git a/src/examples/entrypoint.ts b/src/examples/entrypoint.ts index a3076595..28610eb3 100644 --- a/src/examples/entrypoint.ts +++ b/src/examples/entrypoint.ts @@ -1,3 +1,3 @@ -import { basic } from '@langtrace-examples/llamaindex/basic' +import { basic } from '@langtrace-examples/awsbedrock/converse-anthropic' void basic() diff --git a/src/examples/vercel/basic.ts b/src/examples/vercel/basic.ts index 647862a4..8395db17 100644 --- a/src/examples/vercel/basic.ts +++ b/src/examples/vercel/basic.ts @@ -1,5 +1,5 @@ +import { openai } from '@ai-sdk/openai' import { init } from '@langtrace-init/init' -import { openai } from '@ai-sdk/openai' // Ensure OPENAI_API_KEY environment variable is set import ai from '@langtrace-module-wrappers/ai' import { withAdditionalAttributes } from '@langtrace-utils/instrumentation' @@ -9,7 +9,7 @@ init({ }) export async function basic (): Promise { await withAdditionalAttributes(async () => { - const resp = await ai.generateText({ + await ai.generateText({ model: openai('gpt-4-turbo', { user: 'abc' }), system: 'You are a friendly assistant!', // prompt: 'Why is the sky blue?', @@ -39,11 +39,11 @@ export async function basicStream (): Promise { } export const basicEmbed = async (): Promise => { - const resp = await ai.embed({ model: openai.embedding('text-embedding-3-large', { user: 'abc', dimensions: 10, maxEmbeddingsPerCall: 2 }), value: 'hey there its a very nice day out today', maxRetries: 3 }) + await ai.embed({ model: openai.embedding('text-embedding-3-large', { user: 'abc', dimensions: 10, maxEmbeddingsPerCall: 2 }), value: 'hey there its a very nice day out today', maxRetries: 3 }) // console.info(resp) } export const basicEmbedMany = async (): Promise => { - const resp = await ai.embedMany({ model: openai.embedding('text-embedding-3-large', { user: 'abc', dimensions: 10, maxEmbeddingsPerCall: 2 }), values: ['hey there its a very nice day out today'], maxRetries: 3 }) + await ai.embedMany({ model: openai.embedding('text-embedding-3-large', { user: 'abc', dimensions: 10, maxEmbeddingsPerCall: 2 }), values: ['hey there its a very nice day out today'], maxRetries: 3 }) // console.info(resp) } diff --git a/src/init/init.ts b/src/init/init.ts index 5ae9b261..953e3917 100644 --- a/src/init/init.ts +++ b/src/init/init.ts @@ -46,6 +46,7 @@ import * as Sentry from '@sentry/node' import { SENTRY_DSN } from '@langtrace-constants/common' import { nodeProfilingIntegration } from '@sentry/profiling-node' import { mistralInstrumentation } from '@langtrace-instrumentation/mistral/instrumentation' +import { awsbedrockInstrumentation } from '@langtrace-instrumentation/awsbedrock/instrumentation' import { LangtraceSdkError } from 'errors/sdk_error' /** @@ -169,6 +170,7 @@ export const init: LangTraceInit = ({ anthropic: anthropicInstrumentation, gemini: geminiInstrumentation, mistral: mistralInstrumentation, + awsbedrock: awsbedrockInstrumentation, groq: groqInstrumentation, pinecone: pineconeInstrumentation, llamaindex: llamaIndexInstrumentation, diff --git a/src/instrumentation/awsbedrock/instrumentation.ts b/src/instrumentation/awsbedrock/instrumentation.ts new file mode 100644 index 00000000..e76d2a9f --- /dev/null +++ b/src/instrumentation/awsbedrock/instrumentation.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { diag } from '@opentelemetry/api' +import { + InstrumentationBase, + InstrumentationNodeModuleDefinition, + isWrapped +} from '@opentelemetry/instrumentation' +import { sendCommand } from '@langtrace-instrumentation/awsbedrock/patch' +// eslint-disable-next-line no-restricted-imports +import { version, name } from '../../../package.json' +class AWSBedrockInstrumentation extends InstrumentationBase { + constructor () { + super(name, version) + } + + public manualPatch (awsbedrock: any): void { + diag.debug('Manually patching awsbedrock') + this._patch(awsbedrock) + } + + init (): Array> { + const module = new InstrumentationNodeModuleDefinition( + '@aws-sdk/client-bedrock-runtime', + ['>=3.668.0'], + (moduleExports, moduleVersion) => { + diag.debug(`Patching AWS Bedrock SDK version ${moduleVersion}`) + this._patch(moduleExports, moduleVersion as string) + return moduleExports + }, + (moduleExports, moduleVersion) => { + diag.debug(`Unpatching AWS Bedrock SDK version ${moduleVersion}`) + if (moduleExports !== undefined) { + this._unpatch(moduleExports) + } + } + ) + + return [module] + } + + private _patch (awsbedrock: any, moduleVersion?: string): void { + const wrapped = isWrapped(awsbedrock.BedrockRuntimeClient.prototype) + if (wrapped) { + this._unpatch(awsbedrock) + } + this._wrap( + awsbedrock.BedrockRuntimeClient.prototype, + 'send', + (originalMethod: (...args: any[]) => any) => { + return sendCommand(originalMethod, this.tracer, this.instrumentationVersion, moduleVersion) + } + ) + } + + private _unpatch (awsbedrock: any): void { + this._unwrap(awsbedrock.BedrockRuntimeClient.prototype, 'send') + } +} + +export const awsbedrockInstrumentation = new AWSBedrockInstrumentation() diff --git a/src/instrumentation/awsbedrock/patch.ts b/src/instrumentation/awsbedrock/patch.ts new file mode 100644 index 00000000..7dc67e93 --- /dev/null +++ b/src/instrumentation/awsbedrock/patch.ts @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2024 Scale3 Labs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' +import { addSpanEvent } from '@langtrace-utils/misc' +import { APIS, LLMSpanAttributes, Event, Vendors } from '@langtrase/trace-attributes' +import { + Exception, + Span, + SpanKind, + SpanStatusCode, + Tracer, + context, + trace +} from '@opentelemetry/api' +import { LangtraceSdkError } from 'errors/sdk_error' + +export function sendCommand ( + originalMethod: (...args: any[]) => any, + tracer: Tracer, + langtraceVersion: string, + version?: string, + stream = false +): (...args: any[]) => any { + return async function (this: any, ...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const originalContext = this + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + // Determine the service provider + const serviceProvider: string = Vendors.AWSBEDROCK + const attributes: LLMSpanAttributes = { + 'langtrace.sdk.name': '@langtrase/typescript-sdk', + 'gen_ai.operation.name': 'chat', + 'langtrace.service.name': serviceProvider, + 'langtrace.service.type': 'framework', + 'langtrace.service.version': version, + 'langtrace.version': langtraceVersion, + 'gen_ai.request.model': args[0]?.input.modelId, + 'url.full': originalContext?._client?.baseURL, + 'url.path': APIS.awsbedrock.CONVERSE.ENDPOINT, + 'http.max.retries': originalContext?._client?.maxRetries, + 'http.timeout': originalContext?._client?.timeout, + 'gen_ai.request.temperature': args[0]?.input?.inferenceConfig?.temperature, + 'gen_ai.request.top_p': args[0]?.input?.inferenceConfig?.topP, + 'gen_ai.user': args[0]?.user, + 'gen_ai.request.max_tokens': args[0]?.input?.inferenceConfig?.maxTokens, + 'gen_ai.request.tools': JSON.stringify(args[0]?.input?.toolConfig?.tools), + ...customAttributes + } + /* eslint-disable no-console */ + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? APIS.awsbedrock.CONVERSE.METHOD + const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes }, context.active()) + return await context.with( + trace.setSpan(context.active(), span), + async () => { + try { + const resp = await originalMethod.apply(this, args) + const message = args[0]?.input?.messages[0] + const message_content = message?.content?.map((content: any) => ({ content: content.text, role: message.role })) + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(message_content) }) + if (resp.stream === undefined) { + const responses = resp?.output?.message?.content?.map((content: any) => { + const result = { + role: resp?.output?.message?.role, + content: content?.text !== undefined && content?.text !== null + ? content?.text + : content?.toolUse !== undefined + ? JSON.stringify(content?.toolUse) + : JSON.stringify(content?.toolResult) + } + return result + }) + addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify(responses) }) + const responseAttributes: Partial = { + 'gen_ai.response.model': args[0]?.input.modelId, + 'gen_ai.usage.input_tokens': resp.usage.inputTokens, + 'gen_ai.usage.output_tokens': resp.usage.outputTokens, + 'gen_ai.usage.total_tokens': resp.usage.totalTokens + } + span.setAttributes({ ...attributes, ...responseAttributes }) + span.setStatus({ code: SpanStatusCode.OK }) + return resp + } else { + await processConverseStream(resp.stream, span, attributes) + return resp + } + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + throw new LangtraceSdkError(error.message as string, error.stack as string) + } finally { + span.end() + } + } + ) + } +} + +async function * processConverseStream (stream: any, span: Span, inputAttributes: Partial): any { + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + addSpanEvent(span, Event.STREAM_START) + + const result: string[] = [] + let completionTokens = 0 + let promptTokens = 0 + + try { + for await (const chunk of stream) { + const deserializedChunk = await stream.options.deserializer(chunk) + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + const content = deserializedChunk.contentBlockDelta?.delta?.text || '' + promptTokens = deserializedChunk.metadata?.usage?.inputTokens ?? 0 + completionTokens = deserializedChunk.metadata?.usage?.outputTokens ?? 0 + result.push(content as string) + + yield deserializedChunk + } + + addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': result.length > 0 ? JSON.stringify([{ role: 'assistant', content: result.join('') }]) : undefined }) + span.setStatus({ code: SpanStatusCode.OK }) + const stream_attributes: Partial = { + 'gen_ai.usage.output_tokens': promptTokens, + 'gen_ai.usage.input_tokens': completionTokens, + 'gen_ai.usage.total_tokens': promptTokens + completionTokens, + 'gen_ai.request.stream': true, + ...customAttributes + } + span.setAttributes({ ...inputAttributes, ...stream_attributes }) + addSpanEvent(span, Event.STREAM_END) + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + throw new LangtraceSdkError(error.message as string, error.stack as string) + } finally { + span.end() + } +} From 374958c657735bd11b26344bdad45fda15b75917 Mon Sep 17 00:00:00 2001 From: Karthik Kalyanaraman <105607645+karthikscale3@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:02:07 -0700 Subject: [PATCH 20/25] fix (#186) --- package.json | 2 +- src/instrumentation/openai/patch.ts | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 9a1d60d9..47851b06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "6.1.0", + "version": "6.1.1", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/instrumentation/openai/patch.ts b/src/instrumentation/openai/patch.ts index 8dd1277e..2f3960db 100644 --- a/src/instrumentation/openai/patch.ts +++ b/src/instrumentation/openai/patch.ts @@ -17,15 +17,12 @@ import { LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY } from '@langtrace-constants/common' import { calculatePromptTokens, estimateTokens } from '@langtrace-utils/llm' import { addSpanEvent, createStreamProxy } from '@langtrace-utils/misc' -import { APIS, LLMSpanAttributes, Event, Vendors } from '@langtrase/trace-attributes' +import { APIS, Event, LLMSpanAttributes, Vendors } from '@langtrase/trace-attributes' import { - Exception, + context, Exception, Span, SpanKind, - SpanStatusCode, - Tracer, - context, - trace + SpanStatusCode, trace, Tracer } from '@opentelemetry/api' import { LangtraceSdkError } from 'errors/sdk_error' @@ -43,6 +40,10 @@ export function imageEdit ( let serviceProvider: string = Vendors.OPENAI if (originalContext?._client?.baseURL?.includes('azure') === true) { serviceProvider = 'azure' + } else if (originalContext?._client?.baseURL?.includes('perplexity') === true) { + serviceProvider = 'perplexity' + } else if (originalContext?._client?.baseURL?.includes('x.ai') === true) { + serviceProvider = 'XAI' } const attributes: LLMSpanAttributes = { 'langtrace.sdk.name': '@langtrase/typescript-sdk', @@ -101,6 +102,10 @@ export function imagesGenerate ( let serviceProvider: string = Vendors.OPENAI if (originalContext?._client?.baseURL?.includes('azure') === true) { serviceProvider = 'azure' + } else if (originalContext?._client?.baseURL?.includes('perplexity') === true) { + serviceProvider = 'perplexity' + } else if (originalContext?._client?.baseURL?.includes('x.ai') === true) { + serviceProvider = 'XAI' } const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} @@ -159,6 +164,8 @@ export function chatCompletionCreate ( serviceProvider = 'azure' } else if (originalContext?._client?.baseURL?.includes('perplexity') === true) { serviceProvider = 'perplexity' + } else if (originalContext?._client?.baseURL?.includes('x.ai') === true) { + serviceProvider = 'XAI' } const attributes: LLMSpanAttributes = { 'langtrace.sdk.name': '@langtrase/typescript-sdk', @@ -315,6 +322,10 @@ export function embeddingsCreate ( let serviceProvider: string = Vendors.OPENAI if (originalContext?._client?.baseURL?.includes('azure') === true) { serviceProvider = 'azure' + } else if (originalContext?._client?.baseURL?.includes('perplexity') === true) { + serviceProvider = 'perplexity' + } else if (originalContext?._client?.baseURL?.includes('x.ai') === true) { + serviceProvider = 'XAI' } const attributes: LLMSpanAttributes = { 'langtrace.sdk.name': '@langtrase/typescript-sdk', From 5e1894153e2226a938f464408ebdfc952174ce6d Mon Sep 17 00:00:00 2001 From: Karthik Kalyanaraman <105607645+karthikscale3@users.noreply.github.com> Date: Sun, 17 Nov 2024 17:25:41 -0800 Subject: [PATCH 21/25] update prompt (#190) --- package.json | 2 +- src/instrumentation/vercel/anthropic.ts | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 47851b06..e6b08695 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "6.1.1", + "version": "6.2.0", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/instrumentation/vercel/anthropic.ts b/src/instrumentation/vercel/anthropic.ts index 18b16b48..8605865f 100644 --- a/src/instrumentation/vercel/anthropic.ts +++ b/src/instrumentation/vercel/anthropic.ts @@ -69,11 +69,9 @@ export async function generateTextPatchAnthropic ( try { const resp = await originalMethod.apply(this, args) const responses = JSON.stringify(resp?.responseMessages) - span.addEvent(Event.GEN_AI_PROMPT, { - 'gen_ai.prompt': JSON.stringify([ - { role: 'user', content: args[0]?.prompt } - ]) - }) + // set content to either prompt or messages + const content = args[0]?.prompt ?? JSON.stringify(args[0]?.messages) + span.addEvent(Event.GEN_AI_PROMPT, { 'gen_ai.prompt': content }) span.addEvent(Event.GEN_AI_COMPLETION, { 'gen_ai.completion': responses }) const responseAttributes: Partial = { 'url.full': url, @@ -146,7 +144,8 @@ export async function streamTextPatchAnthropic ( return await context.with(trace.setSpan(context.active(), span), async () => { try { const resp: any = await originalMethod.apply(this, args) - addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(args[0]?.prompt) }) + const content = args[0]?.prompt ?? JSON.stringify(args[0]?.messages) + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': content }) const responseAttributes: Partial = { 'url.full': url, 'url.path': APIS.anthropic.MESSAGES_CREATE.ENDPOINT @@ -231,11 +230,8 @@ export async function generateObjectPatchAnthropic ( try { const resp = await originalMethod.apply(this, args) const responses = JSON.stringify(resp?.object) - span.addEvent(Event.GEN_AI_PROMPT, { - 'gen_ai.prompt': JSON.stringify([ - { role: 'user', content: args[0]?.prompt } - ]) - }) + const content = args[0]?.prompt ?? JSON.stringify(args[0]?.messages) + span.addEvent(Event.GEN_AI_PROMPT, { 'gen_ai.prompt': content }) span.addEvent(Event.GEN_AI_COMPLETION, { 'gen_ai.completion': responses }) const responseAttributes: Partial = { 'url.full': url, @@ -308,7 +304,8 @@ export async function streamObjectPatchAnthropic ( return await context.with(trace.setSpan(context.active(), span), async () => { try { const resp: any = await originalMethod.apply(this, args) - addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(args[0]?.prompt) }) + const content = args[0]?.prompt ?? JSON.stringify(args[0]?.messages) + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': content }) const responseAttributes: Partial = { 'url.full': url, 'url.path': APIS.anthropic.MESSAGES_CREATE.ENDPOINT From 8f05607fd2a6eec4577db87cb59fb454c535e703 Mon Sep 17 00:00:00 2001 From: Karthik Kalyanaraman <105607645+karthikscale3@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:49:10 -0800 Subject: [PATCH 22/25] Fix ChromaDB Instrumentation (#192) * chromadb fixes * chromadb fixes --- package-lock.json | 13 +- package.json | 4 +- src/instrumentation/chroma/instrumentation.ts | 182 ++++++++++++++++-- 3 files changed, 171 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7a921ac2..cd894744 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@langtrase/typescript-sdk", - "version": "6.1.0", + "version": "6.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/typescript-sdk", - "version": "6.1.0", + "version": "6.2.0", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.670.0", @@ -36,7 +36,7 @@ "@qdrant/js-client-rest": "^1.9.0", "@typescript-eslint/eslint-plugin": "^5.62.0", "ai": "^3.2.29", - "chromadb": "^1.8.1", + "chromadb": "^1.9.4", "cohere-ai": "^7.9.3", "dotenv": "^16.4.5", "eslint": "^8.34.0", @@ -7096,10 +7096,11 @@ "dev": true }, "node_modules/chromadb": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/chromadb/-/chromadb-1.8.1.tgz", - "integrity": "sha512-NpbYydbg4Uqt/9BXKgkZXn0fqpsh2Z1yjhkhKH+rcHMoq0pwI18BFSU2QU7Fk/ZypwGefW2AvqyE/3ZJIgy4QA==", + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/chromadb/-/chromadb-1.9.4.tgz", + "integrity": "sha512-KtBy3uvZWV5+B6tlSYxwi8YW+Dv+qBs2spffSaamLeAHLn+N4ss6xoscLWDp5J1ImfscT8NFW1lGZlTZbs8Huw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "cliui": "^8.0.1", "isomorphic-fetch": "^3.0.0" diff --git a/package.json b/package.json index e6b08695..50d4e1a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "6.2.0", + "version": "6.3.0", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -48,7 +48,7 @@ "@qdrant/js-client-rest": "^1.9.0", "@typescript-eslint/eslint-plugin": "^5.62.0", "ai": "^3.2.29", - "chromadb": "^1.8.1", + "chromadb": "^1.9.4", "cohere-ai": "^7.9.3", "dotenv": "^16.4.5", "eslint": "^8.34.0", diff --git a/src/instrumentation/chroma/instrumentation.ts b/src/instrumentation/chroma/instrumentation.ts index 014a7061..1c74c999 100644 --- a/src/instrumentation/chroma/instrumentation.ts +++ b/src/instrumentation/chroma/instrumentation.ts @@ -22,6 +22,10 @@ import { version, name } from '../../../package.json' import { APIS } from '@langtrase/trace-attributes' class ChromaInstrumentation extends InstrumentationBase { + private originalGetOrCreateCollection: any + private originalCreateCollection: any + private originalGetCollection: any + constructor () { super(name, version) } @@ -32,18 +36,70 @@ class ChromaInstrumentation extends InstrumentationBase { } init (): Array> { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this const module = new InstrumentationNodeModuleDefinition( 'chromadb', ['>=1.8.1'], (moduleExports, moduleVersion) => { diag.debug(`Patching ChromaDB SDK version ${moduleVersion}`) - this._patch(moduleExports, moduleVersion as string) + + const ChromaClient = moduleExports.ChromaClient + + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (!ChromaClient?.prototype) { + diag.error('ChromaClient not found in exports') + return moduleExports + } + + // Store original methods + this.originalGetOrCreateCollection = ChromaClient.prototype.getOrCreateCollection + this.originalCreateCollection = ChromaClient.prototype.createCollection + this.originalGetCollection = ChromaClient.prototype.getCollection + + // Patch getOrCreateCollection + ChromaClient.prototype.getOrCreateCollection = async function (...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + const collection = await self.originalGetOrCreateCollection.apply(this, args) + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (collection) { + self._patchCollectionMethods(collection, moduleVersion) + } + return collection + } + + // Patch createCollection + ChromaClient.prototype.createCollection = async function (...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + const collection = await self.originalCreateCollection.apply(this, args) + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (collection) { + self._patchCollectionMethods(collection, moduleVersion) + } + return collection + } + + // Patch getCollection + ChromaClient.prototype.getCollection = async function (...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + const collection = await self.originalGetCollection.apply(this, args) + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (collection) { + self._patchCollectionMethods(collection, moduleVersion) + } + return collection + } + return moduleExports }, (moduleExports, moduleVersion) => { diag.debug(`Unpatching ChromaDB SDK version ${moduleVersion}`) - if (moduleExports !== undefined) { - this._unpatch(moduleExports) + const ChromaClient = moduleExports.ChromaClient + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (ChromaClient?.prototype) { + ChromaClient.prototype.getOrCreateCollection = this.originalGetOrCreateCollection + ChromaClient.prototype.createCollection = this.originalCreateCollection + ChromaClient.prototype.getCollection = this.originalGetCollection } } ) @@ -51,30 +107,116 @@ class ChromaInstrumentation extends InstrumentationBase { return [module] } - private _patch (chromadb: any, moduleVersion?: string): void { - if (isWrapped(chromadb.Collection.prototype)) { - Object.keys(APIS.chromadb).forEach((api) => { - this._unwrap(chromadb.Collection.prototype, APIS.chromadb[api as keyof typeof APIS.chromadb].OPERATION as string) - }) - } + private _patchCollectionMethods (collection: any, moduleVersion?: string): void { + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (!collection) return + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this Object.keys(APIS.chromadb).forEach((api) => { - if (isWrapped(chromadb.Collection.prototype)) { - this._unpatch(chromadb) + const operation = APIS.chromadb[api as keyof typeof APIS.chromadb].OPERATION as string + const original = collection[operation] + + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (original && !isWrapped(original)) { + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const wrapped = (...args: any[]) => { + const patchedMethod = collectionPatch( + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + function (...methodArgs: any[]) { + return original.apply(collection, methodArgs) + }, + api, + self.tracer, + self.instrumentationVersion, + moduleVersion + ) + return patchedMethod.apply(this, args) + } + + Object.assign(wrapped, original) + wrapped.__original = original + wrapped.__wrapped = true + + collection[operation] = wrapped } - this._wrap( - chromadb.Collection.prototype, - APIS.chromadb[api as keyof typeof APIS.chromadb].OPERATION, - (originalMethod: (...args: any[]) => any) => - collectionPatch(originalMethod, api, this.tracer, this.instrumentationVersion, moduleVersion) - ) }) } + private _patch (chromadb: any, moduleVersion?: string): void { + const ChromaClient = chromadb.ChromaClient + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (ChromaClient?.prototype) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this + + // Store original methods if not already stored + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (!this.originalGetOrCreateCollection) { + this.originalGetOrCreateCollection = ChromaClient.prototype.getOrCreateCollection + } + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (!this.originalCreateCollection) { + this.originalCreateCollection = ChromaClient.prototype.createCollection + } + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (!this.originalGetCollection) { + this.originalGetCollection = ChromaClient.prototype.getCollection + } + + // Patch getOrCreateCollection + ChromaClient.prototype.getOrCreateCollection = async function (...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + const collection = await self.originalGetOrCreateCollection.apply(this, args) + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (collection) { + self._patchCollectionMethods(collection, moduleVersion) + } + return collection + } + + // Patch createCollection + ChromaClient.prototype.createCollection = async function (...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + const collection = await self.originalCreateCollection.apply(this, args) + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (collection) { + self._patchCollectionMethods(collection, moduleVersion) + } + return collection + } + + // Patch getCollection + ChromaClient.prototype.getCollection = async function (...args: any[]) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + const collection = await self.originalGetCollection.apply(this, args) + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (collection) { + self._patchCollectionMethods(collection, moduleVersion) + } + return collection + } + } + } + private _unpatch (chromadb: any): void { - Object.keys(APIS.chromadb).forEach((api) => { - this._unwrap(chromadb.Collection.prototype, APIS.chromadb[api as keyof typeof APIS.chromadb].OPERATION as string) - }) + const ChromaClient = chromadb.ChromaClient + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (ChromaClient?.prototype) { + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (this.originalGetOrCreateCollection) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + ChromaClient.prototype.getOrCreateCollection = this.originalGetOrCreateCollection + } + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (this.originalCreateCollection) { + ChromaClient.prototype.createCollection = this.originalCreateCollection + } + // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions + if (this.originalGetCollection) { + ChromaClient.prototype.getCollection = this.originalGetCollection + } + } } } From f56a834fc91b33b4f25f6db64834bb0104be4aa0 Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Tue, 17 Dec 2024 16:19:09 +0100 Subject: [PATCH 23/25] add update cohere to support v2 client --- src/examples/cohere/basic.ts | 49 +++++- src/examples/entrypoint.ts | 4 +- src/instrumentation/cohere/instrumentation.ts | 56 +++++- src/instrumentation/cohere/patch.ts | 164 +++++++++++++++++- src/instrumentation/cohere/types.ts | 42 +++++ 5 files changed, 307 insertions(+), 8 deletions(-) diff --git a/src/examples/cohere/basic.ts b/src/examples/cohere/basic.ts index 05d8def4..c0f4fe6b 100644 --- a/src/examples/cohere/basic.ts +++ b/src/examples/cohere/basic.ts @@ -3,9 +3,11 @@ import * as cohere from 'cohere-ai' import { Tool } from 'cohere-ai/api' import fs from 'fs' -init({ disable_instrumentations: { all_except: ['cohere'] } }) +init({ disable_instrumentations: { all_except: ['cohere'] }, api_key: '' }) + +const c = new cohere.CohereClient({ token: '' }) +const c2 = new cohere.CohereClientV2({ token: '' }) -const c = new cohere.CohereClient() export const basicChat = async (): Promise => { const prediction = await c.chat({ chatHistory: [ @@ -77,6 +79,37 @@ Unless the user asks for a different style of answer, you should answer in full ) } +export const basicChatV2 = async (): Promise => { + const response = await c2.chat({ + model: 'command-r-plus-08-2024', + messages: [ + { + role: 'user', + content: 'hello world!' + } + ] + }) + + console.log(response) +} + +export const basicChatStreamV2 = async (): Promise => { + const stream = await c2.chatStream({ + model: 'command-r-plus-08-2024', + messages: [ + { + role: 'user', + content: 'hello world!' + } + ] + }) + for await (const chatEvent of stream) { + if (chatEvent.type === 'content-delta') { + console.log(chatEvent.delta?.message) + } + } +} + export const basicStream = async (): Promise => { const stream = await c.chatStream({ model: 'command', @@ -103,6 +136,18 @@ export const basicEmbed = async (): Promise => { console.info('Received embed', embed) } +export const basicEmbedV2 = async (): Promise => { + const embed = await c2.embed({ + texts: ['hello', 'goodbye'], + model: 'embed-english-v3.0', + inputType: 'classification', + embeddingTypes: ['float', 'int8'] + }) + console.info(embed) + + console.info('Received embed', embed) +} + export const basicEmbedJobsCreate = async (): Promise => { const s = await c.datasets.list() if (s.datasets === undefined) { diff --git a/src/examples/entrypoint.ts b/src/examples/entrypoint.ts index 28610eb3..a2935087 100644 --- a/src/examples/entrypoint.ts +++ b/src/examples/entrypoint.ts @@ -1,3 +1,3 @@ -import { basic } from '@langtrace-examples/awsbedrock/converse-anthropic' +import { basicEmbedV2 } from '@langtrace-examples/cohere/basic' -void basic() +void basicEmbedV2() diff --git a/src/instrumentation/cohere/instrumentation.ts b/src/instrumentation/cohere/instrumentation.ts index b1e68ec6..662a32c7 100644 --- a/src/instrumentation/cohere/instrumentation.ts +++ b/src/instrumentation/cohere/instrumentation.ts @@ -18,8 +18,8 @@ import { diag } from '@opentelemetry/api' import { InstrumentationBase, InstrumentationModuleDefinition, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation' // eslint-disable-next-line no-restricted-imports import { version, name } from '../../../package.json' -import { ChatFn, ChatStreamFn, EmbedFn, EmbedJobsCreateFn, RerankFn } from '@langtrace-instrumentation/cohere/types' -import { chatPatch, chatStreamPatch, embedJobsCreatePatch, embedPatch, rerankPatch } from '@langtrace-instrumentation/cohere/patch' +import { ChatFn, ChatStreamFn, ChatV2Fn, ChatV2StreamFn, EmbedFn, EmbedJobsCreateFn, RerankFn } from '@langtrace-instrumentation/cohere/types' +import { chatPatch, chatPatchV2, chatStreamPatch, chatStreamPatchV2, embedJobsCreatePatch, embedPatch, rerankPatch } from '@langtrace-instrumentation/cohere/patch' class CohereInstrumentation extends InstrumentationBase { constructor () { @@ -51,6 +51,8 @@ class CohereInstrumentation extends InstrumentationBase { } private _patch (cohere: any, moduleVersion?: string): void { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const that = this if (isWrapped(cohere.CohereClient.prototype)) { this._unpatch(cohere) } @@ -59,6 +61,30 @@ class CohereInstrumentation extends InstrumentationBase { cohere.CohereClient.prototype.chat.name, (original: ChatFn) => chatPatch(original, this.tracer, this.instrumentationVersion, name, moduleVersion) ) + this._wrap( + cohere, + 'CohereClientV2', + (OriginalClient: typeof cohere.CohereClientV2) => { + return function (this: any, ...args: any[]) { + const instance: any = new OriginalClient(...args) + const originalChat: ChatV2Fn = instance.chat + instance.chat = chatPatchV2(originalChat, that.tracer, that.instrumentationVersion, name, moduleVersion) + return instance + } + } + ) + this._wrap( + cohere, + 'CohereClientV2', + (OriginalClient: typeof cohere.CohereClientV2) => { + return function (this: any, ...args: any[]) { + const instance: any = new OriginalClient(...args) + const originalChat: ChatV2StreamFn = instance.chatStream + instance.chatStream = chatStreamPatchV2(originalChat, that.tracer, that.instrumentationVersion, name, moduleVersion) + return instance + } + } + ) this._wrap(cohere.CohereClient.prototype, cohere.CohereClient.prototype.chatStream.name, (original: ChatStreamFn) => chatStreamPatch(original, this.tracer, this.instrumentationVersion, name, moduleVersion)) @@ -67,10 +93,36 @@ class CohereInstrumentation extends InstrumentationBase { cohere.CohereClient.prototype.embed.name, (original: EmbedFn) => embedPatch(original, this.tracer, this.instrumentationVersion, name, moduleVersion)) + this._wrap( + cohere, + 'CohereClientV2', + (OriginalClient: typeof cohere.CohereClientV2) => { + return function (this: any, ...args: any[]) { + const instance: any = new OriginalClient(...args) + const originalChat: EmbedFn = instance.embed + instance.embed = embedPatch(originalChat, that.tracer, that.instrumentationVersion, name, moduleVersion) + return instance + } + } + ) + this._wrap(cohere.CohereClient.prototype, cohere.CohereClient.prototype.rerank.name, (original: RerankFn) => rerankPatch(original, this.tracer, this.instrumentationVersion, name, moduleVersion)) + this._wrap( + cohere, + 'CohereClientV2', + (OriginalClient: typeof cohere.CohereClientV2) => { + return function (this: any, ...args: any[]) { + const instance: any = new OriginalClient(...args) + const originalChat: RerankFn = instance.rerank + instance.rerank = rerankPatch(originalChat, that.tracer, that.instrumentationVersion, name, moduleVersion) + return instance + } + } + ) + this._wrap(cohere.CohereClient.prototype.embedJobs, 'create', (original: EmbedJobsCreateFn) => embedJobsCreatePatch(original, this.tracer, this.instrumentationVersion, name, moduleVersion)) diff --git a/src/instrumentation/cohere/patch.ts b/src/instrumentation/cohere/patch.ts index c67ef28f..3fd56640 100644 --- a/src/instrumentation/cohere/patch.ts +++ b/src/instrumentation/cohere/patch.ts @@ -26,14 +26,17 @@ import { trace } from '@opentelemetry/api' import { - ICohereClient, IChatRequest, IRequestOptions, ChatFn, INonStreamedChatResponse, ChatStreamFn, IEmbedRequest, IEmbedResponse, + ICohereClient, IChatRequest, IV2ChatRequest, IRequestOptions, ChatFn, INonStreamedChatResponse, ChatStreamFn, IEmbedRequest, IEmbedResponse, EmbedFn, RerankFn, IRerankResponse, IRerankRequest, EmbedJobsCreateFn, ICreateEmbedJobRequest, - ICreateEmbedJobResponse + ICreateEmbedJobResponse, + IV2ChatResponse, + ChatV2Fn, + ChatV2StreamFn } from '@langtrace-instrumentation/cohere/types' import { APIS, LLMSpanAttributes, Event } from '@langtrase/trace-attributes' import { addSpanEvent, createStreamProxy } from '@langtrace-utils/misc' @@ -108,6 +111,83 @@ export const chatPatch = (original: ChatFn, tracer: Tracer, langtraceVersion: st } } +export const chatPatchV2 = ( + original: ChatV2Fn, + tracer: Tracer, + langtraceVersion: string, + sdkName: string, + moduleVersion?: string +) => { + return async function ( + this: ICohereClient, + request: IV2ChatRequest, + requestOptions?: IRequestOptions + ): Promise { + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + const attributes: LLMSpanAttributes = { + 'langtrace.sdk.name': sdkName, + 'langtrace.service.name': this._options.clientName ?? 'cohere', + 'langtrace.service.type': 'llm', + 'gen_ai.operation.name': 'chat', + 'langtrace.version': langtraceVersion, + 'langtrace.service.version': moduleVersion, + 'url.full': 'https://api.cohere.ai', + 'url.path': APIS.cohere.CHATV2.ENDPOINT, + 'gen_ai.request.model': request.model ?? 'command-r', + 'http.max.retries': requestOptions?.maxRetries, + 'gen_ai.request.temperature': request.temperature, + 'gen_ai.request.frequency_penalty': request.frequencyPenalty, + 'gen_ai.request.presence_penalty': request.presencePenalty, + 'gen_ai.request.top_p': request.p, + 'gen_ai.request.top_k': request.k, + 'gen_ai.request.seed': request.seed?.toString(), + 'gen_ai.request.max_tokens': request.maxTokens, + 'gen_ai.request.documents': request.documents !== undefined ? JSON.stringify(request.documents) : undefined, + 'gen_ai.request.tools': request.tools !== undefined ? JSON.stringify(request.tools) : undefined, + 'http.timeout': requestOptions?.timeoutInSeconds !== undefined ? requestOptions.timeoutInSeconds / 1000 : undefined, + ...customAttributes + } + + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? APIS.cohere.CHAT.METHOD + const span = tracer.startSpan(spanName, { attributes, kind: SpanKind.CLIENT }, context.active()) + + try { + return await context.with(trace.setSpan(context.active(), span), async () => { + const prompts = [...request.messages] + + const response = await original.apply(this, [request, requestOptions]) + + const responseAttributes: Partial = { + 'gen_ai.usage.input_tokens': response.usage.billedUnits.inputTokens, + 'gen_ai.usage.output_tokens': response.usage.billedUnits.outputTokens, + 'gen_ai.usage.total_tokens': response.usage.billedUnits.inputTokens + response.usage.billedUnits.outputTokens, + 'gen_ai.response_id': response.id + } + + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(prompts) }) + + const assistantMessage = { + role: response.message.role, + content: response.message.content[0]?.text ?? '' + } + + addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify([assistantMessage]) }) + + span.setAttributes({ ...attributes, ...responseAttributes }) + span.setStatus({ code: SpanStatusCode.OK }) + + return response + }) + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + throw new LangtraceSdkError(error.message as string, error.stack as string) + } finally { + span.end() + } + } +} + export const chatStreamPatch = (original: ChatStreamFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string) => { return async function (this: ICohereClient, request: IChatRequest, requestOptions?: IRequestOptions): Promise { const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} @@ -155,6 +235,43 @@ export const chatStreamPatch = (original: ChatStreamFn, tracer: Tracer, langtrac } } +export const chatStreamPatchV2 = (original: ChatV2StreamFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string) => { + return async function (this: ICohereClient, request: IV2ChatRequest, requestOptions?: IRequestOptions): Promise { + const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} + const attributes: LLMSpanAttributes = { + 'langtrace.sdk.name': sdkName, + 'langtrace.service.name': this._options.clientName ?? 'cohere', + 'langtrace.service.type': 'llm', + 'gen_ai.operation.name': 'chat', + 'langtrace.version': langtraceVersion, + 'langtrace.service.version': moduleVersion, + 'url.full': 'https://api.cohere.ai', + 'url.path': '/v2/chat', + 'gen_ai.request.stream': true, + 'gen_ai.request.model': request.model ?? 'command-r', + 'http.max.retries': requestOptions?.maxRetries, + 'gen_ai.request.temperature': request.temperature, + 'gen_ai.request.frequency_penalty': request.frequencyPenalty, + 'gen_ai.request.presence_penalty': request.presencePenalty, + 'gen_ai.request.top_p': request.p, + 'gen_ai.request.top_k': request.k, + 'gen_ai.request.max_tokens': request.maxTokens, + 'gen_ai.request.seed': request.seed?.toString(), + 'gen_ai.request.documents': request.documents !== undefined ? JSON.stringify(request.documents) : undefined, + 'gen_ai.request.tools': request.tools !== undefined ? JSON.stringify(request.tools) : undefined, + 'http.timeout': requestOptions?.timeoutInSeconds !== undefined ? requestOptions.timeoutInSeconds / 1000 : undefined, + ...customAttributes + } + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? 'cohere.chatStream' + const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes }, context.active()) + return await context.with(trace.setSpan(context.active(), span), async () => { + addSpanEvent(span, Event.GEN_AI_PROMPT, { 'gen_ai.prompt': JSON.stringify(request.messages) }) + const response = await original.apply(this, [request, requestOptions]) + return createStreamProxy(response, handleStreamV2(response, attributes, span)) + }) + } +} + export const embedPatch = (original: EmbedFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string) => { return async function (this: ICohereClient, request: IEmbedRequest, requestOptions?: IRequestOptions): Promise { const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} @@ -320,3 +437,46 @@ async function * handleStream (stream: any, attributes: LLMSpanAttributes, span: span.end() } } + +async function * handleStreamV2 (stream: any, attributes: LLMSpanAttributes, span: Span): AsyncGenerator { + let accumulatedText = '' + + try { + addSpanEvent(span, Event.STREAM_START) + + for await (const chunk of stream) { + if (chunk.type === 'message-start') { + attributes['gen_ai.response_id'] = chunk.id + } else if (chunk.type === 'content-delta') { + accumulatedText += chunk.delta?.message?.content?.text as string + } else if (chunk.type === 'message-end') { + addSpanEvent(span, Event.STREAM_END) + + const response = { + role: 'assistant', + content: accumulatedText + } + + addSpanEvent(span, Event.GEN_AI_COMPLETION, { 'gen_ai.completion': JSON.stringify([response]) }) + + if (chunk.delta?.usage?.billedUnits !== undefined) { + const { inputTokens, outputTokens } = chunk.delta.usage.billedUnits + attributes['gen_ai.usage.input_tokens'] = inputTokens + attributes['gen_ai.usage.output_tokens'] = outputTokens + attributes['gen_ai.usage.total_tokens'] = Number(inputTokens ?? 0) + Number(outputTokens ?? 0) + } + } + + yield chunk + } + + span.setAttributes(attributes) + span.setStatus({ code: SpanStatusCode.OK }) + } catch (error: any) { + span.recordException(error as Exception) + span.setStatus({ code: SpanStatusCode.ERROR }) + throw new LangtraceSdkError(error.message as string, error.stack as string) + } finally { + span.end() + } +} diff --git a/src/instrumentation/cohere/types.ts b/src/instrumentation/cohere/types.ts index bbf7fda7..f352f8a1 100644 --- a/src/instrumentation/cohere/types.ts +++ b/src/instrumentation/cohere/types.ts @@ -1,6 +1,8 @@ // Functions export type ChatFn = (request: IChatRequest, requestOptions?: IRequestOptions) => Promise +export type ChatV2Fn = (request: IV2ChatRequest, requestOptions?: IRequestOptions) => Promise export type ChatStreamFn = (request: IChatRequest, requestOptions?: IRequestOptions) => Promise +export type ChatV2StreamFn = (request: IV2ChatRequest, requestOptions?: IRequestOptions) => Promise export type EmbedFn = (request: IEmbedRequest, requestOptions?: IRequestOptions) => Promise export type EmbedJobsCreateFn = (request: ICreateEmbedJobRequest, requestOptions?: IRequestOptions) => Promise export type RerankFn = (request: IRerankRequest, requestOptions?: IRequestOptions) => Promise @@ -103,6 +105,46 @@ interface IToolCall { } +export interface IMessageContent { + type: string + text: string +} + +export interface IAssistantMessage { + role: string + content: IMessageContent[] +} + +export interface IV2ChatResponse { + id: string + message: IAssistantMessage + finishReason: string + usage: { + billedUnits: { + inputTokens: number + outputTokens: number + } + tokens: { + inputTokens: number + outputTokens: number + } + } +} + +export interface IV2ChatRequest { + messages: Array<{ role: string, content: string }> + model?: string + temperature?: number + frequencyPenalty?: number + presencePenalty?: number + p?: number + k?: number + seed?: number + maxTokens?: number + documents?: any + tools?: any +} + export interface INonStreamedChatResponse { response_id: string isSearchRequired: boolean From 2d4cba0b97f0f096a3c203517eefdba493d9163b Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Tue, 17 Dec 2024 16:20:03 +0100 Subject: [PATCH 24/25] bump version --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 50d4e1a6..603939f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/typescript-sdk", - "version": "6.3.0", + "version": "6.3.1", "description": "A typescript SDK for Langtrace", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -22,7 +22,7 @@ "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.670.0", - "@langtrase/trace-attributes": "7.5.0", + "@langtrase/trace-attributes": "7.5.1", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -49,7 +49,7 @@ "@typescript-eslint/eslint-plugin": "^5.62.0", "ai": "^3.2.29", "chromadb": "^1.9.4", - "cohere-ai": "^7.9.3", + "cohere-ai": "^7.15.0", "dotenv": "^16.4.5", "eslint": "^8.34.0", "eslint-config-standard-with-typescript": "^23.0.0", From 00e6025d37bddab2864be329884848e0611e6a71 Mon Sep 17 00:00:00 2001 From: Obinna Okafor Date: Wed, 18 Dec 2024 13:32:02 +0100 Subject: [PATCH 25/25] update package lok and add v2 endpoints --- package-lock.json | 330 +++++++++++++++++- src/instrumentation/cohere/instrumentation.ts | 4 +- src/instrumentation/cohere/patch.ts | 14 +- 3 files changed, 327 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index cd894744..43ee1df9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "@langtrase/typescript-sdk", - "version": "6.2.0", + "version": "6.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/typescript-sdk", - "version": "6.2.0", + "version": "6.3.1", "license": "Apache-2.0", "dependencies": { "@aws-sdk/client-bedrock-runtime": "^3.670.0", - "@langtrase/trace-attributes": "7.5.0", + "@langtrase/trace-attributes": "7.5.1", "@opentelemetry/api": "^1.7.0", "@opentelemetry/instrumentation": "^0.49.1", "@opentelemetry/sdk-trace-base": "^1.22.0", @@ -37,7 +37,7 @@ "@typescript-eslint/eslint-plugin": "^5.62.0", "ai": "^3.2.29", "chromadb": "^1.9.4", - "cohere-ai": "^7.9.3", + "cohere-ai": "^7.15.0", "dotenv": "^16.4.5", "eslint": "^8.34.0", "eslint-config-standard-with-typescript": "^23.0.0", @@ -2604,9 +2604,10 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==" }, "node_modules/@langtrase/trace-attributes": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.5.0.tgz", - "integrity": "sha512-U+2dMRJaRv0R6i9qrzh1hXREkrqg01EboCDfrovXeXySFsVGCuvSD8iavXzheOSWVLy9XbiM6gJjekdUFhAhQg==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@langtrase/trace-attributes/-/trace-attributes-7.5.1.tgz", + "integrity": "sha512-zcBgpDxg1GCBemmPsj9iyGmLQ0cuXTxAJdWyN5UoPHva7KQ546fz54nz2fNHgAY5a3FjcLJZjFPE4LZy+9mQlg==", + "license": "MIT", "dependencies": { "js-tiktoken": "^1.0.14", "json-schema-to-typescript": "^14.1.0", @@ -7218,24 +7219,51 @@ } }, "node_modules/cohere-ai": { - "version": "7.10.2", - "resolved": "https://registry.npmjs.org/cohere-ai/-/cohere-ai-7.10.2.tgz", - "integrity": "sha512-Dh1nLugCdSsqQ+PZN+ABRQVQum83udHeBNxC0nJJeIDDzIuEvlpYqXlESPeAnTnjXCjC/glXWBhFDXR5ZbmNrg==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/cohere-ai/-/cohere-ai-7.15.0.tgz", + "integrity": "sha512-yhyoUdLXKePmGMxJVOtmvJCKt8WdVAK/fdzgk/IHQJTDOYCRyFeulGxayFY5xUv7MkRRLVsVKDU5sx2NLcG+qA==", "dev": true, "dependencies": { "@aws-sdk/client-sagemaker": "^3.583.0", "@aws-sdk/credential-providers": "^3.583.0", "@aws-sdk/protocol-http": "^3.374.0", "@aws-sdk/signature-v4": "^3.374.0", - "form-data": "4.0.0", + "convict": "^6.2.4", + "form-data": "^4.0.0", "form-data-encoder": "^4.0.2", "formdata-node": "^6.0.3", "js-base64": "3.7.2", "node-fetch": "2.7.0", "qs": "6.11.2", + "readable-stream": "^4.5.2", "url-join": "4.0.1" } }, + "node_modules/cohere-ai/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/cohere-ai/node_modules/form-data-encoder": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-4.0.2.tgz", @@ -7254,6 +7282,54 @@ "node": ">= 18" } }, + "node_modules/cohere-ai/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/cohere-ai/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/cohere-ai/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/color": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", @@ -7356,6 +7432,30 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/convict": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/convict/-/convict-6.2.4.tgz", + "integrity": "sha512-qN60BAwdMVdofckX7AlohVJ2x9UvjTNoKVXCL2LxFk1l7757EJqf1nySdMkPQer0bt8kQ5lQiyZ9/2NvrFBuwQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "lodash.clonedeep": "^4.5.0", + "yargs-parser": "^20.2.7" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/convict/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -10948,6 +11048,13 @@ "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", "dev": true }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -11740,6 +11847,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11756,6 +11864,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -11767,11 +11876,13 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11788,6 +11899,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -11802,11 +11914,13 @@ }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/@npmcli/agent": { "version": "2.2.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11822,6 +11936,7 @@ }, "node_modules/npm/node_modules/@npmcli/arborist": { "version": "7.5.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11870,6 +11985,7 @@ }, "node_modules/npm/node_modules/@npmcli/config": { "version": "8.3.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11888,6 +12004,7 @@ }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11899,6 +12016,7 @@ }, "node_modules/npm/node_modules/@npmcli/git": { "version": "5.0.8", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11918,6 +12036,7 @@ }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11933,6 +12052,7 @@ }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { "version": "3.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11947,6 +12067,7 @@ }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { "version": "7.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11962,6 +12083,7 @@ }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11970,6 +12092,7 @@ }, "node_modules/npm/node_modules/@npmcli/node-gyp": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -11978,6 +12101,7 @@ }, "node_modules/npm/node_modules/@npmcli/package-json": { "version": "5.2.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -11995,6 +12119,7 @@ }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12006,6 +12131,7 @@ }, "node_modules/npm/node_modules/@npmcli/query": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12017,6 +12143,7 @@ }, "node_modules/npm/node_modules/@npmcli/redact": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12025,6 +12152,7 @@ }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "8.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12041,6 +12169,7 @@ }, "node_modules/npm/node_modules/@pkgjs/parseargs": { "version": "0.11.0", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -12050,6 +12179,7 @@ }, "node_modules/npm/node_modules/@sigstore/bundle": { "version": "2.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -12061,6 +12191,7 @@ }, "node_modules/npm/node_modules/@sigstore/core": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -12069,6 +12200,7 @@ }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { "version": "0.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -12077,6 +12209,7 @@ }, "node_modules/npm/node_modules/@sigstore/sign": { "version": "2.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -12093,6 +12226,7 @@ }, "node_modules/npm/node_modules/@sigstore/tuf": { "version": "2.3.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -12105,6 +12239,7 @@ }, "node_modules/npm/node_modules/@sigstore/verify": { "version": "1.2.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -12118,6 +12253,7 @@ }, "node_modules/npm/node_modules/@tufjs/canonical-json": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12126,6 +12262,7 @@ }, "node_modules/npm/node_modules/@tufjs/models": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12138,6 +12275,7 @@ }, "node_modules/npm/node_modules/abbrev": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12146,6 +12284,7 @@ }, "node_modules/npm/node_modules/agent-base": { "version": "7.1.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12157,6 +12296,7 @@ }, "node_modules/npm/node_modules/aggregate-error": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12169,6 +12309,7 @@ }, "node_modules/npm/node_modules/ansi-regex": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12177,6 +12318,7 @@ }, "node_modules/npm/node_modules/ansi-styles": { "version": "6.2.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12188,21 +12330,25 @@ }, "node_modules/npm/node_modules/aproba": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/bin-links": { "version": "4.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12217,6 +12363,7 @@ }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.3.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12228,6 +12375,7 @@ }, "node_modules/npm/node_modules/brace-expansion": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12236,6 +12384,7 @@ }, "node_modules/npm/node_modules/cacache": { "version": "18.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12258,6 +12407,7 @@ }, "node_modules/npm/node_modules/chalk": { "version": "5.3.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12269,6 +12419,7 @@ }, "node_modules/npm/node_modules/chownr": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12277,6 +12428,7 @@ }, "node_modules/npm/node_modules/ci-info": { "version": "4.0.0", + "dev": true, "funding": [ { "type": "github", @@ -12291,6 +12443,7 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12302,6 +12455,7 @@ }, "node_modules/npm/node_modules/clean-stack": { "version": "2.2.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12310,6 +12464,7 @@ }, "node_modules/npm/node_modules/cli-columns": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12322,6 +12477,7 @@ }, "node_modules/npm/node_modules/cmd-shim": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12330,6 +12486,7 @@ }, "node_modules/npm/node_modules/color-convert": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12341,16 +12498,19 @@ }, "node_modules/npm/node_modules/color-name": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/cross-spawn": { "version": "7.0.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12364,6 +12524,7 @@ }, "node_modules/npm/node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12378,6 +12539,7 @@ }, "node_modules/npm/node_modules/cssesc": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -12389,6 +12551,7 @@ }, "node_modules/npm/node_modules/debug": { "version": "4.3.6", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12405,11 +12568,13 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/diff": { "version": "5.2.0", + "dev": true, "inBundle": true, "license": "BSD-3-Clause", "engines": { @@ -12418,16 +12583,19 @@ }, "node_modules/npm/node_modules/eastasianwidth": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/emoji-regex": { "version": "8.0.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -12437,6 +12605,7 @@ }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12445,16 +12614,19 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "Apache-2.0" }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.16", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12463,6 +12635,7 @@ }, "node_modules/npm/node_modules/foreground-child": { "version": "3.3.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12478,6 +12651,7 @@ }, "node_modules/npm/node_modules/fs-minipass": { "version": "3.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12489,6 +12663,7 @@ }, "node_modules/npm/node_modules/glob": { "version": "10.4.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12508,11 +12683,13 @@ }, "node_modules/npm/node_modules/graceful-fs": { "version": "4.2.11", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/hosted-git-info": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12524,11 +12701,13 @@ }, "node_modules/npm/node_modules/http-cache-semantics": { "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12541,6 +12720,7 @@ }, "node_modules/npm/node_modules/https-proxy-agent": { "version": "7.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12553,6 +12733,7 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -12565,6 +12746,7 @@ }, "node_modules/npm/node_modules/ignore-walk": { "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12576,6 +12758,7 @@ }, "node_modules/npm/node_modules/imurmurhash": { "version": "0.1.4", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12584,6 +12767,7 @@ }, "node_modules/npm/node_modules/indent-string": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12592,6 +12776,7 @@ }, "node_modules/npm/node_modules/ini": { "version": "4.1.3", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12600,6 +12785,7 @@ }, "node_modules/npm/node_modules/init-package-json": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12617,6 +12803,7 @@ }, "node_modules/npm/node_modules/ip-address": { "version": "9.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12629,6 +12816,7 @@ }, "node_modules/npm/node_modules/ip-regex": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12640,6 +12828,7 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "5.1.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -12651,6 +12840,7 @@ }, "node_modules/npm/node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12659,16 +12849,19 @@ }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/jackspeak": { "version": "3.4.3", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -12683,11 +12876,13 @@ }, "node_modules/npm/node_modules/jsbn": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "3.0.2", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -12696,6 +12891,7 @@ }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -12704,6 +12900,7 @@ }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", + "dev": true, "engines": [ "node >= 0.2.0" ], @@ -12712,16 +12909,19 @@ }, "node_modules/npm/node_modules/just-diff": { "version": "6.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff-apply": { "version": "5.5.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { "version": "8.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12734,6 +12934,7 @@ }, "node_modules/npm/node_modules/libnpmdiff": { "version": "6.1.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12752,6 +12953,7 @@ }, "node_modules/npm/node_modules/libnpmexec": { "version": "8.1.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12772,6 +12974,7 @@ }, "node_modules/npm/node_modules/libnpmfund": { "version": "5.0.12", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12783,6 +12986,7 @@ }, "node_modules/npm/node_modules/libnpmhook": { "version": "10.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12795,6 +12999,7 @@ }, "node_modules/npm/node_modules/libnpmorg": { "version": "6.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12807,6 +13012,7 @@ }, "node_modules/npm/node_modules/libnpmpack": { "version": "7.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12821,6 +13027,7 @@ }, "node_modules/npm/node_modules/libnpmpublish": { "version": "9.0.9", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12839,6 +13046,7 @@ }, "node_modules/npm/node_modules/libnpmsearch": { "version": "7.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12850,6 +13058,7 @@ }, "node_modules/npm/node_modules/libnpmteam": { "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12862,6 +13071,7 @@ }, "node_modules/npm/node_modules/libnpmversion": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12877,11 +13087,13 @@ }, "node_modules/npm/node_modules/lru-cache": { "version": "10.4.3", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/make-fetch-happen": { "version": "13.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12904,6 +13116,7 @@ }, "node_modules/npm/node_modules/minimatch": { "version": "9.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12918,6 +13131,7 @@ }, "node_modules/npm/node_modules/minipass": { "version": "7.1.2", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -12926,6 +13140,7 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12937,6 +13152,7 @@ }, "node_modules/npm/node_modules/minipass-fetch": { "version": "3.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -12953,6 +13169,7 @@ }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12964,6 +13181,7 @@ }, "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12975,6 +13193,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12986,6 +13205,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -12997,6 +13217,7 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13008,6 +13229,7 @@ }, "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13019,6 +13241,7 @@ }, "node_modules/npm/node_modules/minizlib": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13031,6 +13254,7 @@ }, "node_modules/npm/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13042,6 +13266,7 @@ }, "node_modules/npm/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -13053,11 +13278,13 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13066,6 +13293,7 @@ }, "node_modules/npm/node_modules/negotiator": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13074,6 +13302,7 @@ }, "node_modules/npm/node_modules/node-gyp": { "version": "10.2.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13097,6 +13326,7 @@ }, "node_modules/npm/node_modules/nopt": { "version": "7.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13111,6 +13341,7 @@ }, "node_modules/npm/node_modules/normalize-package-data": { "version": "6.0.2", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -13124,6 +13355,7 @@ }, "node_modules/npm/node_modules/npm-audit-report": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13132,6 +13364,7 @@ }, "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13143,6 +13376,7 @@ }, "node_modules/npm/node_modules/npm-install-checks": { "version": "6.3.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -13154,6 +13388,7 @@ }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13162,6 +13397,7 @@ }, "node_modules/npm/node_modules/npm-package-arg": { "version": "11.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13176,6 +13412,7 @@ }, "node_modules/npm/node_modules/npm-packlist": { "version": "8.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13187,6 +13424,7 @@ }, "node_modules/npm/node_modules/npm-pick-manifest": { "version": "9.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13201,6 +13439,7 @@ }, "node_modules/npm/node_modules/npm-profile": { "version": "10.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13213,6 +13452,7 @@ }, "node_modules/npm/node_modules/npm-registry-fetch": { "version": "17.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13231,6 +13471,7 @@ }, "node_modules/npm/node_modules/npm-user-validate": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "engines": { @@ -13239,6 +13480,7 @@ }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13253,11 +13495,13 @@ }, "node_modules/npm/node_modules/package-json-from-dist": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0" }, "node_modules/npm/node_modules/pacote": { "version": "18.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13288,6 +13532,7 @@ }, "node_modules/npm/node_modules/parse-conflict-json": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13301,6 +13546,7 @@ }, "node_modules/npm/node_modules/path-key": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13309,6 +13555,7 @@ }, "node_modules/npm/node_modules/path-scurry": { "version": "1.11.1", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -13324,6 +13571,7 @@ }, "node_modules/npm/node_modules/postcss-selector-parser": { "version": "6.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13336,6 +13584,7 @@ }, "node_modules/npm/node_modules/proc-log": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13344,6 +13593,7 @@ }, "node_modules/npm/node_modules/proggy": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13352,6 +13602,7 @@ }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -13360,6 +13611,7 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -13368,11 +13620,13 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13385,6 +13639,7 @@ }, "node_modules/npm/node_modules/promzard": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13396,6 +13651,7 @@ }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", + "dev": true, "inBundle": true, "bin": { "qrcode-terminal": "bin/qrcode-terminal.js" @@ -13403,6 +13659,7 @@ }, "node_modules/npm/node_modules/read": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13414,6 +13671,7 @@ }, "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13422,6 +13680,7 @@ }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13434,6 +13693,7 @@ }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13442,12 +13702,14 @@ }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "optional": true }, "node_modules/npm/node_modules/semver": { "version": "7.6.3", + "dev": true, "inBundle": true, "license": "ISC", "bin": { @@ -13459,6 +13721,7 @@ }, "node_modules/npm/node_modules/shebang-command": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13470,6 +13733,7 @@ }, "node_modules/npm/node_modules/shebang-regex": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13478,6 +13742,7 @@ }, "node_modules/npm/node_modules/signal-exit": { "version": "4.1.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13489,6 +13754,7 @@ }, "node_modules/npm/node_modules/sigstore": { "version": "2.3.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -13505,6 +13771,7 @@ }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13514,6 +13781,7 @@ }, "node_modules/npm/node_modules/socks": { "version": "2.8.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13527,6 +13795,7 @@ }, "node_modules/npm/node_modules/socks-proxy-agent": { "version": "8.0.4", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13540,6 +13809,7 @@ }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.2.0", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -13549,6 +13819,7 @@ }, "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13558,11 +13829,13 @@ }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.5.0", + "dev": true, "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13572,16 +13845,19 @@ }, "node_modules/npm/node_modules/spdx-license-ids": { "version": "3.0.18", + "dev": true, "inBundle": true, "license": "CC0-1.0" }, "node_modules/npm/node_modules/sprintf-js": { "version": "1.1.3", + "dev": true, "inBundle": true, "license": "BSD-3-Clause" }, "node_modules/npm/node_modules/ssri": { "version": "10.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13593,6 +13869,7 @@ }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13607,6 +13884,7 @@ "node_modules/npm/node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13620,6 +13898,7 @@ }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13632,6 +13911,7 @@ "node_modules/npm/node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13643,6 +13923,7 @@ }, "node_modules/npm/node_modules/supports-color": { "version": "9.4.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13654,6 +13935,7 @@ }, "node_modules/npm/node_modules/tar": { "version": "6.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13670,6 +13952,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13681,6 +13964,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13692,6 +13976,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/minipass": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13700,16 +13985,19 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/treeverse": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13718,6 +14006,7 @@ }, "node_modules/npm/node_modules/tuf-js": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13731,6 +14020,7 @@ }, "node_modules/npm/node_modules/unique-filename": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13742,6 +14032,7 @@ }, "node_modules/npm/node_modules/unique-slug": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13753,11 +14044,13 @@ }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -13767,6 +14060,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13776,6 +14070,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13784,11 +14079,13 @@ }, "node_modules/npm/node_modules/walk-up-path": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/which": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13803,6 +14100,7 @@ }, "node_modules/npm/node_modules/which/node_modules/isexe": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -13811,6 +14109,7 @@ }, "node_modules/npm/node_modules/wrap-ansi": { "version": "8.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13828,6 +14127,7 @@ "node_modules/npm/node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13844,6 +14144,7 @@ }, "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13858,6 +14159,7 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -13869,11 +14171,13 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { "version": "9.2.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13890,6 +14194,7 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "7.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -13904,6 +14209,7 @@ }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -13916,6 +14222,7 @@ }, "node_modules/npm/node_modules/yallist": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, @@ -14864,7 +15171,6 @@ "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", "dev": true, - "optional": true, "engines": { "node": ">= 0.6.0" } diff --git a/src/instrumentation/cohere/instrumentation.ts b/src/instrumentation/cohere/instrumentation.ts index 662a32c7..a5e1f3b1 100644 --- a/src/instrumentation/cohere/instrumentation.ts +++ b/src/instrumentation/cohere/instrumentation.ts @@ -100,7 +100,7 @@ class CohereInstrumentation extends InstrumentationBase { return function (this: any, ...args: any[]) { const instance: any = new OriginalClient(...args) const originalChat: EmbedFn = instance.embed - instance.embed = embedPatch(originalChat, that.tracer, that.instrumentationVersion, name, moduleVersion) + instance.embed = embedPatch(originalChat, that.tracer, that.instrumentationVersion, name, moduleVersion, true) return instance } } @@ -117,7 +117,7 @@ class CohereInstrumentation extends InstrumentationBase { return function (this: any, ...args: any[]) { const instance: any = new OriginalClient(...args) const originalChat: RerankFn = instance.rerank - instance.rerank = rerankPatch(originalChat, that.tracer, that.instrumentationVersion, name, moduleVersion) + instance.rerank = rerankPatch(originalChat, that.tracer, that.instrumentationVersion, name, moduleVersion, true) return instance } } diff --git a/src/instrumentation/cohere/patch.ts b/src/instrumentation/cohere/patch.ts index 3fd56640..9e593472 100644 --- a/src/instrumentation/cohere/patch.ts +++ b/src/instrumentation/cohere/patch.ts @@ -246,7 +246,7 @@ export const chatStreamPatchV2 = (original: ChatV2StreamFn, tracer: Tracer, lang 'langtrace.version': langtraceVersion, 'langtrace.service.version': moduleVersion, 'url.full': 'https://api.cohere.ai', - 'url.path': '/v2/chat', + 'url.path': APIS.cohere.CHAT_STREAM_V2.ENDPOINT, 'gen_ai.request.stream': true, 'gen_ai.request.model': request.model ?? 'command-r', 'http.max.retries': requestOptions?.maxRetries, @@ -272,7 +272,7 @@ export const chatStreamPatchV2 = (original: ChatV2StreamFn, tracer: Tracer, lang } } -export const embedPatch = (original: EmbedFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string) => { +export const embedPatch = (original: EmbedFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string, v2 = false) => { return async function (this: ICohereClient, request: IEmbedRequest, requestOptions?: IRequestOptions): Promise { const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} const attributes: LLMSpanAttributes = { @@ -283,7 +283,7 @@ export const embedPatch = (original: EmbedFn, tracer: Tracer, langtraceVersion: 'langtrace.version': langtraceVersion, 'langtrace.service.version': moduleVersion, 'url.full': 'https://api.cohere.ai', - 'url.path': APIS.cohere.EMBED.ENDPOINT, + 'url.path': v2 ? APIS.cohere.EMBEDV2.ENDPOINT : APIS.cohere.EMBED.ENDPOINT, 'gen_ai.request.model': request.model ?? 'embed-english-v2.0', 'http.max.retries': requestOptions?.maxRetries, 'gen_ai.request.embedding_input_type': request.inputType, @@ -292,7 +292,7 @@ export const embedPatch = (original: EmbedFn, tracer: Tracer, langtraceVersion: 'http.timeout': requestOptions?.timeoutInSeconds !== undefined ? requestOptions.timeoutInSeconds / 1000 : undefined, ...customAttributes } - const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? APIS.cohere.EMBED.METHOD + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? v2 ? APIS.cohere.EMBEDV2.METHOD : APIS.cohere.EMBED.METHOD const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes }, context.active()) try { return await context.with(trace.setSpan(context.active(), span), async () => { @@ -358,7 +358,7 @@ export const embedJobsCreatePatch = (original: EmbedJobsCreateFn, tracer: Tracer } } -export const rerankPatch = (original: RerankFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string) => { +export const rerankPatch = (original: RerankFn, tracer: Tracer, langtraceVersion: string, sdkName: string, moduleVersion?: string, v2 = false) => { return async function (this: ICohereClient, request: IRerankRequest, requestOptions?: IRequestOptions): Promise { const customAttributes = context.active().getValue(LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY) ?? {} const attributes: LLMSpanAttributes = { @@ -369,7 +369,7 @@ export const rerankPatch = (original: RerankFn, tracer: Tracer, langtraceVersion 'langtrace.version': langtraceVersion, 'langtrace.service.version': moduleVersion, 'url.full': 'https://api.cohere.ai', - 'url.path': APIS.cohere.RERANK.ENDPOINT, + 'url.path': v2 ? APIS.cohere.RERANKV2.ENDPOINT : APIS.cohere.RERANK.ENDPOINT, 'gen_ai.request.model': request.model ?? '', 'gen_ai.operation.name': 'rerank', 'http.max.retries': requestOptions?.maxRetries, @@ -378,7 +378,7 @@ export const rerankPatch = (original: RerankFn, tracer: Tracer, langtraceVersion 'http.timeout': requestOptions?.timeoutInSeconds !== undefined ? requestOptions.timeoutInSeconds / 1000 : undefined, ...customAttributes } - const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? APIS.cohere.RERANK.METHOD + const spanName = customAttributes['langtrace.span.name' as keyof typeof customAttributes] ?? v2 ? APIS.cohere.RERANKV2.METHOD : APIS.cohere.RERANK.METHOD const span = tracer.startSpan(spanName, { kind: SpanKind.CLIENT, attributes }, context.active()) try { return await context.with(trace.setSpan(context.active(), span), async () => {