Skip to content
Merged
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
140 changes: 88 additions & 52 deletions agentex/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1213,19 +1213,25 @@ paths:
: {\n \"anyOf\": [\n {},\n {\n \
\ \"type\": \"null\"\n }\n ],\n \"default\"\
: null,\n \"description\": \"The result of the tool.\",\n \
\ \"title\": \"Content\"\n }\n },\n \"title\":\
\ \"ToolResponseContentEntityOptional\",\n \"type\": \"object\"\n\
\ }\n },\n \"description\": \"Filter model for TaskMessage - all\
\ fields optional for flexible filtering.\\n\\nThe `exclude` field determines\
\ whether this filter is inclusionary or exclusionary.\\nWhen multiple\
\ filters are provided:\\n- Inclusionary filters (exclude=False) are OR'd\
\ together\\n- Exclusionary filters (exclude=True) are OR'd together and\
\ negated with $nor\\n- The two groups are AND'd: (include1 OR include2)\
\ AND NOT (exclude1 OR exclude2)\",\n \"properties\": {\n \"content\"\
: {\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/ToolRequestContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/DataContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/TextContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/ToolResponseContentEntityOptional\"\
\ \"title\": \"Content\"\n },\n \"is_error\": {\n\
\ \"anyOf\": [\n {\n \"type\": \"boolean\"\
\n },\n {\n \"type\": \"null\"\n \
\ }\n ],\n \"default\": null,\n \"\
description\": \"Whether the tool call resulted in an error. `None` when\
\ the harness does not report a status.\",\n \"title\": \"Is\
\ Error\"\n }\n },\n \"title\": \"ToolResponseContentEntityOptional\"\
,\n \"type\": \"object\"\n }\n },\n \"description\": \"Filter\
\ model for TaskMessage - all fields optional for flexible filtering.\\\
n\\nThe `exclude` field determines whether this filter is inclusionary\
\ or exclusionary.\\nWhen multiple filters are provided:\\n- Inclusionary\
\ filters (exclude=False) are OR'd together\\n- Exclusionary filters (exclude=True)\
\ are OR'd together and negated with $nor\\n- The two groups are AND'd:\
\ (include1 OR include2) AND NOT (exclude1 OR exclude2)\",\n \"properties\"\
: {\n \"content\": {\n \"anyOf\": [\n {\n \"$ref\"\
: \"#/$defs/ToolRequestContentEntityOptional\"\n },\n {\n\
\ \"$ref\": \"#/$defs/DataContentEntityOptional\"\n },\n\
\ {\n \"$ref\": \"#/$defs/TextContentEntityOptional\"\n\
\ },\n {\n \"$ref\": \"#/$defs/ToolResponseContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/ReasoningContentEntityOptional\"\
\n },\n {\n \"type\": \"null\"\n }\n \
\ ],\n \"default\": null,\n \"description\": \"Filter by message\
Expand Down Expand Up @@ -1416,19 +1422,24 @@ paths:
\ {},\n {\n \"type\": \"null\"\n \
\ }\n ],\n \"default\": null,\n \"description\"\
: \"The result of the tool.\",\n \"title\": \"Content\"\n \
\ }\n },\n \"title\": \"ToolResponseContentEntityOptional\"\
,\n \"type\": \"object\"\n }\n },\n \"description\": \"Filter\
\ model for TaskMessage - all fields optional for flexible filtering.\\\
n\\nThe `exclude` field determines whether this filter is inclusionary or\
\ exclusionary.\\nWhen multiple filters are provided:\\n- Inclusionary filters\
\ (exclude=False) are OR'd together\\n- Exclusionary filters (exclude=True)\
\ are OR'd together and negated with $nor\\n- The two groups are AND'd:\
\ (include1 OR include2) AND NOT (exclude1 OR exclude2)\",\n \"properties\"\
: {\n \"content\": {\n \"anyOf\": [\n {\n \"$ref\"\
: \"#/$defs/ToolRequestContentEntityOptional\"\n },\n {\n\
\ \"$ref\": \"#/$defs/DataContentEntityOptional\"\n },\n\
\ {\n \"$ref\": \"#/$defs/TextContentEntityOptional\"\n\
\ },\n {\n \"$ref\": \"#/$defs/ToolResponseContentEntityOptional\"\
\ },\n \"is_error\": {\n \"anyOf\": [\n {\n\
\ \"type\": \"boolean\"\n },\n {\n \
\ \"type\": \"null\"\n }\n ],\n \
\ \"default\": null,\n \"description\": \"Whether the tool call\
\ resulted in an error. `None` when the harness does not report a status.\"\
,\n \"title\": \"Is Error\"\n }\n },\n \"title\"\
: \"ToolResponseContentEntityOptional\",\n \"type\": \"object\"\n \
\ }\n },\n \"description\": \"Filter model for TaskMessage - all fields\
\ optional for flexible filtering.\\n\\nThe `exclude` field determines whether\
\ this filter is inclusionary or exclusionary.\\nWhen multiple filters are\
\ provided:\\n- Inclusionary filters (exclude=False) are OR'd together\\\
n- Exclusionary filters (exclude=True) are OR'd together and negated with\
\ $nor\\n- The two groups are AND'd: (include1 OR include2) AND NOT (exclude1\
\ OR exclude2)\",\n \"properties\": {\n \"content\": {\n \"anyOf\"\
: [\n {\n \"$ref\": \"#/$defs/ToolRequestContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/DataContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/TextContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/ToolResponseContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/ReasoningContentEntityOptional\"\
\n },\n {\n \"type\": \"null\"\n }\n \
\ ],\n \"default\": null,\n \"description\": \"Filter by message\
Expand Down Expand Up @@ -1769,19 +1780,25 @@ paths:
: {\n \"anyOf\": [\n {},\n {\n \
\ \"type\": \"null\"\n }\n ],\n \"default\"\
: null,\n \"description\": \"The result of the tool.\",\n \
\ \"title\": \"Content\"\n }\n },\n \"title\":\
\ \"ToolResponseContentEntityOptional\",\n \"type\": \"object\"\n\
\ }\n },\n \"description\": \"Filter model for TaskMessage - all\
\ fields optional for flexible filtering.\\n\\nThe `exclude` field determines\
\ whether this filter is inclusionary or exclusionary.\\nWhen multiple\
\ filters are provided:\\n- Inclusionary filters (exclude=False) are OR'd\
\ together\\n- Exclusionary filters (exclude=True) are OR'd together and\
\ negated with $nor\\n- The two groups are AND'd: (include1 OR include2)\
\ AND NOT (exclude1 OR exclude2)\",\n \"properties\": {\n \"content\"\
: {\n \"anyOf\": [\n {\n \"$ref\": \"#/$defs/ToolRequestContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/DataContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/TextContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/ToolResponseContentEntityOptional\"\
\ \"title\": \"Content\"\n },\n \"is_error\": {\n\
\ \"anyOf\": [\n {\n \"type\": \"boolean\"\
\n },\n {\n \"type\": \"null\"\n \
\ }\n ],\n \"default\": null,\n \"\
description\": \"Whether the tool call resulted in an error. `None` when\
\ the harness does not report a status.\",\n \"title\": \"Is\
\ Error\"\n }\n },\n \"title\": \"ToolResponseContentEntityOptional\"\
,\n \"type\": \"object\"\n }\n },\n \"description\": \"Filter\
\ model for TaskMessage - all fields optional for flexible filtering.\\\
n\\nThe `exclude` field determines whether this filter is inclusionary\
\ or exclusionary.\\nWhen multiple filters are provided:\\n- Inclusionary\
\ filters (exclude=False) are OR'd together\\n- Exclusionary filters (exclude=True)\
\ are OR'd together and negated with $nor\\n- The two groups are AND'd:\
\ (include1 OR include2) AND NOT (exclude1 OR exclude2)\",\n \"properties\"\
: {\n \"content\": {\n \"anyOf\": [\n {\n \"$ref\"\
: \"#/$defs/ToolRequestContentEntityOptional\"\n },\n {\n\
\ \"$ref\": \"#/$defs/DataContentEntityOptional\"\n },\n\
\ {\n \"$ref\": \"#/$defs/TextContentEntityOptional\"\n\
\ },\n {\n \"$ref\": \"#/$defs/ToolResponseContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/ReasoningContentEntityOptional\"\
\n },\n {\n \"type\": \"null\"\n }\n \
\ ],\n \"default\": null,\n \"description\": \"Filter by message\
Expand Down Expand Up @@ -1972,19 +1989,24 @@ paths:
\ {},\n {\n \"type\": \"null\"\n \
\ }\n ],\n \"default\": null,\n \"description\"\
: \"The result of the tool.\",\n \"title\": \"Content\"\n \
\ }\n },\n \"title\": \"ToolResponseContentEntityOptional\"\
,\n \"type\": \"object\"\n }\n },\n \"description\": \"Filter\
\ model for TaskMessage - all fields optional for flexible filtering.\\\
n\\nThe `exclude` field determines whether this filter is inclusionary or\
\ exclusionary.\\nWhen multiple filters are provided:\\n- Inclusionary filters\
\ (exclude=False) are OR'd together\\n- Exclusionary filters (exclude=True)\
\ are OR'd together and negated with $nor\\n- The two groups are AND'd:\
\ (include1 OR include2) AND NOT (exclude1 OR exclude2)\",\n \"properties\"\
: {\n \"content\": {\n \"anyOf\": [\n {\n \"$ref\"\
: \"#/$defs/ToolRequestContentEntityOptional\"\n },\n {\n\
\ \"$ref\": \"#/$defs/DataContentEntityOptional\"\n },\n\
\ {\n \"$ref\": \"#/$defs/TextContentEntityOptional\"\n\
\ },\n {\n \"$ref\": \"#/$defs/ToolResponseContentEntityOptional\"\
\ },\n \"is_error\": {\n \"anyOf\": [\n {\n\
\ \"type\": \"boolean\"\n },\n {\n \
\ \"type\": \"null\"\n }\n ],\n \
\ \"default\": null,\n \"description\": \"Whether the tool call\
\ resulted in an error. `None` when the harness does not report a status.\"\
,\n \"title\": \"Is Error\"\n }\n },\n \"title\"\
: \"ToolResponseContentEntityOptional\",\n \"type\": \"object\"\n \
\ }\n },\n \"description\": \"Filter model for TaskMessage - all fields\
\ optional for flexible filtering.\\n\\nThe `exclude` field determines whether\
\ this filter is inclusionary or exclusionary.\\nWhen multiple filters are\
\ provided:\\n- Inclusionary filters (exclude=False) are OR'd together\\\
n- Exclusionary filters (exclude=True) are OR'd together and negated with\
\ $nor\\n- The two groups are AND'd: (include1 OR include2) AND NOT (exclude1\
\ OR exclude2)\",\n \"properties\": {\n \"content\": {\n \"anyOf\"\
: [\n {\n \"$ref\": \"#/$defs/ToolRequestContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/DataContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/TextContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/ToolResponseContentEntityOptional\"\
\n },\n {\n \"$ref\": \"#/$defs/ReasoningContentEntityOptional\"\
\n },\n {\n \"type\": \"null\"\n }\n \
\ ],\n \"default\": null,\n \"description\": \"Filter by message\
Expand Down Expand Up @@ -6445,6 +6467,13 @@ components:
content:
title: Content
description: The result of the tool.
is_error:
anyOf:
- type: boolean
- type: 'null'
title: Is Error
description: Whether the tool call resulted in an error. `None` when the
harness does not report a status.
type: object
required:
- author
Expand Down Expand Up @@ -6480,6 +6509,13 @@ components:
content:
title: Content
description: The result of the tool.
is_error:
anyOf:
- type: boolean
- type: 'null'
title: Is Error
description: Whether the tool call resulted in an error. `None` when the
harness does not report a status.
type: object
required:
- author
Expand Down
4 changes: 4 additions & 0 deletions agentex/src/api/schemas/task_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class ToolResponseContent(BaseTaskMessageContent):
..., description="The name of the tool that is being responded to."
)
content: Any = Field(..., description="The result of the tool.")
is_error: bool | None = Field(
default=None,
description="Whether the tool call resulted in an error. `None` when the harness does not report a status.",
)


class DataContent(BaseTaskMessageContent):
Expand Down
5 changes: 5 additions & 0 deletions agentex/src/domain/entities/task_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ class ToolResponseContentEntity(BaseTaskMessageContentEntity):
..., description="The name of the tool that is being responded to."
)
content: Any = Field(..., description="The result of the tool.")
is_error: bool | None = Field(
default=None,
description="Whether the tool call resulted in an error. `None` when the harness does not report a status.",
)


OptionalToolResponseContentEntity = make_optional(ToolResponseContentEntity)
Expand Down Expand Up @@ -207,6 +211,7 @@ def convert_task_message_content_to_entity(
tool_call_id=content.tool_call_id,
name=content.name,
content=content.content,
is_error=content.is_error,
)

assert_never(content)
Expand Down
Loading