Skip to content

Commit 8388399

Browse files
authored
add error property to tool messages to enable retrying failed frontend tools (#213)
1 parent d7fed81 commit 8388399

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

docs/sdk/js/core/types.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ type ToolMessage = {
143143
content: string
144144
role: "tool"
145145
toolCallId: string
146+
error?: string
146147
}
147148
```
148149
@@ -152,6 +153,7 @@ type ToolMessage = {
152153
| `content` | `string` | Text content of the message |
153154
| `role` | `"tool"` | Role of the message sender, fixed as "tool" |
154155
| `toolCallId` | `string` | ID of the tool call this message responds to |
156+
| `error` | `string` | Error message if the tool call failed |
155157
156158
### Message
157159

docs/sdk/python/core/types.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class ToolMessage(ConfiguredBaseModel):
144144
role: Literal["tool"]
145145
content: str
146146
tool_call_id: str
147+
error: Optional[str] = None
147148
```
148149

149150
| Property | Type | Description |
@@ -152,6 +153,7 @@ class ToolMessage(ConfiguredBaseModel):
152153
| `content` | `str` | Text content of the message |
153154
| `role` | `Literal["tool"]` | Role of the message sender, fixed as "tool" |
154155
| `tool_call_id` | `str` | ID of the tool call this message responds to |
156+
| `error` | `Optional[str]` | Error message if the tool call failed |
155157

156158
### Message
157159

python-sdk/ag_ui/core/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class ToolMessage(ConfiguredBaseModel):
8686
role: Literal["tool"] = "tool"
8787
content: str
8888
tool_call_id: str
89+
error: Optional[str] = None
8990

9091

9192
Message = Annotated[

typescript-sdk/packages/core/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const ToolMessageSchema = z.object({
4444
content: z.string(),
4545
role: z.literal("tool"),
4646
toolCallId: z.string(),
47+
error: z.string().optional(),
4748
});
4849

4950
export const MessageSchema = z.discriminatedUnion("role", [

typescript-sdk/packages/proto/src/proto/types.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ message Message {
1919
optional string name = 4;
2020
repeated ToolCall tool_calls = 5;
2121
optional string tool_call_id = 6;
22+
optional string error = 7;
2223
}

0 commit comments

Comments
 (0)