Commit 5f7db59
committed
feat(langgraph|langchain): introduce AgentRunConverter for consistent tool_call_id handling
adds new AgentRunConverter class to maintain tool_call_id consistency in streaming tool calls,
where the first chunk provides the id and subsequent chunks only have index. also updates
integration modules to use the new converter class and maintains backward compatibility.
The new AgentRunConverter class manages the mapping between tool call indices and IDs to ensure
consistent tool_call_id across streaming chunks, which is crucial for proper tool call
correlation in the AG-UI protocol.
// 中文翻译:
添加了新的 AgentRunConverter 类来维护流式工具调用中 tool_call_id 的一致性,
其中第一个数据块提供 ID,后续的数据块只有索引。同时更新了集成模块以使用新
的转换器类并保持向后兼容性。
新的 AgentRunConverter 类管理工具调用索引和 ID 之间的映射,确保跨流式数据块的
tool_call_id 一致性,这对于 AG-UI 协议中的正确工具调用关联至关重要。
Change-Id: I35ce9ac6db8a05d0b052df77aa716bf4402ced64
Signed-off-by: OhYee <oyohyee@oyohyee.com>1 parent 2a0edf4 commit 5f7db59
File tree
5 files changed
+647
-16
lines changed- agentrun/integration
- langchain
- langgraph
- tests/unittests
- integration
5 files changed
+647
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | | - | |
28 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| 501 | + | |
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
505 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
506 | 510 | | |
507 | 511 | | |
508 | 512 | | |
| |||
521 | 525 | | |
522 | 526 | | |
523 | 527 | | |
524 | | - | |
| 528 | + | |
| 529 | + | |
525 | 530 | | |
526 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
527 | 556 | | |
528 | 557 | | |
529 | 558 | | |
| |||
622 | 651 | | |
623 | 652 | | |
624 | 653 | | |
| 654 | + | |
625 | 655 | | |
626 | 656 | | |
627 | 657 | | |
| |||
635 | 665 | | |
636 | 666 | | |
637 | 667 | | |
| 668 | + | |
| 669 | + | |
638 | 670 | | |
639 | 671 | | |
640 | 672 | | |
641 | 673 | | |
642 | 674 | | |
643 | | - | |
| 675 | + | |
644 | 676 | | |
645 | 677 | | |
646 | 678 | | |
| |||
660 | 692 | | |
661 | 693 | | |
662 | 694 | | |
663 | | - | |
| 695 | + | |
664 | 696 | | |
665 | 697 | | |
666 | 698 | | |
| |||
671 | 703 | | |
672 | 704 | | |
673 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
674 | 756 | | |
675 | 757 | | |
0 commit comments