File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed
Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,19 @@ function runRunnablesTests(config) {
4141 arrayParserOutput
4242 } = config
4343
44- test ( 'should log tracking metrics' , function ( t ) {
45- const { agent, langchainCoreVersion } = t . nr
46- assertPackageMetrics ( { agent, pkg : '@langchain/core' , version : langchainCoreVersion } )
44+ test ( 'should log tracking metrics' , function ( t , end ) {
45+ t . plan ( 5 )
46+ const { agent, langchainCoreVersion, model, prompt } = t . nr
47+ helper . runInTransaction ( agent , async ( ) => {
48+ await prompt . pipe ( model ) . invoke ( inputData )
49+ assertPackageMetrics ( {
50+ agent,
51+ pkg : '@langchain/core' ,
52+ version : langchainCoreVersion ,
53+ subscriberType : true
54+ } , { assert : t . assert } )
55+ end ( )
56+ } )
4757 } )
4858
4959 test ( 'should create langchain events for every invoke call' , ( t , end ) => {
Original file line number Diff line number Diff line change @@ -39,10 +39,20 @@ test.afterEach((ctx) => {
3939 removeMatchedModules ( / c u s t o m - t o o l \. j s $ / )
4040} )
4141
42- test ( 'should log tracking metrics' , function ( t ) {
43- const { agent } = t . nr
42+ test ( 'should log tracking metrics' , function ( t , end ) {
43+ t . plan ( 5 )
44+ const { agent, tool, input } = t . nr
4445 const { version } = require ( '@langchain/core/package.json' )
45- assertPackageMetrics ( { agent, pkg : '@langchain/core' , version } )
46+ helper . runInTransaction ( agent , async ( ) => {
47+ await tool . call ( input )
48+ assertPackageMetrics ( {
49+ agent,
50+ pkg : '@langchain/core' ,
51+ version,
52+ subscriberType : true
53+ } , { assert : t . assert } )
54+ end ( )
55+ } )
4656} )
4757
4858test ( 'should create span on successful tools create' , ( t , end ) => {
You can’t perform that action at this time.
0 commit comments