Skip to content

Commit 7634c23

Browse files
feat: [REMOTE-1538] Support base model on named agents
1 parent d54b3d5 commit 7634c23

6 files changed

Lines changed: 47 additions & 6 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-439930897f625c088be1b09e394f4053e45060cd2daab7454dfcf6c775cba1fb.yml
3-
openapi_spec_hash: f0382bea9210d76f906665e8a825a05b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-e752e75a35d88b84870729ef94b0c32783172983420cbff1b204ca14375553f7.yml
3+
openapi_spec_hash: 34787afc1e1c84a643431a0f0eb352ae
44
config_hash: 5a6e285f6e3a958a887b31b972a3f49c

src/oz_agent_sdk/resources/agent/agent_.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def create(
5050
self,
5151
*,
5252
name: str,
53+
base_model: Optional[str] | Omit = omit,
5354
description: Optional[str] | Omit = omit,
5455
secrets: Iterable[agent_create_params.Secret] | Omit = omit,
5556
skills: SequenceNotStr[str] | Omit = omit,
@@ -68,6 +69,8 @@ def create(
6869
Args:
6970
name: A name for the agent
7071
72+
base_model: Optional base model for runs executed by this agent.
73+
7174
description: Optional description of the agent
7275
7376
secrets: Optional list of secrets associated with the agent. Duplicate names within a
@@ -94,6 +97,7 @@ def create(
9497
body=maybe_transform(
9598
{
9699
"name": name,
100+
"base_model": base_model,
97101
"description": description,
98102
"secrets": secrets,
99103
"skills": skills,
@@ -110,6 +114,7 @@ def update(
110114
self,
111115
uid: str,
112116
*,
117+
base_model: Optional[str] | Omit = omit,
113118
description: Optional[str] | Omit = omit,
114119
name: str | Omit = omit,
115120
secrets: Optional[Iterable[agent_update_params.Secret]] | Omit = omit,
@@ -124,9 +129,12 @@ def update(
124129
"""Update an existing agent.
125130
126131
Args:
127-
description: Replacement description.
132+
base_model: Replacement base model.
133+
134+
Omit or pass `null` to leave unchanged, or pass an empty
135+
string to clear.
128136
129-
Omit or pass `null` to leave unchanged, or use an empty
137+
description: Replacement description. Omit or pass `null` to leave unchanged, or use an empty
130138
value to clear.
131139
132140
name: The new name for the agent
@@ -151,6 +159,7 @@ def update(
151159
path_template("/agent/identities/{uid}", uid=uid),
152160
body=maybe_transform(
153161
{
162+
"base_model": base_model,
154163
"description": description,
155164
"name": name,
156165
"secrets": secrets,
@@ -285,6 +294,7 @@ async def create(
285294
self,
286295
*,
287296
name: str,
297+
base_model: Optional[str] | Omit = omit,
288298
description: Optional[str] | Omit = omit,
289299
secrets: Iterable[agent_create_params.Secret] | Omit = omit,
290300
skills: SequenceNotStr[str] | Omit = omit,
@@ -303,6 +313,8 @@ async def create(
303313
Args:
304314
name: A name for the agent
305315
316+
base_model: Optional base model for runs executed by this agent.
317+
306318
description: Optional description of the agent
307319
308320
secrets: Optional list of secrets associated with the agent. Duplicate names within a
@@ -329,6 +341,7 @@ async def create(
329341
body=await async_maybe_transform(
330342
{
331343
"name": name,
344+
"base_model": base_model,
332345
"description": description,
333346
"secrets": secrets,
334347
"skills": skills,
@@ -345,6 +358,7 @@ async def update(
345358
self,
346359
uid: str,
347360
*,
361+
base_model: Optional[str] | Omit = omit,
348362
description: Optional[str] | Omit = omit,
349363
name: str | Omit = omit,
350364
secrets: Optional[Iterable[agent_update_params.Secret]] | Omit = omit,
@@ -359,9 +373,12 @@ async def update(
359373
"""Update an existing agent.
360374
361375
Args:
362-
description: Replacement description.
376+
base_model: Replacement base model.
377+
378+
Omit or pass `null` to leave unchanged, or pass an empty
379+
string to clear.
363380
364-
Omit or pass `null` to leave unchanged, or use an empty
381+
description: Replacement description. Omit or pass `null` to leave unchanged, or use an empty
365382
value to clear.
366383
367384
name: The new name for the agent
@@ -386,6 +403,7 @@ async def update(
386403
path_template("/agent/identities/{uid}", uid=uid),
387404
body=await async_maybe_transform(
388405
{
406+
"base_model": base_model,
389407
"description": description,
390408
"name": name,
391409
"secrets": secrets,

src/oz_agent_sdk/types/agent/agent_create_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class AgentCreateParams(TypedDict, total=False):
1414
name: Required[str]
1515
"""A name for the agent"""
1616

17+
base_model: Optional[str]
18+
"""Optional base model for runs executed by this agent."""
19+
1720
description: Optional[str]
1821
"""Optional description of the agent"""
1922

src/oz_agent_sdk/types/agent/agent_response.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,15 @@ class AgentResponse(BaseModel):
3737
uid: str
3838
"""Unique identifier for the agent"""
3939

40+
base_model: Optional[str] = None
41+
"""Base model for runs executed by this agent.
42+
43+
The precedence order for model resolution is:
44+
45+
1. The model specified on the run itself
46+
2. The agent's base model
47+
3. The team's default model
48+
"""
49+
4050
description: Optional[str] = None
4151
"""Optional description of the agent"""

src/oz_agent_sdk/types/agent/agent_update_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111

1212

1313
class AgentUpdateParams(TypedDict, total=False):
14+
base_model: Optional[str]
15+
"""Replacement base model.
16+
17+
Omit or pass `null` to leave unchanged, or pass an empty string to clear.
18+
"""
19+
1420
description: Optional[str]
1521
"""Replacement description.
1622

tests/api_resources/agent/test_agent_.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_method_create(self, client: OzAPI) -> None:
3333
def test_method_create_with_all_params(self, client: OzAPI) -> None:
3434
agent = client.agent.agent.create(
3535
name="name",
36+
base_model="base_model",
3637
description="description",
3738
secrets=[{"name": "name"}],
3839
skills=["string"],
@@ -78,6 +79,7 @@ def test_method_update(self, client: OzAPI) -> None:
7879
def test_method_update_with_all_params(self, client: OzAPI) -> None:
7980
agent = client.agent.agent.update(
8081
uid="uid",
82+
base_model="base_model",
8183
description="description",
8284
name="name",
8385
secrets=[{"name": "name"}],
@@ -250,6 +252,7 @@ async def test_method_create(self, async_client: AsyncOzAPI) -> None:
250252
async def test_method_create_with_all_params(self, async_client: AsyncOzAPI) -> None:
251253
agent = await async_client.agent.agent.create(
252254
name="name",
255+
base_model="base_model",
253256
description="description",
254257
secrets=[{"name": "name"}],
255258
skills=["string"],
@@ -295,6 +298,7 @@ async def test_method_update(self, async_client: AsyncOzAPI) -> None:
295298
async def test_method_update_with_all_params(self, async_client: AsyncOzAPI) -> None:
296299
agent = await async_client.agent.agent.update(
297300
uid="uid",
301+
base_model="base_model",
298302
description="description",
299303
name="name",
300304
secrets=[{"name": "name"}],

0 commit comments

Comments
 (0)