File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -227,8 +227,12 @@ test('should have LlmChatCompletion events from LangChain and OpenAI instrumenta
227227
228228 // Make sure content was properly assigned
229229 const messageEvents = langchainChatEvents . filter ( ( e ) => e [ 0 ] . type === 'LlmChatCompletionMessage' )
230- messageEvents . forEach ( ( e ) => {
231- assert . ok ( e [ 1 ] ?. content ?. length > 0 , 'message content should exist' )
230+ messageEvents . forEach ( ( msg ) => {
231+ if ( msg [ 1 ] ?. is_response === true && msg [ 1 ] ?. role === 'assistant' ) {
232+ assert . equal ( msg [ 1 ] ?. content , '212 degrees Fahrenheit is equal to 100 degrees Celsius.' )
233+ } else if ( msg [ 1 ] ?. is_response === false && msg [ 1 ] ?. role === 'user' ) {
234+ assert . equal ( msg [ 1 ] ?. content , 'You are a scientist.' )
235+ }
232236 } )
233237
234238 tx . end ( )
You can’t perform that action at this time.
0 commit comments