Skip to content

Commit 42967d5

Browse files
author
jinhaiyang
committed
agent-api
1 parent 152d232 commit 42967d5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

zhipuai/api_resource/agents/agents.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,27 @@ def invoke(
5959
stream_cls=StreamResponse[AgentsCompletionChunk],
6060
)
6161

62+
def async_result(
63+
self,
64+
agent_id: Optional[str] | NotGiven = NOT_GIVEN,
65+
async_id: Optional[str] | NotGiven = NOT_GIVEN,
66+
conversation_id: Optional[str] | NotGiven = NOT_GIVEN,
67+
custom_variables: object = NOT_GIVEN,
68+
extra_headers: Headers | None = None,
69+
extra_body: Body | None = None,
70+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
71+
) -> AgentsCompletion:
72+
body = deepcopy_minimal({
73+
"agent_id": agent_id,
74+
"async_id": async_id,
75+
"conversation_id": conversation_id,
76+
"custom_variables": custom_variables
77+
})
78+
return self._post(
79+
"/v1/agents/async-result",
80+
body=body,
81+
options=make_request_options(
82+
extra_headers=extra_headers, extra_body=extra_body, timeout=timeout
83+
),
84+
cast_type=AgentsCompletion,
85+
)

0 commit comments

Comments
 (0)