Skip to content

Commit

Permalink
Remove the type dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dqbd committed Oct 22, 2024
1 parent aab80c7 commit 3a37732
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
"@langchain/core": "^0.3.1",
"@langchain/langgraph": "^0.2.3",
"@langchain/openai": "^0.3.0",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/sdk-trace-base": "^1.26.0",
"@opentelemetry/sdk-trace-node": "^1.26.0",
"@tsconfig/recommended": "^1.0.2",
Expand Down
12 changes: 6 additions & 6 deletions js/src/wrappers/vercel/exporter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
import type { ExportResult } from "@opentelemetry/core";
import type { ReadableSpan } from "@opentelemetry/sdk-trace-base";
import type { CoreAssistantMessage, CoreMessage, ToolCallPart } from "ai";
import type { AISDKSpan } from "./exporter.types.js";
import { Client } from "../../index.js";
Expand Down Expand Up @@ -212,7 +211,7 @@ interface RunTask {
executionOrder: number;
}

export class LangSmithAISDKExporter implements SpanExporter {
export class LangSmithAISDKExporter {
private client: Client;
private traceByMap: Record<
string,
Expand Down Expand Up @@ -475,10 +474,11 @@ export class LangSmithAISDKExporter implements SpanExporter {
}

export(
spans: ReadableSpan[],
resultCallback: (result: ExportResult) => void
spans: unknown[],
resultCallback: (result: { code: 0 | 1; error?: Error }) => void
): void {
for (const span of spans) {
const typedSpans = spans as ReadableSpan[];
for (const span of typedSpans) {
const { traceId, spanId } = span.spanContext();
const parentId = span.parentSpanId ?? undefined;
this.traceByMap[traceId] ??= {
Expand Down
2 changes: 1 addition & 1 deletion js/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@opentelemetry/[email protected]", "@opentelemetry/api@^1.9.0":
"@opentelemetry/[email protected]":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe"
integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==
Expand Down

0 comments on commit 3a37732

Please sign in to comment.