@@ -65,9 +65,10 @@ async def _process_request(
6565 session_id : str ,
6666 task_updater : TaskUpdater ,
6767 ) -> None :
68- session_id = self ._upsert_session (
68+ session = await self ._upsert_session (
6969 session_id ,
70- ).id
70+ )
71+ session_id = session .id
7172 auth_details = None
7273 async for event in self ._run_agent (session_id , new_message ):
7374 # This agent is expected to do one of two things:
@@ -229,10 +230,10 @@ async def cancel(self, context: RequestContext, event_queue: EventQueue):
229230 async def on_auth_callback (self , state : str , uri : str ):
230231 self ._awaiting_auth [state ].set_result (uri )
231232
232- def _upsert_session (self , session_id : str ):
233- return self .runner .session_service .get_session (
233+ async def _upsert_session (self , session_id : str ):
234+ return await self .runner .session_service .get_session (
234235 app_name = self .runner .app_name , user_id = 'self' , session_id = session_id
235- ) or self .runner .session_service .create_session (
236+ ) or await self .runner .session_service .create_session (
236237 app_name = self .runner .app_name , user_id = 'self' , session_id = session_id
237238 )
238239
@@ -317,7 +318,7 @@ def get_auth_config(
317318) -> AuthConfig :
318319 """Extracts the AuthConfig object from the arguments of the auth request function call."""
319320 if not auth_request_function_call .args or not (
320- auth_config := auth_request_function_call .args .get ('auth_config ' )
321+ auth_config := auth_request_function_call .args .get ('authConfig ' )
321322 ):
322323 raise ValueError (
323324 f'Cannot get auth config from function call: { auth_request_function_call } '
0 commit comments