Skip to content

Commit 6bb74c2

Browse files
feat(memory): wire memory stores into run pipeline and add listing endpoint
1 parent 94b5348 commit 6bb74c2

6 files changed

Lines changed: 89 additions & 12 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 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-2783b07289e9f71f07550497c5180824f3dbc92477b5d1d8a80fa6dce4e3b8b6.yml
3-
openapi_spec_hash: e1d4cff965beed1ec255bf387d55d940
4-
config_hash: 5a6e285f6e3a958a887b31b972a3f49c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta/warp-api-8c84aaafca600b8a8f64e590997958a0b9dcb6172fdf3220dd243c20bd0ee3dc.yml
3+
openapi_spec_hash: 82d67b5080e55941b619875c222b94b8
4+
config_hash: 236823a4936c76818117c16aa5c188df

src/oz_agent_sdk/types/agent/scheduled_agent_item.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class ScheduledAgentItem(BaseModel):
4141
agent_config: Optional[AmbientAgentConfig] = None
4242
"""Configuration for a cloud agent run"""
4343

44+
agent_uid: Optional[str] = None
45+
"""UID of the agent that this schedule runs as"""
46+
4447
created_by: Optional[UserProfile] = None
4548

4649
environment: Optional[CloudEnvironmentConfig] = None

src/oz_agent_sdk/types/ambient_agent_config.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, Optional
3+
from typing import Dict, List, Optional
44
from typing_extensions import Literal
55

66
from pydantic import Field as FieldInfo
77

88
from .._models import BaseModel
99
from .mcp_server_config import McpServerConfig
1010

11-
__all__ = ["AmbientAgentConfig", "Harness", "HarnessAuthSecrets", "SessionSharing"]
11+
__all__ = ["AmbientAgentConfig", "Harness", "HarnessAuthSecrets", "MemoryStore", "SessionSharing"]
1212

1313

1414
class Harness(BaseModel):
@@ -41,6 +41,19 @@ class HarnessAuthSecrets(BaseModel):
4141
"""
4242

4343

44+
class MemoryStore(BaseModel):
45+
"""Reference to a memory store to attach to an agent."""
46+
47+
access: Literal["read_write", "read_only"]
48+
"""Access level for the store."""
49+
50+
instructions: str
51+
"""Instructions for how the agent should use this memory store. Must not be empty."""
52+
53+
uid: str
54+
"""UID of the memory store."""
55+
56+
4457
class SessionSharing(BaseModel):
4558
"""
4659
Configures sharing behavior for the run's shared session.
@@ -100,6 +113,9 @@ class AmbientAgentConfig(BaseModel):
100113
mcp_servers: Optional[Dict[str, McpServerConfig]] = None
101114
"""Map of MCP server configurations by name"""
102115

116+
memory_stores: Optional[List[MemoryStore]] = None
117+
"""Memory stores to attach to this run."""
118+
103119
api_model_id: Optional[str] = FieldInfo(alias="model_id", default=None)
104120
"""LLM model to use (uses team default if not specified)"""
105121

src/oz_agent_sdk/types/ambient_agent_config_param.py

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

33
from __future__ import annotations
44

5-
from typing import Dict
6-
from typing_extensions import Literal, TypedDict
5+
from typing import Dict, Iterable
6+
from typing_extensions import Literal, Required, TypedDict
77

88
from .mcp_server_config_param import McpServerConfigParam
99

10-
__all__ = ["AmbientAgentConfigParam", "Harness", "HarnessAuthSecrets", "SessionSharing"]
10+
__all__ = ["AmbientAgentConfigParam", "Harness", "HarnessAuthSecrets", "MemoryStore", "SessionSharing"]
1111

1212

1313
class Harness(TypedDict, total=False):
@@ -40,6 +40,19 @@ class HarnessAuthSecrets(TypedDict, total=False):
4040
"""
4141

4242

43+
class MemoryStore(TypedDict, total=False):
44+
"""Reference to a memory store to attach to an agent."""
45+
46+
access: Required[Literal["read_write", "read_only"]]
47+
"""Access level for the store."""
48+
49+
instructions: Required[str]
50+
"""Instructions for how the agent should use this memory store. Must not be empty."""
51+
52+
uid: Required[str]
53+
"""UID of the memory store."""
54+
55+
4356
class SessionSharing(TypedDict, total=False):
4457
"""
4558
Configures sharing behavior for the run's shared session.
@@ -99,6 +112,9 @@ class AmbientAgentConfigParam(TypedDict, total=False):
99112
mcp_servers: Dict[str, McpServerConfigParam]
100113
"""Map of MCP server configurations by name"""
101114

