Specification (3.1.4)
When includeArtifacts is false (the default), the artifacts field MUST be omitted entirely from each Task object in the response. The field should not be present as an empty array or null value.
Actual behavior:
from google.protobuf.json_format import MessageToDict
from a2a.types import ListTasksResponse, Task, TaskState, TaskStatus
task = Task(
id="task-1",
context_id="context-1",
status=TaskStatus(state=TaskState.TASK_STATE_WORKING),
)
task.ClearField("artifacts")
response = ListTasksResponse(tasks=[task])
data = MessageToDict(
response,
preserving_proto_field_name=False,
always_print_fields_with_no_presence=True,
)
print(data["tasks"][0]["artifacts"])
Returns [].
Code of Conduct
Specification (3.1.4)
Actual behavior:
Returns
[].Code of Conduct