Skip to content

Commit 1b0824b

Browse files
committed
fix unit test
1 parent d952262 commit 1b0824b

File tree

1 file changed

+4
-1
lines changed
  • x-pack/platform/packages/shared/onechat/onechat-genai-utils/langchain

1 file changed

+4
-1
lines changed

x-pack/platform/packages/shared/onechat/onechat-genai-utils/langchain/tools.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ describe('toolToLangchain', () => {
3535
it('converts the tool to langchain', () => {
3636
const tool = createTool('toolA', {
3737
description: 'desc',
38+
schema: z.object({ foo: z.string() }),
3839
});
3940

4041
const langchainTool = toolToLangchain({ tool, toolId: tool.id, logger });
4142
expect(langchainTool.name).toEqual('toolA');
4243
expect(langchainTool.description).toEqual('desc');
4344
expect(langchainTool.responseFormat).toEqual('content_and_artifact');
44-
expect(langchainTool.schema).toEqual(tool.schema);
45+
46+
const toolKeys = Object.keys((langchainTool.schema as any).shape);
47+
expect(toolKeys.sort()).toEqual(['_reasoning', 'foo']);
4548
});
4649

4750
it('wraps the tool handler', async () => {

0 commit comments

Comments
 (0)