115+
memory_stores: Iterable[MemoryStore]
116+
"""Memory stores to attach to this run."""
117+
102118
model_id: str
103119
"""LLM model to use (uses team default if not specified)"""
104120

tests/api_resources/agent/test_schedules.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,20 @@ def test_method_create_with_all_params(self, client: OzAPI) -> None:
5353
"warp_id": "warp_id",
5454
}
5555
},
56+
"memory_stores": [
57+
{
58+
"access": "read_write",
59+
"instructions": "instructions",
60+
"uid": "uid",
61+
}
62+
],
5663
"model_id": "model_id",
5764
"name": "name",
5865
"session_sharing": {"public_access": "VIEWER"},
5966
"skill_spec": "skill_spec",
6067
"worker_host": "worker_host",
6168
},
62-
agent_uid="agent_uid",
69+
agent_uid="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
6370
enabled=True,
6471
mode="normal",
6572
prompt="Review open pull requests and provide feedback",
@@ -173,13 +180,20 @@ def test_method_update_with_all_params(self, client: OzAPI) -> None:
173180
"warp_id": "warp_id",
174181
}
175182
},
183+
"memory_stores": [
184+
{
185+
"access": "read_write",
186+
"instructions": "instructions",
187+
"uid": "uid",
188+
}
189+
],
176190
"model_id": "model_id",
177191
"name": "name",
178192
"session_sharing": {"public_access": "VIEWER"},
179193
"skill_spec": "skill_spec",
180194
"worker_host": "worker_host",
181195
},
182-
agent_uid="agent_uid",
196+
agent_uid="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
183197
mode="normal",
184198
prompt="prompt",
185199
)
@@ -420,13 +434,20 @@ async def test_method_create_with_all_params(self, async_client: AsyncOzAPI) ->
420434
"warp_id": "warp_id",
421435
}
422436
},
437+
"memory_stores": [
438+
{
439+
"access": "read_write",
440+
"instructions": "instructions",
441+
"uid": "uid",
442+
}
443+
],
423444
"model_id": "model_id",
424445
"name": "name",
425446
"session_sharing": {"public_access": "VIEWER"},
426447
"skill_spec": "skill_spec",
427448
"worker_host": "worker_host",
428449
},
429-
agent_uid="agent_uid",
450+
agent_uid="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
430451
enabled=True,
431452
mode="normal",
432453
prompt="Review open pull requests and provide feedback",
@@ -540,13 +561,20 @@ async def test_method_update_with_all_params(self, async_client: AsyncOzAPI) ->
540561
"warp_id": "warp_id",
541562
}
542563
},
564+
"memory_stores": [
565+
{
566+
"access": "read_write",
567+
"instructions": "instructions",
568+
"uid": "uid",
569+
}
570+
],
543571
"model_id": "model_id",
544572
"name": "name",
545573
"session_sharing": {"public_access": "VIEWER"},
546574
"skill_spec": "skill_spec",
547575
"worker_host": "worker_host",
548576
},
549-
agent_uid="agent_uid",
577+
agent_uid="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
550578
mode="normal",
551579
prompt="prompt",
552580
)

tests/api_resources/test_agent.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,13 @@ def test_method_run_with_all_params(self, client: OzAPI) -> None:
174174
"warp_id": "warp_id",
175175
}
176176
},
177+
"memory_stores": [
178+
{
179+
"access": "read_write",
180+
"instructions": "instructions",
181+
"uid": "uid",
182+
}
183+
],
177184
"model_id": "model_id",
178185
"name": "name",
179186
"session_sharing": {"public_access": "VIEWER"},
@@ -371,6 +378,13 @@ async def test_method_run_with_all_params(self, async_client: AsyncOzAPI) -> Non
371378
"warp_id": "warp_id",
372379
}
373380
},
381+
"memory_stores": [
382+
{
383+
"access": "read_write",
384+
"instructions": "instructions",
385+
"uid": "uid",
386+
}
387+
],
374388
"model_id": "model_id",
375389
"name": "name",
376390
"session_sharing": {"public_access": "VIEWER"},

0 commit comments

Comments
 (0)