@octavus/docs 2.12.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/01-getting-started/02-quickstart.md +2 -2
- package/content/02-server-sdk/02-sessions.md +1 -0
- package/content/02-server-sdk/06-workers.md +2 -2
- package/content/03-client-sdk/01-overview.md +17 -0
- package/content/03-client-sdk/06-http-transport.md +1 -0
- package/content/03-client-sdk/09-error-handling.md +28 -4
- package/content/04-protocol/01-overview.md +1 -0
- package/content/04-protocol/04-tools.md +4 -3
- package/content/04-protocol/07-agent-config.md +26 -1
- package/content/04-protocol/08-provider-options.md +2 -7
- package/content/04-protocol/11-workers.md +4 -2
- package/content/05-api-reference/02-sessions.md +7 -6
- package/dist/{chunk-SAB5XUB6.js → chunk-JEOGYIRI.js} +31 -29
- package/dist/chunk-JEOGYIRI.js.map +1 -0
- package/dist/{chunk-RRXIH3DI.js → chunk-LAUGGZQI.js} +35 -33
- package/dist/chunk-LAUGGZQI.js.map +1 -0
- package/dist/content.js +1 -1
- package/dist/docs.json +15 -15
- package/dist/index.js +1 -1
- package/dist/search-index.json +1 -1
- package/dist/search.js +1 -1
- package/dist/search.js.map +1 -1
- package/dist/sections.json +15 -15
- package/package.json +1 -1
- package/dist/chunk-PQ5AGOPY.js +0 -1489
- package/dist/chunk-PQ5AGOPY.js.map +0 -1
- package/dist/chunk-RRXIH3DI.js.map +0 -1
- package/dist/chunk-SAB5XUB6.js.map +0 -1
|
@@ -17,7 +17,7 @@ This guide will walk you through integrating Octavus into your application in un
|
|
|
17
17
|
|
|
18
18
|
Before integrating with SDKs, use **Agent Preview** to test your agent directly in the platform:
|
|
19
19
|
|
|
20
|
-
1. Open your agent in the platform at `octavus.ai/agents/[agentId]`
|
|
20
|
+
1. Open your agent in the platform at `octavus.ai/platform/agents/[agentId]`
|
|
21
21
|
2. Click the **Preview** tab
|
|
22
22
|
3. Configure session inputs and tool mock responses
|
|
23
23
|
4. Start a conversation to test agent behavior
|
|
@@ -81,7 +81,7 @@ There are two ways to create and manage agents:
|
|
|
81
81
|
**Option 1: Platform UI (Recommended for getting started)**
|
|
82
82
|
|
|
83
83
|
1. Go to [octavus.ai](https://octavus.ai) and create an agent in the web editor
|
|
84
|
-
2. Copy the agent ID from the URL (e.g., `octavus.ai/agents/clxyz123abc456`)
|
|
84
|
+
2. Copy the agent ID from the URL (e.g., `octavus.ai/platform/agents/clxyz123abc456`)
|
|
85
85
|
3. Add it to your `.env.local`: `OCTAVUS_SUPPORT_AGENT_ID=clxyz123abc456`
|
|
86
86
|
|
|
87
87
|
**Option 2: Local Development with CLI**
|
|
@@ -121,6 +121,7 @@ interface TriggerRequest {
|
|
|
121
121
|
type: 'trigger';
|
|
122
122
|
triggerName: string;
|
|
123
123
|
input?: Record<string, unknown>;
|
|
124
|
+
rollbackAfterMessageId?: string | null; // For retry: truncate messages after this ID
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
// Continue after client-side tool handling
|
|
@@ -142,7 +142,7 @@ try {
|
|
|
142
142
|
if (error instanceof WorkerError) {
|
|
143
143
|
console.error('Worker failed:', error.message);
|
|
144
144
|
if (error.sessionId) {
|
|
145
|
-
console.error(`Debug: ${client.baseUrl}/sessions/${error.sessionId}`);
|
|
145
|
+
console.error(`Debug: ${client.baseUrl}/platform/sessions/${error.sessionId}`);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -355,7 +355,7 @@ try {
|
|
|
355
355
|
if (error instanceof WorkerError) {
|
|
356
356
|
console.error('Failed:', error.message);
|
|
357
357
|
if (error.sessionId) {
|
|
358
|
-
console.error(`Debug: ${client.baseUrl}/sessions/${error.sessionId}`);
|
|
358
|
+
console.error(`Debug: ${client.baseUrl}/platform/sessions/${error.sessionId}`);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
}
|
|
@@ -183,6 +183,21 @@ const { stop } = useOctavusChat({ transport });
|
|
|
183
183
|
stop();
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
+
### Retry Last Trigger
|
|
187
|
+
|
|
188
|
+
Re-execute the last trigger from the same starting point. Messages are rolled back to the state before the trigger, the user message is re-added (if any), and the agent re-executes. Already-uploaded files are reused without re-uploading.
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
const { retry, canRetry } = useOctavusChat({ transport });
|
|
192
|
+
|
|
193
|
+
// Retry after an error, cancellation, or unsatisfactory result
|
|
194
|
+
if (canRetry) {
|
|
195
|
+
await retry();
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`canRetry` is `true` when a trigger has been sent and the chat is not currently streaming or awaiting input.
|
|
200
|
+
|
|
186
201
|
## Hook Reference (React)
|
|
187
202
|
|
|
188
203
|
### useOctavusChat
|
|
@@ -234,6 +249,8 @@ interface UseOctavusChatReturn {
|
|
|
234
249
|
options?: { userMessage?: UserMessageInput },
|
|
235
250
|
) => Promise<void>;
|
|
236
251
|
stop: () => void;
|
|
252
|
+
retry: () => Promise<void>; // Retry last trigger from same starting point
|
|
253
|
+
canRetry: boolean; // Whether retry() can be called
|
|
237
254
|
|
|
238
255
|
// Connection management (socket transport only - undefined for HTTP)
|
|
239
256
|
connect: (() => Promise<void>) | undefined;
|
|
@@ -271,6 +271,7 @@ interface TriggerRequest {
|
|
|
271
271
|
type: 'trigger';
|
|
272
272
|
triggerName: string;
|
|
273
273
|
input?: Record<string, unknown>;
|
|
274
|
+
rollbackAfterMessageId?: string | null; // For retry: truncate messages after this ID
|
|
274
275
|
}
|
|
275
276
|
|
|
276
277
|
// Continue after client-side tool handling
|
|
@@ -124,6 +124,21 @@ if (isProviderError(error) && error.provider) {
|
|
|
124
124
|
}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
## Retrying After Errors
|
|
128
|
+
|
|
129
|
+
Use `retry()` to re-execute the last trigger from the same starting point. Messages are rolled back, the user message is re-added (if any), and the agent re-executes. Files are reused without re-uploading.
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
const { error, canRetry, retry } = useOctavusChat({ transport });
|
|
133
|
+
|
|
134
|
+
// Retry after any error
|
|
135
|
+
if (canRetry) {
|
|
136
|
+
await retry();
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`retry()` also works after stopping (cancellation) or when the result is unsatisfactory — not just errors.
|
|
141
|
+
|
|
127
142
|
## Building Error UI
|
|
128
143
|
|
|
129
144
|
```tsx
|
|
@@ -135,7 +150,7 @@ import {
|
|
|
135
150
|
} from '@octavus/react';
|
|
136
151
|
|
|
137
152
|
function Chat() {
|
|
138
|
-
const { error, status } = useOctavusChat({ transport });
|
|
153
|
+
const { error, status, retry, canRetry } = useOctavusChat({ transport });
|
|
139
154
|
|
|
140
155
|
return (
|
|
141
156
|
<div>
|
|
@@ -149,7 +164,11 @@ function Chat() {
|
|
|
149
164
|
Please try again in {error.retryAfter} seconds
|
|
150
165
|
</p>
|
|
151
166
|
)}
|
|
152
|
-
{
|
|
167
|
+
{canRetry && (
|
|
168
|
+
<button className="mt-3 text-red-700 underline" onClick={() => void retry()}>
|
|
169
|
+
Retry
|
|
170
|
+
</button>
|
|
171
|
+
)}
|
|
153
172
|
</div>
|
|
154
173
|
)}
|
|
155
174
|
</div>
|
|
@@ -197,12 +216,17 @@ useOctavusChat({
|
|
|
197
216
|
The hook exposes error state directly:
|
|
198
217
|
|
|
199
218
|
```typescript
|
|
200
|
-
const { error, status } = useOctavusChat({ transport });
|
|
219
|
+
const { error, status, retry, canRetry } = useOctavusChat({ transport });
|
|
201
220
|
|
|
202
221
|
// status is 'error' when an error occurred
|
|
203
222
|
// error contains the OctavusError object
|
|
204
223
|
|
|
205
|
-
//
|
|
224
|
+
// Option 1: Retry the same trigger (rolls back messages, re-executes)
|
|
225
|
+
if (canRetry) {
|
|
226
|
+
await retry();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Option 2: Send a new message (clears the error)
|
|
206
230
|
await send('user-message', { USER_MESSAGE: 'Try again' });
|
|
207
231
|
```
|
|
208
232
|
|
|
@@ -81,6 +81,7 @@ agent:
|
|
|
81
81
|
tools: [get-user-account]
|
|
82
82
|
skills: [qr-code] # Enable skills
|
|
83
83
|
imageModel: google/gemini-2.5-flash-image # Enable image generation
|
|
84
|
+
webSearch: true # Enable web search
|
|
84
85
|
agentic: true # Allow multiple tool calls
|
|
85
86
|
thinking: medium # Extended reasoning
|
|
86
87
|
|
|
@@ -8,10 +8,11 @@ description: Defining external tools implemented in your backend.
|
|
|
8
8
|
Tools extend what agents can do. Octavus supports multiple types:
|
|
9
9
|
|
|
10
10
|
1. **External Tools** — Defined in the protocol, implemented in your backend (this page)
|
|
11
|
-
2. **
|
|
12
|
-
3. **
|
|
11
|
+
2. **Built-in Tools** — Provider-agnostic tools managed by Octavus (web search, image generation)
|
|
12
|
+
3. **Provider Tools** — Provider-specific tools executed by the provider (e.g., Anthropic's code execution)
|
|
13
|
+
4. **Skills** — Code execution and knowledge packages (see [Skills](/docs/protocol/skills))
|
|
13
14
|
|
|
14
|
-
This page covers external tools. For provider tools, see [Provider Options](/docs/protocol/provider-options). For code execution
|
|
15
|
+
This page covers external tools. Built-in tools are enabled via agent config — see [Web Search](/docs/protocol/agent-config#web-search) and [Image Generation](/docs/protocol/agent-config#image-generation). For provider-specific tools, see [Provider Options](/docs/protocol/provider-options). For code execution, see [Skills](/docs/protocol/skills).
|
|
15
16
|
|
|
16
17
|
## External Tools
|
|
17
18
|
|
|
@@ -30,6 +30,7 @@ agent:
|
|
|
30
30
|
| `references` | No | List of references the LLM can fetch on demand |
|
|
31
31
|
| `sandboxTimeout` | No | Skill sandbox timeout in ms (default: 5 min, max: 1 hour) |
|
|
32
32
|
| `imageModel` | No | Image generation model (enables agentic image generation) |
|
|
33
|
+
| `webSearch` | No | Enable built-in web search tool (provider-agnostic) |
|
|
33
34
|
| `agentic` | No | Allow multiple tool call cycles |
|
|
34
35
|
| `maxSteps` | No | Maximum agentic steps (default: 10) |
|
|
35
36
|
| `temperature` | No | Model temperature (0-2) |
|
|
@@ -285,6 +286,28 @@ Use `generate-image` block (see [Handlers](/docs/protocol/handlers#generate-imag
|
|
|
285
286
|
- Building prompt engineering pipelines
|
|
286
287
|
- Images are generated at specific handler steps
|
|
287
288
|
|
|
289
|
+
## Web Search
|
|
290
|
+
|
|
291
|
+
Enable the LLM to search the web for current information:
|
|
292
|
+
|
|
293
|
+
```yaml
|
|
294
|
+
agent:
|
|
295
|
+
model: anthropic/claude-sonnet-4-5
|
|
296
|
+
system: system
|
|
297
|
+
webSearch: true
|
|
298
|
+
agentic: true
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
When `webSearch` is enabled, the `octavus_web_search` tool becomes available. The LLM can decide when to search the web based on the conversation. Search results include source URLs that are emitted as citations in the UI.
|
|
302
|
+
|
|
303
|
+
This is a **provider-agnostic** built-in tool — it works with any LLM provider (Anthropic, Google, OpenAI, etc.). For Anthropic's own web search implementation, see [Provider Options](/docs/protocol/provider-options).
|
|
304
|
+
|
|
305
|
+
Use cases:
|
|
306
|
+
|
|
307
|
+
- Current events and real-time data
|
|
308
|
+
- Fact verification and documentation lookups
|
|
309
|
+
- Any information that may have changed since the model's training
|
|
310
|
+
|
|
288
311
|
## Temperature
|
|
289
312
|
|
|
290
313
|
Control response randomness:
|
|
@@ -341,9 +364,10 @@ handlers:
|
|
|
341
364
|
skills: [data-analysis] # Thread-specific skills
|
|
342
365
|
references: [escalation-policy] # Thread-specific references
|
|
343
366
|
imageModel: google/gemini-2.5-flash-image # Thread-specific image model
|
|
367
|
+
webSearch: true # Thread-specific web search
|
|
344
368
|
```
|
|
345
369
|
|
|
346
|
-
Each thread can have its own skills, references, and
|
|
370
|
+
Each thread can have its own skills, references, image model, and web search setting. Skills must be defined in the protocol's `skills:` section. References must exist in the agent's `references/` directory. Workers use this same pattern since they don't have a global `agent:` section.
|
|
347
371
|
|
|
348
372
|
## Full Example
|
|
349
373
|
|
|
@@ -392,6 +416,7 @@ agent:
|
|
|
392
416
|
- create-support-ticket
|
|
393
417
|
skills: [qr-code] # Octavus skills
|
|
394
418
|
references: [support-policies] # On-demand context
|
|
419
|
+
webSearch: true # Built-in web search
|
|
395
420
|
agentic: true
|
|
396
421
|
maxSteps: 10
|
|
397
422
|
thinking: medium
|
|
@@ -65,7 +65,7 @@ anthropic:
|
|
|
65
65
|
|
|
66
66
|
### Web Search
|
|
67
67
|
|
|
68
|
-
Allows the agent to search the web
|
|
68
|
+
Allows the agent to search the web using Anthropic's built-in web search:
|
|
69
69
|
|
|
70
70
|
```yaml
|
|
71
71
|
agent:
|
|
@@ -77,12 +77,7 @@ agent:
|
|
|
77
77
|
description: Looking up current information
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- Current events and news
|
|
83
|
-
- Real-time data (prices, weather)
|
|
84
|
-
- Fact verification
|
|
85
|
-
- Documentation lookups
|
|
80
|
+
> **Tip**: Octavus also provides a **provider-agnostic** web search via `webSearch: true` in the agent config. This works with any LLM provider and is the recommended approach for multi-provider agents. See [Web Search](/docs/protocol/agent-config#web-search) for details.
|
|
86
81
|
|
|
87
82
|
### Code Execution
|
|
88
83
|
|
|
@@ -228,6 +228,7 @@ All LLM configuration goes here:
|
|
|
228
228
|
| `tools` | Tools available in this thread |
|
|
229
229
|
| `skills` | Octavus skills available in this thread |
|
|
230
230
|
| `imageModel` | Image generation model |
|
|
231
|
+
| `webSearch` | Enable built-in web search tool |
|
|
231
232
|
| `thinking` | Extended reasoning level |
|
|
232
233
|
| `temperature` | Model temperature |
|
|
233
234
|
| `maxSteps` | Maximum tool call cycles (enables agentic if > 1) |
|
|
@@ -362,9 +363,9 @@ steps:
|
|
|
362
363
|
output: CONVERSATION_SUMMARY
|
|
363
364
|
```
|
|
364
365
|
|
|
365
|
-
## Skills and
|
|
366
|
+
## Skills, Image Generation, and Web Search
|
|
366
367
|
|
|
367
|
-
Workers can use Octavus skills
|
|
368
|
+
Workers can use Octavus skills, image generation, and web search, configured per-thread via `start-thread`:
|
|
368
369
|
|
|
369
370
|
```yaml
|
|
370
371
|
skills:
|
|
@@ -380,6 +381,7 @@ steps:
|
|
|
380
381
|
system: system
|
|
381
382
|
skills: [qr-code]
|
|
382
383
|
imageModel: google/gemini-2.5-flash-image
|
|
384
|
+
webSearch: true
|
|
383
385
|
maxSteps: 10
|
|
384
386
|
```
|
|
385
387
|
|
|
@@ -35,7 +35,7 @@ POST /api/agent-sessions
|
|
|
35
35
|
| `agentId` | string | Yes | Agent ID (the `id` field, not `slug`) |
|
|
36
36
|
| `input` | object | No | Input variables for the agent |
|
|
37
37
|
|
|
38
|
-
> **Getting the agent ID:** Copy the ID from the agent URL in the [platform](https://octavus.ai) (e.g., `octavus.ai/agents/clxyz123`), or use the [CLI](/docs/server-sdk/cli) (`octavus sync ./agents/my-agent`) for local development workflows.
|
|
38
|
+
> **Getting the agent ID:** Copy the ID from the agent URL in the [platform](https://octavus.ai) (e.g., `octavus.ai/platform/agents/clxyz123`), or use the [CLI](/docs/server-sdk/cli) (`octavus sync ./agents/my-agent`) for local development workflows.
|
|
39
39
|
|
|
40
40
|
### Response
|
|
41
41
|
|
|
@@ -258,11 +258,12 @@ POST /api/agent-sessions/:sessionId/trigger
|
|
|
258
258
|
}
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
| Field
|
|
262
|
-
|
|
|
263
|
-
| `triggerName`
|
|
264
|
-
| `input`
|
|
265
|
-
| `toolResults`
|
|
261
|
+
| Field | Type | Required | Description |
|
|
262
|
+
| ------------------------ | -------------- | -------- | -------------------------------------------------------------------------------------------------- |
|
|
263
|
+
| `triggerName` | string | Yes | Name of the trigger to execute |
|
|
264
|
+
| `input` | object | No | Input variables for the trigger |
|
|
265
|
+
| `toolResults` | array | No | Tool results for continuation (handled by SDK) |
|
|
266
|
+
| `rollbackAfterMessageId` | string \| null | No | For retry: ID of the last message to keep. Messages after this are removed. `null` = truncate all. |
|
|
266
267
|
|
|
267
268
|
### Response
|
|
268
269
|
|