mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-05 12:13:55 +00:00
feat: better code exec tool calling
This commit is contained in:
1 parent
ec39836ff6
commit
da1cff5008
10 files changed
+184
-16
No files matched your search
@@ -190,6 +190,16 @@ def test_coerce_int_and_keep_alive():
|
||||
assert CodeExecutorTool._keep_alive(False, None) is False
|
||||
|
||||
|
||||
def test_normalize_outputs():
|
||||
n = CodeExecutorTool._normalize_outputs
|
||||
assert n(["a.csv", "b.pdf"]) == ["a.csv", "b.pdf"]
|
||||
assert n("report.pdf") == ["report.pdf"] # a bare string is tolerated
|
||||
assert n([" x ", "", 5, "y"]) == ["x", "y"] # stripped; empties/non-strings dropped
|
||||
assert n([]) is None
|
||||
assert n(None) is None
|
||||
assert n(" ") is None
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Action metadata / approval surface
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user