|
4 | 4 |
|
5 | 5 | from ..agent_config import AgentConfig |
6 | 6 | from ..pagination import PaginatedResponse |
7 | | -from ..types import Agent, AgentMemory, AgentVersion, ExecutionResult, Guardrail |
| 7 | +from ..types import Agent, AgentVersion, ExecutionResult, Guardrail |
8 | 8 | from .base import AsyncBaseResource, BaseResource |
9 | 9 |
|
10 | 10 |
|
@@ -138,54 +138,6 @@ def create_guardrail( |
138 | 138 | body = self._http.post(f"/api/v1/agents/{agent_id}/guardrails", json=payload) |
139 | 139 | return Guardrail.from_dict(self._unwrap(body)) |
140 | 140 |
|
141 | | - def list_memories( |
142 | | - self, agent_id: str, *, page: int = 1, limit: int = 20 |
143 | | - ) -> PaginatedResponse[AgentMemory]: |
144 | | - body = self._http.get( |
145 | | - f"/api/v1/agents/{agent_id}/memories", params={"page": page, "limit": limit} |
146 | | - ) |
147 | | - return PaginatedResponse.from_response(body, AgentMemory.from_dict) |
148 | | - |
149 | | - def create_memory( |
150 | | - self, |
151 | | - agent_id: str, |
152 | | - *, |
153 | | - content: str, |
154 | | - memory_type: str, |
155 | | - importance: Optional[float] = None, |
156 | | - metadata: Optional[Dict[str, Any]] = None, |
157 | | - chat_session_id: Optional[str] = None, |
158 | | - ) -> AgentMemory: |
159 | | - payload: Dict[str, Any] = {"content": content, "memory_type": memory_type} |
160 | | - if importance is not None: |
161 | | - payload["importance"] = importance |
162 | | - if metadata is not None: |
163 | | - payload["metadata"] = metadata |
164 | | - if chat_session_id is not None: |
165 | | - payload["chat_session_id"] = chat_session_id |
166 | | - body = self._http.post(f"/api/v1/agents/{agent_id}/memories", json=payload) |
167 | | - return AgentMemory.from_dict(self._unwrap(body)) |
168 | | - |
169 | | - def search_memories( |
170 | | - self, |
171 | | - agent_id: str, |
172 | | - *, |
173 | | - query: str, |
174 | | - threshold: Optional[float] = None, |
175 | | - limit: Optional[int] = None, |
176 | | - ) -> List[AgentMemory]: |
177 | | - payload: Dict[str, Any] = {"query": query} |
178 | | - if threshold is not None: |
179 | | - payload["threshold"] = threshold |
180 | | - if limit is not None: |
181 | | - payload["limit"] = limit |
182 | | - body = self._http.post(f"/api/v1/agents/{agent_id}/memories/search", json=payload) |
183 | | - data = self._unwrap(body) |
184 | | - return [AgentMemory.from_dict(m) for m in (data if isinstance(data, list) else [])] |
185 | | - |
186 | | - def delete_all_memories(self, agent_id: str) -> None: |
187 | | - self._http.delete(f"/api/v1/agents/{agent_id}/memories") |
188 | | - |
189 | 141 |
|
190 | 142 | class AsyncAgentsResource(AsyncBaseResource): |
191 | 143 | async def list( |
@@ -316,51 +268,3 @@ async def create_guardrail( |
316 | 268 | payload["config"] = config |
317 | 269 | body = await self._http.post(f"/api/v1/agents/{agent_id}/guardrails", json=payload) |
318 | 270 | return Guardrail.from_dict(self._unwrap(body)) |
319 | | - |
320 | | - async def list_memories( |
321 | | - self, agent_id: str, *, page: int = 1, limit: int = 20 |
322 | | - ) -> PaginatedResponse[AgentMemory]: |
323 | | - body = await self._http.get( |
324 | | - f"/api/v1/agents/{agent_id}/memories", params={"page": page, "limit": limit} |
325 | | - ) |
326 | | - return PaginatedResponse.from_response(body, AgentMemory.from_dict) |
327 | | - |
328 | | - async def create_memory( |
329 | | - self, |
330 | | - agent_id: str, |
331 | | - *, |
332 | | - content: str, |
333 | | - memory_type: str, |
334 | | - importance: Optional[float] = None, |
335 | | - metadata: Optional[Dict[str, Any]] = None, |
336 | | - chat_session_id: Optional[str] = None, |
337 | | - ) -> AgentMemory: |
338 | | - payload: Dict[str, Any] = {"content": content, "memory_type": memory_type} |
339 | | - if importance is not None: |
340 | | - payload["importance"] = importance |
341 | | - if metadata is not None: |
342 | | - payload["metadata"] = metadata |
343 | | - if chat_session_id is not None: |
344 | | - payload["chat_session_id"] = chat_session_id |
345 | | - body = await self._http.post(f"/api/v1/agents/{agent_id}/memories", json=payload) |
346 | | - return AgentMemory.from_dict(self._unwrap(body)) |
347 | | - |
348 | | - async def search_memories( |
349 | | - self, |
350 | | - agent_id: str, |
351 | | - *, |
352 | | - query: str, |
353 | | - threshold: Optional[float] = None, |
354 | | - limit: Optional[int] = None, |
355 | | - ) -> List[AgentMemory]: |
356 | | - payload: Dict[str, Any] = {"query": query} |
357 | | - if threshold is not None: |
358 | | - payload["threshold"] = threshold |
359 | | - if limit is not None: |
360 | | - payload["limit"] = limit |
361 | | - body = await self._http.post(f"/api/v1/agents/{agent_id}/memories/search", json=payload) |
362 | | - data = self._unwrap(body) |
363 | | - return [AgentMemory.from_dict(m) for m in (data if isinstance(data, list) else [])] |
364 | | - |
365 | | - async def delete_all_memories(self, agent_id: str) -> None: |
366 | | - await self._http.delete(f"/api/v1/agents/{agent_id}/memories") |
0 commit comments