Skip to content

Commit 8e11d53

Browse files
committed
Merge branch 'agents_resume' into agents_resume_2
2 parents 3e4ddc9 + 250676f commit 8e11d53

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

src/llama_stack_client/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def _build_request(
518518
# so that passing a `TypedDict` doesn't cause an error.
519519
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
520520
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
521-
json=json_data,
521+
json=json_data if is_given(json_data) else None,
522522
files=files,
523523
**kwargs,
524524
)

src/llama_stack_client/resources/agents/turn.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def create(
5858
*,
5959
agent_id: str,
6060
messages: Iterable[turn_create_params.Message],
61+
allow_turn_resume: bool | NotGiven = NOT_GIVEN,
6162
documents: Iterable[turn_create_params.Document] | NotGiven = NOT_GIVEN,
6263
stream: Literal[False] | NotGiven = NOT_GIVEN,
6364
tool_config: turn_create_params.ToolConfig | NotGiven = NOT_GIVEN,
@@ -91,6 +92,7 @@ def create(
9192
agent_id: str,
9293
messages: Iterable[turn_create_params.Message],
9394
stream: Literal[True],
95+
allow_turn_resume: bool | NotGiven = NOT_GIVEN,
9496
documents: Iterable[turn_create_params.Document] | NotGiven = NOT_GIVEN,
9597
tool_config: turn_create_params.ToolConfig | NotGiven = NOT_GIVEN,
9698
toolgroups: List[turn_create_params.Toolgroup] | NotGiven = NOT_GIVEN,
@@ -123,6 +125,7 @@ def create(
123125
agent_id: str,
124126
messages: Iterable[turn_create_params.Message],
125127
stream: bool,
128+
allow_turn_resume: bool | NotGiven = NOT_GIVEN,
126129
documents: Iterable[turn_create_params.Document] | NotGiven = NOT_GIVEN,
127130
tool_config: turn_create_params.ToolConfig | NotGiven = NOT_GIVEN,
128131
toolgroups: List[turn_create_params.Toolgroup] | NotGiven = NOT_GIVEN,
@@ -154,6 +157,7 @@ def create(
154157
*,
155158
agent_id: str,
156159
messages: Iterable[turn_create_params.Message],
160+
allow_turn_resume: bool | NotGiven = NOT_GIVEN,
157161
documents: Iterable[turn_create_params.Document] | NotGiven = NOT_GIVEN,
158162
stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN,
159163
tool_config: turn_create_params.ToolConfig | NotGiven = NOT_GIVEN,
@@ -174,6 +178,7 @@ def create(
174178
body=maybe_transform(
175179
{
176180
"messages": messages,
181+
"allow_turn_resume": allow_turn_resume,
177182
"documents": documents,
178183
"stream": stream,
179184
"tool_config": tool_config,
@@ -377,6 +382,7 @@ async def create(
377382
*,
378383
agent_id: str,
379384
messages: Iterable[turn_create_params.Message],
385+
allow_turn_resume: bool | NotGiven = NOT_GIVEN,
380386
documents: Iterable[turn_create_params.Document] | NotGiven = NOT_GIVEN,
381387
stream: Literal[False] | NotGiven = NOT_GIVEN,
382388
tool_config: turn_create_params.ToolConfig | NotGiven = NOT_GIVEN,
@@ -410,6 +416,7 @@ async def create(
410416
agent_id: str,
411417
messages: Iterable[turn_create_params.Message],
412418
stream: Literal[True],
419+
allow_turn_resume: bool | NotGiven = NOT_GIVEN,
413420
documents: Iterable[turn_create_params.Document] | NotGiven = NOT_GIVEN,
414421
tool_config: turn_create_params.ToolConfig | NotGiven = NOT_GIVEN,
415422
toolgroups: List[turn_create_params.Toolgroup] | NotGiven = NOT_GIVEN,
@@ -442,6 +449,7 @@ async def create(
442449
agent_id: str,
443450
messages: Iterable[turn_create_params.Message],
444451
stream: bool,
452+
allow_turn_resume: bool | NotGiven = NOT_GIVEN,
445453
documents: Iterable[turn_create_params.Document] | NotGiven = NOT_GIVEN,
446454
tool_config: turn_create_params.ToolConfig | NotGiven = NOT_GIVEN,
447455
toolgroups: List[turn_create_params.Toolgroup] | NotGiven = NOT_GIVEN,
@@ -473,6 +481,7 @@ async def create(
473481
*,
474482
agent_id: str,
475483
messages: Iterable[turn_create_params.Message],
484+
allow_turn_resume: bool | NotGiven = NOT_GIVEN,
476485
documents: Iterable[turn_create_params.Document] | NotGiven = NOT_GIVEN,
477486
stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN,
478487
tool_config: turn_create_params.ToolConfig | NotGiven = NOT_GIVEN,
@@ -493,6 +502,7 @@ async def create(
493502
body=await async_maybe_transform(
494503
{
495504
"messages": messages,
505+
"allow_turn_resume": allow_turn_resume,
496506
"documents": documents,
497507
"stream": stream,
498508
"tool_config": tool_config,

src/llama_stack_client/types/agents/turn_create_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class TurnCreateParamsBase(TypedDict, total=False):
3232

3333
messages: Required[Iterable[Message]]
3434

35+
allow_turn_resume: bool
36+
3537
documents: Iterable[Document]
3638

3739
tool_config: ToolConfig

tests/api_resources/agents/test_turn.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def test_method_create_with_all_params_overload_1(self, client: LlamaStackClient
4343
"context": "string",
4444
}
4545
],
46+
allow_turn_resume=True,
4647
documents=[
4748
{
4849
"content": "string",
@@ -151,6 +152,7 @@ def test_method_create_with_all_params_overload_2(self, client: LlamaStackClient
151152
}
152153
],
153154
stream=True,
155+
allow_turn_resume=True,
154156
documents=[
155157
{
156158
"content": "string",
@@ -562,6 +564,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
562564
"context": "string",
563565
}
564566
],
567+
allow_turn_resume=True,
565568
documents=[
566569
{
567570
"content": "string",
@@ -670,6 +673,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
670673
}
671674
],
672675
stream=True,
676+
allow_turn_resume=True,
673677
documents=[
674678
{
675679
"content": "string",

0 commit comments

Comments
 (0)