-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add max_iterations parameter for output_handler * add tests for output handler max iterations * add max_iterations params for CoderOutputHandler in Advanced output handling.ipynb * add MockTool for agent tests * replace DuckDuckGoSearchRun to MockTool * update OutputHandlerMaxIterationsExceeded * minor fixes * fix tests --------- Co-authored-by: User <[email protected]> Co-authored-by: whimo <[email protected]>
- Loading branch information
1 parent
40cbf99
commit a4c2fdd
Showing
43 changed files
with
173 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-95 KB
.../v1_chat_completions/0e875e7397179704e9c0f59a201287a3d0c56d7b1a692ad20f775c55b97a94f6.pkl
Binary file not shown.
Binary file removed
BIN
-72.7 KB
.../v1_chat_completions/142f514247583600c43a67e4328369554bc34f77f60fed42015d2bf2aa25bfa8.pkl
Binary file not shown.
Binary file modified
BIN
-19 Bytes
(100%)
.../v1_chat_completions/194738103260685fcfe14b080193c65baceb5fd00bb449694913f6f0762b0291.pkl
Binary file not shown.
Binary file removed
BIN
-67.2 KB
.../v1_chat_completions/38c587c596ba4a7320df077e92bb9a303734251dd6391f31a0b66c2dbeb0ce44.pkl
Binary file not shown.
Binary file added
BIN
+40.3 KB
.../v1_chat_completions/48ad067e4cacaf445989352111199526d44d510296a19e1d7244c43506147de3.pkl
Binary file not shown.
Binary file modified
BIN
-2.22 KB
(96%)
.../v1_chat_completions/49aefe482900e5529f22f21ffea3a217532d894d30ad60d5b902317f841507c7.pkl
Binary file not shown.
Binary file added
BIN
+94.7 KB
.../v1_chat_completions/4e48419bce78705da5cb3ab1ca474e97b76ebf2327c1c3a612b665abda772ddd.pkl
Binary file not shown.
Binary file added
BIN
+72.6 KB
.../v1_chat_completions/50a29bae1049bc8ceee0c057f6e4f24bfa07c6c2b35ab4fa5f74d04ca879e6d8.pkl
Binary file not shown.
Binary file added
BIN
+85.7 KB
.../v1_chat_completions/5e047e70f7f9302ccb2769f571a821ea9a897de0ec73acf2bbe540c63ef5d262.pkl
Binary file not shown.
Binary file removed
BIN
-84 KB
.../v1_chat_completions/a0cc27bc02e7df8d60981c2aacf3d49dbf534a6f999d02431db8e8de8145e52b.pkl
Binary file not shown.
Binary file removed
BIN
-40.3 KB
.../v1_chat_completions/b3c179a00e76ca4c0fcf3b0d09bd2be9dc164849323b77cb39acc6f39e9ebae2.pkl
Binary file not shown.
Binary file added
BIN
+65.9 KB
.../v1_chat_completions/d522c1c5bf62810f60ab6905c9d6ee28c4ae2af7f318ed0d99052f68ae0bba56.pkl
Binary file not shown.
Binary file renamed
BIN
+2.62 KB
...dd12711def9925eefe6d7163d44e2c052b2bf.pkl → ...2cd68029ac10a7a00045e8c336a82d12dc58a.pkl
Binary file not shown.
Binary file added
BIN
+50.4 KB
.../v1_chat_completions/10b915da79b3af5c79f0fb31f8fbf8ced61cf74463499dd891514cb7e5325e59.pkl
Binary file not shown.
Binary file added
BIN
+57 KB
.../v1_chat_completions/11b4c38f6b58f022f99691bfb7763a6a727df2b3b42cb6fc9a288a3e0ea4e8ae.pkl
Binary file not shown.
Binary file added
BIN
+45.3 KB
.../v1_chat_completions/29b0d013feff29c37c8a2aa14aaa6b8863d0d3feec1899dfa8deb79d2c486df5.pkl
Binary file not shown.
Binary file added
BIN
+55.5 KB
.../v1_chat_completions/2af6eae4f7a1596e28cf4bfdf6549c5eb275a3b83e3fac88d02aace6feec4cc9.pkl
Binary file not shown.
Binary file added
BIN
+40.1 KB
.../v1_chat_completions/2ff106841dfa3e905032e73975a6a34938bb2668d3d76ba7a5801760b4a6eb51.pkl
Binary file not shown.
Binary file added
BIN
+60.7 KB
.../v1_chat_completions/3c6f8ea143fba69a0da636c750ccb0d4f9bb21acec233ffda049f5019996c013.pkl
Binary file not shown.
Binary file added
BIN
+3.5 KB
.../v1_chat_completions/44b802b8c97658a162e84c2a129d622340c7eac1df3843b586011c3e5676ae36.pkl
Binary file not shown.
Binary file added
BIN
+46.7 KB
.../v1_chat_completions/584d9a8ef900f68c4a9296d9ed420b1fe415b9ee1f7eeb0df2a01ef07254926d.pkl
Binary file not shown.
Binary file added
BIN
+51.9 KB
.../v1_chat_completions/6b29fb659ef95585653a113e3b8f957a0778f471e34b2a5169f154f0b15c20c6.pkl
Binary file not shown.
Binary file added
BIN
+3.82 KB
.../v1_chat_completions/6d277e5cfca7e0db1e89ac67cd19d71bf7feb77558543cde88b6ee134971b5ad.pkl
Binary file not shown.
Binary file added
BIN
+41.6 KB
.../v1_chat_completions/7a5fc4da7dfb19a4cd5529f827086d6c119802428bd4e10e2177079d42bc527f.pkl
Binary file not shown.
Binary file removed
BIN
-3.81 KB
.../v1_chat_completions/89aaf10840541c1f22dca15a2d3bb7af8d5562a929fdaddef8b17c20a427c41e.pkl
Binary file not shown.
Binary file added
BIN
+48.9 KB
.../v1_chat_completions/951b765d6b645e5a18b04c9cda8bf73d8f8c409bd447374df6769a33652c72c3.pkl
Binary file not shown.
Binary file modified
BIN
+3.82 KB
(110%)
.../v1_chat_completions/9fff94ceca00c1c34ec18766e4cb1551e247e59d6da133f54baccaac90bcf022.pkl
Binary file not shown.
Binary file added
BIN
+54.1 KB
.../v1_chat_completions/bd0a0eb768ecda41e7ae1fb6fd7d574c05c61fd143a9059573815c38d2c9b1e7.pkl
Binary file not shown.
Binary file removed
BIN
-216 KB
.../v1_chat_completions/ccb7751e1332467bf3d3b6a720d72a347b8777184ddce0c28e4a7afff04003cb.pkl
Binary file not shown.
Binary file added
BIN
+59.2 KB
.../v1_chat_completions/e6390e10ab4a8252870620496b378e00862205c5ee5a29acebfdc33db34a988e.pkl
Binary file not shown.
Binary file added
BIN
+61.4 KB
.../v1_chat_completions/f03da7ec0c7359e684e8a9fc9c46d335c0d11100ea9402706ab0bf75bfca3eb0.pkl
Binary file not shown.
Binary file added
BIN
+43.8 KB
.../v1_chat_completions/f14562827ad1e3aa08d2cf536c24c17e25412399554b0555d3aa0b35f08eab3d.pkl
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"def bubble_sort(arr):\n n = len(arr)\n for i in range(n):\n swapped = False\n for j in range(0, n-i-1):\n if arr[j] > arr[j+1]:\n arr[j], arr[j+1] = arr[j+1], arr[j]\n swapped = True\n if not swapped:\n break\n return arr\n\n# Test the bubble sort function\nsample_array = [64, 34, 25, 12, 22, 11, 90]\nsorted_array = bubble_sort(sample_array)\nprint(sorted_array)\n\nThe `bubble_sort` function sorts an array using the bubble sort algorithm. It works by repeatedly stepping through the list, comparing adjacent elements and swapping them if they are in the wrong order. This process is repeated until the list is sorted. The outer loop runs `n` times, where `n` is the length of the array, and the inner loop runs `n-i-1` times to avoid re-checking the already sorted elements. An optimization is added by using a `swapped` flag to detect if any swaps were made during an iteration. If no swaps were made, the array is already sorted, and the algorithm can terminate early. The test case demonstrates the function by sorting a sample array." | ||
"def bubble_sort(arr):\n n = len(arr)\n for i in range(n):\n swapped = False\n for j in range(0, n-i-1):\n if arr[j] > arr[j+1]:\n arr[j], arr[j+1] = arr[j+1], arr[j]\n swapped = True\n if not swapped:\n break\n return arr\n\n# Test the bubble sort function\nsample_array = [64, 34, 25, 12, 22, 11, 90]\nsorted_array = bubble_sort(sample_array)\nprint(sorted_array)\n\nThe `bubble_sort` function sorts an array using the bubble sort algorithm. It works by repeatedly stepping through the list, comparing adjacent elements and swapping them if they are in the wrong order. This process is repeated until the list is sorted. The outer loop runs `n` times, where `n` is the length of the array. The inner loop runs `n-i-1` times to avoid re-checking the already sorted elements. An optimization is added by using a `swapped` flag to detect if any swaps were made during an iteration. If no swaps were made, the list is already sorted, and the algorithm can terminate early. The test case demonstrates the function by sorting a sample array." |
2 changes: 1 addition & 1 deletion
2
tests/itest_golden_data/math_via_python_code_with_a_single_agent_ipynb.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"\\[\n\\begin{aligned}\nx &= \\frac{367}{71} \\\\\ny &= -\\frac{25}{49} \\\\\nx - y &= 2\n\\end{aligned}\n\\]" | ||
"Agent stopped due to iteration limit or time limit." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from typing import Type | ||
from langchain_core.tools import BaseTool | ||
from langchain_core.pydantic_v1 import BaseModel, Field | ||
|
||
|
||
class MockToolInput(BaseModel): | ||
"""Input for the MockTool tool.""" | ||
|
||
tool_input: str = Field(description="tool_input") | ||
|
||
|
||
class MockTool(BaseTool): | ||
"""Mock tool for run agent tests""" | ||
|
||
name: str = "mock tool" | ||
description: str = "Mock tool for tests" | ||
|
||
args_schema: Type[BaseModel] = MockToolInput | ||
|
||
def _run(self, tool_input: str, *args, **kwargs): | ||
return tool_input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.