@@ -14,7 +14,6 @@ custom logic) managed by the Toolbox into your workflows, especially those
14
14
involving Large Language Models (LLMs).
15
15
16
16
<!-- TOC ignore:true -->
17
- <!-- TOC -->
18
17
- [ Supported Environments] ( #supported-environments )
19
18
- [ Installation] ( #installation )
20
19
- [ Quickstart] ( #quickstart )
@@ -43,6 +42,7 @@ involving Large Language Models (LLMs).
43
42
- [ Option A: Binding Parameters to a Loaded Tool] ( #option-a-binding-parameters-to-a-loaded-tool )
44
43
- [ Option B: Binding Parameters While Loading Tools] ( #option-b-binding-parameters-while-loading-tools )
45
44
- [ Binding Dynamic Values] ( #binding-dynamic-values )
45
+ - [ Using with Orchestration Frameworks] ( #using-with-orchestration-frameworks )
46
46
- [ Contributing] ( #contributing )
47
47
- [ License] ( #license )
48
48
- [ Support] ( #support )
@@ -447,6 +447,102 @@ const dynamicBoundTool = tool.bindParam("param", getDynamicValue)
447
447
> [!IMPORTANT]
448
448
> You don't need to modify tool configurations to bind parameter values.
449
449
450
+ # Using with Orchestration Frameworks
451
+
452
+ <details open>
453
+
454
+ <summary>Langchain</summary>
455
+
456
+ [LangchainJS](https://js.langchain.com/docs/introduction/)
457
+
458
+ ` ` ` javascript
459
+ import {ToolboxClient } from " @toolbox/core"
460
+ import { tool } from " @langchain/core/tools" ;
461
+
462
+ let client = ToolboxClient (URL )
463
+ multiplyTool = await client .loadTool (" multiply" )
464
+
465
+ const multiplyNumbers = tool (multiplyTool, {
466
+ name: multiplyTool .getName (),
467
+ description: multiplyTool .getDescription (),
468
+ schema: multiplyTool .getParams ()
469
+ });
470
+
471
+ await multiplyNumbers .invoke ({ a: 2 , b: 3 });
472
+ ` ` `
473
+
474
+ The ` multiplyNumbers` tool is compatible with [Langchain/Langraph
475
+ agents](http://js.langchain.com/docs/concepts/agents/)
476
+ such as [React
477
+ Agents](https://langchain-ai.github.io/langgraphjs/reference/functions/langgraph_prebuilt.createReactAgent.html).
478
+
479
+ </details>
480
+
481
+ <details>
482
+
483
+ <summary>LlamaIndex</summary>
484
+
485
+ [LlamaindexTS](https://ts.llamaindex.ai/)
486
+
487
+ ` ` ` javascript
488
+ import {ToolboxClient } from " @toolbox/core"
489
+ import { tool } from " llamaindex" ;
490
+
491
+ let client = ToolboxClient (URL )
492
+ multiplyTool = await client .loadTool (" multiply" )
493
+
494
+ const multiplyNumbers = tool ({
495
+ name: multiplyTool .getName (),
496
+ description: multiplyTool .getDescription (),
497
+ parameters: multiplyTool .getParams (),
498
+ execute: mutliplyTool
499
+ });
500
+
501
+ await multiplyNumbers .call ({ a: 2 , b: 3 });
502
+ ` ` `
503
+
504
+ The ` multiplyNumbers` tool is compatible with LlamaIndex
505
+ [agents](https://ts.llamaindex.ai/docs/llamaindex/migration/deprecated/agent)
506
+ and [agent
507
+ workflows](https://ts.llamaindex.ai/docs/llamaindex/modules/agents/agent_workflow).
508
+
509
+ </details>
510
+
511
+ <details>
512
+
513
+ <summary>Genkit</summary>
514
+
515
+ [GenkitJS](https://genkit.dev/docs/get-started/#_top)
516
+ ` ` ` javascript
517
+ import {ToolboxClient } from " @toolbox/core"
518
+ import { genkit , z } from ' genkit' ;
519
+ import { googleAI } from ' @genkit-ai/googleai' ;
520
+
521
+
522
+ let client = ToolboxClient (URL )
523
+ multiplyTool = await client .loadTool (" multiply" )
524
+
525
+ const ai = genkit ({
526
+ plugins: [googleAI ()],
527
+ model: googleAI .model (' gemini-1.5-pro' ),
528
+ });
529
+
530
+ const multiplyNumbers = ai .defineTool ({
531
+ name: multiplyTool .getName (),
532
+ description: multiplyTool .getDescription (),
533
+ inputSchema: multiplyTool .getParams (),
534
+ },
535
+ multiplyTool,
536
+ );
537
+
538
+ await ai .generate ({
539
+ prompt: ' Can you multiply 5 and 7?' ,
540
+ tools: [multiplyNumbers],
541
+ });
542
+ ` ` `
543
+
544
+ </details>
545
+
450
546
# Contributing
451
547
452
548
Contributions are welcome! Please refer to the [DEVELOPER.md](./DEVELOPER.md)
0 commit comments