Skip to content

Commit a7cbaae

Browse files
fix(api): remove agent_id and task_id parameters from states update method
1 parent ce5af72 commit a7cbaae

4 files changed

Lines changed: 4 additions & 42 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 64
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-550d6a4f6985887b66c29240e495469cc0a74e2c966175364321ae2eb15595d8.yml
3-
openapi_spec_hash: a93e0b4ee276d29ebd1c2f2a4c798f36
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-e48cc9d460e306acf0f98efad4b5cccb793af107d0aaf50af455954d4d943e2d.yml
3+
openapi_spec_hash: 2d85e7026b3f21e81c533d51486c0182
44
config_hash: 82cb83ac175dbf40265128506294218b

src/agentex/resources/states.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ def update(
122122
self,
123123
state_id: str,
124124
*,
125-
agent_id: str,
126125
state: Dict[str, object],
127-
task_id: str,
128126
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
129127
# The extra values given here take precedence over values defined on the client or passed to this method.
130128
extra_headers: Headers | None = None,
@@ -148,14 +146,7 @@ def update(
148146
raise ValueError(f"Expected a non-empty value for `state_id` but received {state_id!r}")
149147
return self._put(
150148
path_template("/states/{state_id}", state_id=state_id),
151-
body=maybe_transform(
152-
{
153-
"agent_id": agent_id,
154-
"state": state,
155-
"task_id": task_id,
156-
},
157-
state_update_params.StateUpdateParams,
158-
),
149+
body=maybe_transform({"state": state}, state_update_params.StateUpdateParams),
159150
options=make_request_options(
160151
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
161152
),
@@ -356,9 +347,7 @@ async def update(
356347
self,
357348
state_id: str,
358349
*,
359-
agent_id: str,
360350
state: Dict[str, object],
361-
task_id: str,
362351
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
363352
# The extra values given here take precedence over values defined on the client or passed to this method.
364353
extra_headers: Headers | None = None,
@@ -382,14 +371,7 @@ async def update(
382371
raise ValueError(f"Expected a non-empty value for `state_id` but received {state_id!r}")
383372
return await self._put(
384373
path_template("/states/{state_id}", state_id=state_id),
385-
body=await async_maybe_transform(
386-
{
387-
"agent_id": agent_id,
388-
"state": state,
389-
"task_id": task_id,
390-
},
391-
state_update_params.StateUpdateParams,
392-
),
374+
body=await async_maybe_transform({"state": state}, state_update_params.StateUpdateParams),
393375
options=make_request_options(
394376
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
395377
),

src/agentex/types/state_update_params.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,4 @@
99

1010

1111
class StateUpdateParams(TypedDict, total=False):
12-
agent_id: Required[str]
13-
1412
state: Required[Dict[str, object]]
15-
16-
task_id: Required[str]

tests/api_resources/test_states.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ def test_path_params_retrieve(self, client: Agentex) -> None:
105105
def test_method_update(self, client: Agentex) -> None:
106106
state = client.states.update(
107107
state_id="state_id",
108-
agent_id="agent_id",
109108
state={"foo": "bar"},
110-
task_id="task_id",
111109
)
112110
assert_matches_type(State, state, path=["response"])
113111

@@ -116,9 +114,7 @@ def test_method_update(self, client: Agentex) -> None:
116114
def test_raw_response_update(self, client: Agentex) -> None:
117115
response = client.states.with_raw_response.update(
118116
state_id="state_id",
119-
agent_id="agent_id",
120117
state={"foo": "bar"},
121-
task_id="task_id",
122118
)
123119

124120
assert response.is_closed is True
@@ -131,9 +127,7 @@ def test_raw_response_update(self, client: Agentex) -> None:
131127
def test_streaming_response_update(self, client: Agentex) -> None:
132128
with client.states.with_streaming_response.update(
133129
state_id="state_id",
134-
agent_id="agent_id",
135130
state={"foo": "bar"},
136-
task_id="task_id",
137131
) as response:
138132
assert not response.is_closed
139133
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -149,9 +143,7 @@ def test_path_params_update(self, client: Agentex) -> None:
149143
with pytest.raises(ValueError, match=r"Expected a non-empty value for `state_id` but received ''"):
150144
client.states.with_raw_response.update(
151145
state_id="",
152-
agent_id="agent_id",
153146
state={"foo": "bar"},
154-
task_id="task_id",
155147
)
156148

157149
@pytest.mark.skip(reason="Mock server tests are disabled")
@@ -330,9 +322,7 @@ async def test_path_params_retrieve(self, async_client: AsyncAgentex) -> None:
330322
async def test_method_update(self, async_client: AsyncAgentex) -> None:
331323
state = await async_client.states.update(
332324
state_id="state_id",
333-
agent_id="agent_id",
334325
state={"foo": "bar"},
335-
task_id="task_id",
336326
)
337327
assert_matches_type(State, state, path=["response"])
338328

@@ -341,9 +331,7 @@ async def test_method_update(self, async_client: AsyncAgentex) -> None:
341331
async def test_raw_response_update(self, async_client: AsyncAgentex) -> None:
342332
response = await async_client.states.with_raw_response.update(
343333
state_id="state_id",
344-
agent_id="agent_id",
345334
state={"foo": "bar"},
346-
task_id="task_id",
347335
)
348336

349337
assert response.is_closed is True
@@ -356,9 +344,7 @@ async def test_raw_response_update(self, async_client: AsyncAgentex) -> None:
356344
async def test_streaming_response_update(self, async_client: AsyncAgentex) -> None:
357345
async with async_client.states.with_streaming_response.update(
358346
state_id="state_id",
359-
agent_id="agent_id",
360347
state={"foo": "bar"},
361-
task_id="task_id",
362348
) as response:
363349
assert not response.is_closed
364350
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -374,9 +360,7 @@ async def test_path_params_update(self, async_client: AsyncAgentex) -> None:
374360
with pytest.raises(ValueError, match=r"Expected a non-empty value for `state_id` but received ''"):
375361
await async_client.states.with_raw_response.update(
376362
state_id="",
377-
agent_id="agent_id",
378363
state={"foo": "bar"},
379-
task_id="task_id",
380364
)
381365

382366
@pytest.mark.skip(reason="Mock server tests are disabled")

0 commit comments

Comments
 (0)