[bug] `list_agent_task*` endpoints on Python client are broken
Pwuts opened this issue · comments
Package: agent-protocol-client
v1.0.2
The list_agent_task*
endpoints on the AgentApi
are broken:
-
list_agent_task_steps(task_id)
returns['steps', 'pagination']
, because its_response_types_map
declares the response asList[str]
-
list_agent_tasks_ids()
returns['tasks', 'pagination']
, same issue as above -
list_agent_task_artifacts(task_id)
raises a parsing error, see below:
The TaskArtifactsListResponse
spec prescribes a response format like { artifacts: Artifact[] }
. The client library assumes it is just Artifact[]
, which causes a parsing error on the response of compliant endpoints.
The error occurs here:
agent-protocol/packages/client/python/agent_protocol_client/api_client.py
Lines 352 to 355 in ecbffe0
... for sub_data in data
with data
being an object like { 'artifacts': [...] }
: it calls Artifact.parse_obj
on the string artifacts
, which fails.
Resulting stack trace:
artifacts = await api_instance.list_agent_task_artifacts(task_id=task_id)
/home/user/.local/lib/python3.11/site-packages/agent_protocol_client/api_client.py:268: in __call_api
return_data = self.deserialize(response_data, response_type)
/home/user/.local/lib/python3.11/site-packages/agent_protocol_client/api_client.py:341: in deserialize
return self.__deserialize(data, response_type)
/home/user/.local/lib/python3.11/site-packages/agent_protocol_client/api_client.py:357: in __deserialize
return [self.__deserialize(sub_data, sub_kls) for sub_data in data]
/home/user/.local/lib/python3.11/site-packages/agent_protocol_client/api_client.py:357: in <listcomp>
return [self.__deserialize(sub_data, sub_kls) for sub_data in data]
/home/user/.local/lib/python3.11/site-packages/agent_protocol_client/api_client.py:378: in __deserialize
return self.__deserialize_model(data, klass)
/home/user/.local/lib/python3.11/site-packages/agent_protocol_client/api_client.py:840: in __deserialize_model
return klass.from_dict(data)
/home/user/.local/lib/python3.11/site-packages/agent_protocol_client/models/artifact.py:68: in from_dict
return Artifact.parse_obj(obj)
------------------------------------------------
> ???
E pydantic.error_wrappers.ValidationError: 1 validation error for Artifact
E __root__
E Artifact expected dict not str (type=type_error)
pydantic/main.py:525: ValidationError