Skip to content

Commit 4ec0d34

Browse files
committed
Fix content checking test
1 parent cd43dbd commit 4ec0d34

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/versioned/langgraph/graph-stream.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)