Skip to content

Commit

Permalink
fix langchainv2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker-Stafford committed Oct 24, 2024
1 parent 3df6725 commit a68d976
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
7 changes: 6 additions & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@
],
"pnpm": {
"overrides": {
"@langchain/core@^0.2>langchain": "^0.2.17",
"@langchain/core@^0.1>langchain": "^0.1.37",
"langchain@^0.2>@langchain/core": "^0.2.36",
"@langchain/openai@^0.2>@langchain/core": "^0.2.36",
"@langchain/openai@^0.1>@langchain/core": "^0.1.63"
"@langchain/openai@^0.1>@langchain/core": "^0.1.63",
"@langchain/[email protected]>langchain": "^0.1.37",
"@langchain/[email protected]>langchain": "^0.2.17"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,13 @@ describe("LangChainInstrumentation", () => {
`${LLM_OUTPUT_MESSAGES}.0.${MESSAGE_ROLE}`
];

expect(span.attributes).toStrictEqual(expectedStreamingAttributes);
const actualAttributes = { ...span.attributes };
const output = JSON.parse(String(actualAttributes[OUTPUT_VALUE]));
delete output.generations[0][0].message.kwargs.id;
const newOutputValue = JSON.stringify(output);
actualAttributes[OUTPUT_VALUE] = newOutputValue;

expect(actualAttributes).toStrictEqual(expectedStreamingAttributes);
});

it("should add documents to retriever spans", async () => {
Expand Down
24 changes: 21 additions & 3 deletions js/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a68d976

Please sign in to comment.