# assistant2: Add helper methods to \`Thread\` for dealing with tool use \(\#26310\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/921c24e2749f074938fcc8c0f5acefdc3ab309d6)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 921c24e2749f074938fcc8c0f5acefdc3ab309d6

Requested commit: 921c24e2749f074938fcc8c0f5acefdc3ab309d6

Commit: 921c24e2749f074938fcc8c0f5acefdc3ab309d6

Tree: ac966094862564d61318a200b40cead05101909a

Author: Marshall Bowers

Committer: GitHub

## Message

```
assistant2: Add helper methods to `Thread` for dealing with tool use (#26310)

This PR adds two new helper methods to the `Thread` for dealing with
tool use:

- `use_pending_tools` - This uses all of the tools that are pending
- The reason we aren't calling this directly in `stream_completion` is
that we still might need to have a way for users to confirm that they
want tools to be run, which would need to happen at the UI layer in the
`ActiveThread`.
- `send_tool_results_to_model` - This encapsulates inserting a new user
message that contains the tool results and sending them up to the model.

Release Notes:

- N/A
```

## Parents

- [18f3f8097f2ac8c8f7610f1cb8defe7041eba46a](https://git.cafe/gitcafe/zed/commit/18f3f8097f2ac8c8f7610f1cb8defe7041eba46a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/921c24e2749f074938fcc8c0f5acefdc3ab309d6?format=markdown)
