File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -227,27 +227,28 @@ if __name__ == "__main__":
227227You can implement your own session memory by creating a class that follows the [ ` Session ` ] [ agents.memory.session.Session ] protocol:
228228
229229``` python
230- from agents.memory import Session
230+ from agents.memory.session import SessionABC
231+ from agents.items import TResponseInputItem
231232from typing import List
232233
233- class MyCustomSession :
234+ class MyCustomSession ( SessionABC ) :
234235 """ Custom session implementation following the Session protocol."""
235236
236237 def __init__ (self , session_id : str ):
237238 self .session_id = session_id
238239 # Your initialization here
239240
240- async def get_items (self , limit : int | None = None ) -> List[dict ]:
241+ async def get_items (self , limit : int | None = None ) -> List[TResponseInputItem ]:
241242 """ Retrieve conversation history for this session."""
242243 # Your implementation here
243244 pass
244245
245- async def add_items (self , items : List[dict ]) -> None :
246+ async def add_items (self , items : List[TResponseInputItem ]) -> None :
246247 """ Store new items for this session."""
247248 # Your implementation here
248249 pass
249250
250- async def pop_item (self ) -> dict | None :
251+ async def pop_item (self ) -> TResponseInputItem | None :
251252 """ Remove and return the most recent item from this session."""
252253 # Your implementation here
253254 pass
You can’t perform that action at this time.
0 commit comments