File tree Expand file tree Collapse file tree
dev-packages/browser-integration-tests/suites/tracing/ai-providers/langchain Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ export class MockChatAnthropic {
66 this . _maxTokens = params . maxTokens ;
77 }
88
9- async invoke ( messages , options ) {
10- const callbacks = options ? .callbacks || [ ] ;
9+ async invoke ( messages , config = { callbacks : [ ] } ) {
10+ const callbacks = config . callbacks ;
1111 const runId = 'mock-run-id-123' ;
1212
1313 const invocationParams = {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const chatModel = new MockChatAnthropic({
1414
1515// Test that manual instrumentation doesn't crash the browser
1616// The instrumentation automatically creates spans
17+ // We can provide callbacks in the config object:https://docs.langchain.com/oss/python/langchain/models#invocation-config
1718const response = await chatModel . invoke ( 'What is the capital of France?' , {
1819 callbacks : [ callbackHandler ] ,
1920} ) ;
You can’t perform that action at this time.
0 commit comments