Skip to content

Tool messages error property #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/sdk/js/core/types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ type ToolMessage = {
content: string
role: "tool"
toolCallId: string
error?: string
}
```

Expand All @@ -152,6 +153,7 @@ type ToolMessage = {
| `content` | `string` | Text content of the message |
| `role` | `"tool"` | Role of the message sender, fixed as "tool" |
| `toolCallId` | `string` | ID of the tool call this message responds to |
| `error` | `string` | Error message if the tool call failed |

### Message

Expand Down
2 changes: 2 additions & 0 deletions docs/sdk/python/core/types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class ToolMessage(ConfiguredBaseModel):
role: Literal["tool"]
content: str
tool_call_id: str
error: Optional[str] = None
```

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

### Message

Expand Down
1 change: 1 addition & 0 deletions python-sdk/ag_ui/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class ToolMessage(ConfiguredBaseModel):
role: Literal["tool"] = "tool"
content: str
tool_call_id: str
error: Optional[str] = None


Message = Annotated[
Expand Down
1 change: 1 addition & 0 deletions typescript-sdk/packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const ToolMessageSchema = z.object({
content: z.string(),
role: z.literal("tool"),
toolCallId: z.string(),
error: z.string().optional(),
});

export const MessageSchema = z.discriminatedUnion("role", [
Expand Down
1 change: 1 addition & 0 deletions typescript-sdk/packages/proto/src/proto/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ message Message {
optional string name = 4;
repeated ToolCall tool_calls = 5;
optional string tool_call_id = 6;
optional string error = 7;
}