Skip to content

Commit f67f068

Browse files
feat: Allow for empty-prompt cloud-agent handoff
1 parent b5d9461 commit f67f068

6 files changed

Lines changed: 12 additions & 17 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: 23
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-0bc171e3cd0224936953898ce9b7eb35e1bf1cbf58a673fc80b32c90ce84bcd0.yml
3-
openapi_spec_hash: 6c7d5f294b0800e878729314f57a09f0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-8b8de9abf59d848042cc4107118de305ef6dddb46a3783eb6b0d94457a4c8682.yml
3+
openapi_spec_hash: 6c50747f76de7e0bb66a5fdd07d851ac
44
config_hash: 279b20eafe220bf54131676cc0b9cdd2

src/oz_agent_sdk/resources/agent/agent.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ def run(
302302
hierarchies.
303303
304304
prompt: The prompt/instruction for the agent to execute. Required unless a skill is
305-
specified via the skill field, config.skill_spec, or config.skills.
305+
specified via the skill field, config.skill_spec, or config.skills. Handoff
306+
requests may omit prompt when conversation_id is set.
306307
307308
skill:
308309
Skill specification to use as the base prompt for the agent. Supported formats:
@@ -593,7 +594,8 @@ async def run(
593594
hierarchies.
594595
595596
prompt: The prompt/instruction for the agent to execute. Required unless a skill is
596-
specified via the skill field, config.skill_spec, or config.skills.
597+
specified via the skill field, config.skill_spec, or config.skills. Handoff
598+
requests may omit prompt when conversation_id is set.
597599
598600
skill:
599601
Skill specification to use as the base prompt for the agent. Supported formats:

src/oz_agent_sdk/resources/agent/runs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def submit_followup(
301301
self,
302302
run_id: str,
303303
*,
304-
message: str,
304+
message: str | Omit = omit,
305305
mode: Literal["normal", "plan", "orchestrate"] | Omit = omit,
306306
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
307307
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -621,7 +621,7 @@ async def submit_followup(
621621
self,
622622
run_id: str,
623623
*,
624-
message: str,
624+
message: str | Omit = omit,
625625
mode: Literal["normal", "plan", "orchestrate"] | Omit = omit,
626626
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
627627
# The extra values given here take precedence over values defined on the client or passed to this method.

src/oz_agent_sdk/types/agent/run_submit_followup_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Literal, Required, TypedDict
5+
from typing_extensions import Literal, TypedDict
66

77
__all__ = ["RunSubmitFollowupParams"]
88

99

1010
class RunSubmitFollowupParams(TypedDict, total=False):
11-
message: Required[str]
11+
message: str
1212
"""The follow-up message to send to the run."""
1313

1414
mode: Literal["normal", "plan", "orchestrate"]

src/oz_agent_sdk/types/agent_run_params.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class AgentRunParams(TypedDict, total=False):
5555
prompt: str
5656
"""
5757
The prompt/instruction for the agent to execute. Required unless a skill is
58-
specified via the skill field, config.skill_spec, or config.skills.
58+
specified via the skill field, config.skill_spec, or config.skills. Handoff
59+
requests may omit prompt when conversation_id is set.
5960
"""
6061

6162
skill: str

tests/api_resources/agent/test_runs.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ def test_path_params_list_handoff_attachments(self, client: OzAPI) -> None:
209209
def test_method_submit_followup(self, client: OzAPI) -> None:
210210
run = client.agent.runs.submit_followup(
211211
run_id="runId",
212-
message="message",
213212
)
214213
assert_matches_type(object, run, path=["response"])
215214

@@ -228,7 +227,6 @@ def test_method_submit_followup_with_all_params(self, client: OzAPI) -> None:
228227
def test_raw_response_submit_followup(self, client: OzAPI) -> None:
229228
response = client.agent.runs.with_raw_response.submit_followup(
230229
run_id="runId",
231-
message="message",
232230
)
233231

234232
assert response.is_closed is True
@@ -241,7 +239,6 @@ def test_raw_response_submit_followup(self, client: OzAPI) -> None:
241239
def test_streaming_response_submit_followup(self, client: OzAPI) -> None:
242240
with client.agent.runs.with_streaming_response.submit_followup(
243241
run_id="runId",
244-
message="message",
245242
) as response:
246243
assert not response.is_closed
247244
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -257,7 +254,6 @@ def test_path_params_submit_followup(self, client: OzAPI) -> None:
257254
with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
258255
client.agent.runs.with_raw_response.submit_followup(
259256
run_id="",
260-
message="message",
261257
)
262258

263259

@@ -453,7 +449,6 @@ async def test_path_params_list_handoff_attachments(self, async_client: AsyncOzA
453449
async def test_method_submit_followup(self, async_client: AsyncOzAPI) -> None:
454450
run = await async_client.agent.runs.submit_followup(
455451
run_id="runId",
456-
message="message",
457452
)
458453
assert_matches_type(object, run, path=["response"])
459454

@@ -472,7 +467,6 @@ async def test_method_submit_followup_with_all_params(self, async_client: AsyncO
472467
async def test_raw_response_submit_followup(self, async_client: AsyncOzAPI) -> None:
473468
response = await async_client.agent.runs.with_raw_response.submit_followup(
474469
run_id="runId",
475-
message="message",
476470
)
477471

478472
assert response.is_closed is True
@@ -485,7 +479,6 @@ async def test_raw_response_submit_followup(self, async_client: AsyncOzAPI) -> N
485479
async def test_streaming_response_submit_followup(self, async_client: AsyncOzAPI) -> None:
486480
async with async_client.agent.runs.with_streaming_response.submit_followup(
487481
run_id="runId",
488-
message="message",
489482
) as response:
490483
assert not response.is_closed
491484
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -501,5 +494,4 @@ async def test_path_params_submit_followup(self, async_client: AsyncOzAPI) -> No
501494
with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"):
502495
await async_client.agent.runs.with_raw_response.submit_followup(
503496
run_id="",
504-
message="message",
505497
)

0 commit comments

Comments
 (0)