Skip to content

Commit

Permalink
Append tools in _basic_agent.py (#1207)
Browse files Browse the repository at this point in the history
* Append tools in _basic_agent.py

If tools where added to the state in `init` we should not override this.

* Update CHANGELOG.md

---------

Co-authored-by: jjallaire <[email protected]>
  • Loading branch information
lukaspetersson and jjallaire authored Jan 29, 2025
1 parent 8092509 commit b61c747
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Anthropic: Don't insert '(no content)' into cannonical messages list (do only on replay)
- Anthropic: Use qualifiers rather than model args for Anthropic on other providers (`anthropic/bedrock`, `anthropic/vertex`).
- Anthropic: Suport for `extra_body` model arg (for adding additional JSON properties to the request)
- Basic Agent: Append `tools` to `state` so that tools added in `init` are preserved.
- Scoring: Always provide half-again the sample time limit for scoring.
- Bugfix: Fix issue w/ approvals for samples with id==0.
- Bugfix: Use "plain" display when running eval_async() outside of eval().
Expand Down
2 changes: 1 addition & 1 deletion src/inspect_ai/solver/_basic_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def basic_agent(
# resolve tools
if tools is None:
tools = []
tools = tools if isinstance(tools, Solver) else use_tools(tools)
tools = tools if isinstance(tools, Solver) else use_tools(tools, append=True)

# resolve score_value function
score_value_fn = score_value or value_to_float()
Expand Down

0 comments on commit b61c747

Please sign in to comment.