Skip to content

Commit 6994579

Browse files
committed
audit tools page
1 parent bd96ad6 commit 6994579

1 file changed

Lines changed: 17 additions & 11 deletions

File tree

adk/conversations/tools.mdx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Define Tools
2+
title: Define tools
33
description: Give the AI model functions it can call during execution.
44
---
55

@@ -39,7 +39,7 @@ The `input` and `output` schemas use Zod. Use `.describe()` on each field so the
3939

4040
Pass tools to `execute()` via the `tools` array:
4141

42-
```typescript
42+
```typescript highlight={10}
4343
import { Conversation } from "@botpress/runtime"
4444
import getWeather from "../tools/weather"
4545
import createTicket from "../tools/ticket"
@@ -61,7 +61,7 @@ The model decides which tools to call based on the conversation. It can call mul
6161

6262
You can define tools directly inside a handler without creating a separate file:
6363

64-
```typescript
64+
```typescript highlight={6-15, 19}
6565
import { Autonomous, z, Conversation } from "@botpress/runtime"
6666

6767
export default new Conversation({
@@ -86,7 +86,7 @@ export default new Conversation({
8686
})
8787
```
8888

89-
This is useful for tools that are only relevant to a single conversation.
89+
This is useful for tools that are only relevant to a single type of conversation.
9090

9191
## Writing good descriptions
9292

@@ -115,7 +115,7 @@ Tools can throw signals to influence the AI loop without returning a normal resu
115115

116116
### ThinkSignal
117117

118-
Throws context back into the model's reasoning without producing a tool output. Useful when a tool finds no results and you want the model to try a different approach:
118+
A `ThinkSignal` throws context back into the model's reasoning without producing a tool output. This is useful when a tool finds no results and you want the model to try a different approach:
119119

120120
```typescript
121121
import { Autonomous } from "@botpress/runtime"
@@ -136,9 +136,11 @@ handler: async ({ query }) => {
136136

137137
## Actions as tools
138138

139-
Actions are reusable functions that can be called from anywhere in your agent (conversations, workflows, other actions, or external API clients). Unlike standalone tools, which only exist inside `execute()`, actions are shared primitives. You can convert any action into a tool:
139+
Actions are reusable functions that can be called from anywhere in your agentconversations, workflows, other actions, or external API clients. Tools only work inside `execute()`, where the AI model decides when to call them based on the conversation.
140140

141-
```typescript
141+
You can convert any action into a tool by calling its `asTool()` method and passing it into `tools`:
142+
143+
```typescript highlight={8}
142144
import { Conversation, actions } from "@botpress/runtime"
143145

144146
export default new Conversation({
@@ -152,13 +154,15 @@ export default new Conversation({
152154
})
153155
```
154156

155-
See [Build Actions](/adk/external/actions) for how to define actions.
157+
<Tip>
158+
Check out our guide on [building actions](/adk/external/actions) for more information.
159+
</Tip>
156160

157161
## Workflows as tools
158162

159163
Workflows are long-running background processes that can span multiple steps and run independently of the conversation. Converting a workflow to a tool lets the model kick one off:
160164

161-
```typescript
165+
```typescript highlight={9}
162166
import { Conversation } from "@botpress/runtime"
163167
import orderWorkflow from "../workflows/order"
164168

@@ -173,13 +177,15 @@ export default new Conversation({
173177
})
174178
```
175179

176-
See [Create workflows](/adk/workflows/create) for how to define workflows.
180+
<Tip>
181+
Check out our guide on [creating workflows](/adk/workflows/create) for more information.
182+
</Tip>
177183

178184
## Calling actions from tools
179185

180186
Tools can call actions for reusable logic:
181187

182-
```typescript
188+
```typescript highlight={8}
183189
import { Autonomous, actions, z } from "@botpress/runtime"
184190

185191
export default new Autonomous.Tool({

0 commit comments

Comments
 (0)