File tree Expand file tree Collapse file tree 3 files changed +10
-43
lines changed
preview/reasoning_engines/templates Expand file tree Collapse file tree 3 files changed +10
-43
lines changed Original file line number Diff line number Diff line change 91
91
_SpecifierSet : type [Any ] = Any
92
92
93
93
94
- try :
95
- # For the registration of the AdkApp.async_add_session_to_memory method to
96
- # avoid errors of the form:
97
- # failed to generate schema for async_add_session_to_memory:
98
- # `async_add_session_to_memory` is not fully defined; you should define
99
- # `Session`, then call `async_add_session_to_memory.model_rebuild()`
100
- from google .adk .sessions .session import Session
101
-
102
- Session = Session
103
- except (ImportError , AttributeError ):
104
- # For agent engine templates that do not depend on ADK, we do not need to
105
- # worry about registering the AdkApp.async_add_session_to_memory method.
106
- Session = Any
107
-
108
-
109
94
try :
110
95
from a2a .types import (
111
96
AgentCard ,
Original file line number Diff line number Diff line change 53
53
except (ImportError , AttributeError ):
54
54
BaseSessionService = Any
55
55
56
- try :
57
- from google .adk .sessions .session import Session
58
-
59
- Session = Session
60
- except (ImportError , AttributeError ):
61
- Session = Any
62
-
63
56
try :
64
57
from google .adk .artifacts import BaseArtifactService
65
58
@@ -842,16 +835,14 @@ async def async_delete_session(
842
835
** kwargs ,
843
836
)
844
837
845
- async def async_add_session_to_memory (
846
- self ,
847
- * ,
848
- session : Union ["Session" , Dict [str , Any ]],
849
- ):
838
+ async def async_add_session_to_memory (self , * , session : Dict [str , Any ]):
850
839
"""Generates memories.
851
840
852
841
Args:
853
- session (Union[Session, Dict[str, Any]]):
854
- Required. The session to use for generating memories.
842
+ session (Dict[str, Any]):
843
+ Required. The session to use for generating memories. It should
844
+ be a dictionary representing an ADK Session object, e.g.
845
+ session.model_dump(mode="json").
855
846
"""
856
847
from google .adk .sessions .session import Session
857
848
Original file line number Diff line number Diff line change 58
58
except (ImportError , AttributeError ):
59
59
BaseSessionService = Any
60
60
61
- try :
62
- from google .adk .sessions .session import Session
63
-
64
- Session = Session
65
- except (ImportError , AttributeError ):
66
- Session = Any
67
-
68
61
try :
69
62
from google .adk .artifacts import BaseArtifactService
70
63
@@ -1135,16 +1128,14 @@ def _asyncio_thread_main():
1135
1128
if isinstance (outcome , RuntimeError ):
1136
1129
raise outcome from None
1137
1130
1138
- async def async_add_session_to_memory (
1139
- self ,
1140
- * ,
1141
- session : Union ["Session" , Dict [str , Any ]],
1142
- ):
1131
+ async def async_add_session_to_memory (self , * , session : Dict [str , Any ]):
1143
1132
"""Generates memories.
1144
1133
1145
1134
Args:
1146
- session (Union[Session, Dict[str, Any]]):
1147
- Required. The session to use for generating memories.
1135
+ session (Dict[str, Any]):
1136
+ Required. The session to use for generating memories. It should
1137
+ be a dictionary representing an ADK Session object, e.g.
1138
+ session.model_dump(mode="json").
1148
1139
"""
1149
1140
from google .adk .sessions .session import Session
1150
1141
You can’t perform that action at this time.
0 commit comments