File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
x-pack/platform/packages/shared/onechat/onechat-genai-utils/langchain Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff 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 ( ) => {
You can’t perform that action at this time.
0 commit comments