Skip to content

Commit a42fc2a

Browse files
committed
fix type
1 parent 628a513 commit a42fc2a

File tree

1 file changed

+3
-2
lines changed
  • dev-packages/cloudflare-integration-tests/suites/tracing/langchain

1 file changed

+3
-2
lines changed

dev-packages/cloudflare-integration-tests/suites/tracing/langchain/mocks.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface CallbackHandler {
88
runId: string,
99
parentRunId?: string,
1010
extraParams?: Record<string, unknown>,
11-
tags?: string[],
11+
tags?: string[] | Record<string, unknown>,
1212
metadata?: Record<string, unknown>,
1313
runName?: string,
1414
) => unknown;
@@ -82,6 +82,7 @@ export class MockChatModel {
8282

8383
// Call handleChatModelStart
8484
// Pass tags as a record with invocation_params for proper extraction
85+
// The callback handler's getInvocationParams utility accepts both string[] and Record<string, unknown>
8586
for (const callback of callbacks) {
8687
if (callback.handleChatModelStart) {
8788
await callback.handleChatModelStart(
@@ -90,7 +91,7 @@ export class MockChatModel {
9091
runId,
9192
undefined,
9293
undefined,
93-
{ invocation_params: invocationParams } as unknown as string[], // LangChain can pass tags as either string[] or record
94+
{ invocation_params: invocationParams },
9495
{ ls_model_name: this._model, ls_provider: 'anthropic' },
9596
);
9697
}

0 commit comments

Comments
 (0)