Skip to content

Commit 58ef4fb

Browse files
committed
fix more tests
1 parent d1587ed commit 58ef4fb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

js/packages/openinference-instrumentation-langchain/test/langchainV3.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,14 @@ describe("LangChainInstrumentation", () => {
245245

246246
await chatModel.invoke("hello, this is a test");
247247

248-
const span = memoryExporter.getFinishedSpans()[0];
249-
expect(span).toBeDefined();
248+
const spans = memoryExporter.getFinishedSpans();
249+
const llmSpan = spans.find(
250+
(span) =>
251+
span.attributes[OPENINFERENCE_SPAN_KIND] === OpenInferenceSpanKind.LLM,
252+
);
253+
expect(llmSpan).toBeDefined();
250254

251-
expect(span.attributes).toStrictEqual({
255+
expect(llmSpan?.attributes).toStrictEqual({
252256
...expectedSpanAttributes,
253257
[LLM_INVOCATION_PARAMETERS]:
254258
'{"model":"gpt-3.5-turbo","temperature":0,"top_p":1,"frequency_penalty":0,"presence_penalty":0,"n":1,"stream":false}',

0 commit comments

Comments
 (0)