-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Modify web_browser to display errors better * Add test * remove items left during debugging * Update CHANGELOG.md * fix tool call formatting * ruff * fix commented out code * simplify test --------- Co-authored-by: Lukas Berglund <[email protected]> Co-authored-by: jjallaire-aisi <[email protected]>
- Loading branch information
1 parent
d319e65
commit d419cce
Showing
2 changed files
with
15 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from inspect_ai.model._call_tools import truncate_tool_output | ||
|
||
|
||
def test_tool_truncate(): | ||
long_tool_output = "TEST\n" * 100_000 | ||
truncated_output = truncate_tool_output( | ||
tool_name="test", output=long_tool_output, max_output=1000 | ||
) | ||
|
||
# Output should not contain leading/trailing whitespace on any line. | ||
assert all(line.strip() == line for line in truncated_output.output.split("\n")) |