|
17 | 17 | import asyncio
|
18 | 18 | import logging
|
19 | 19 | import queue
|
20 |
| -import time |
21 |
| -from typing import Any |
22 | 20 | from typing import AsyncGenerator
|
23 | 21 | from typing import Callable
|
24 | 22 | from typing import Generator
|
25 | 23 | from typing import List
|
26 | 24 | from typing import Optional
|
27 |
| -import uuid |
28 | 25 | import warnings
|
29 | 26 |
|
30 | 27 | from google.genai import types
|
|
41 | 38 | from .auth.credential_service.base_credential_service import BaseCredentialService
|
42 | 39 | from .code_executors.built_in_code_executor import BuiltInCodeExecutor
|
43 | 40 | from .events.event import Event
|
44 |
| -from .events.event import EventActions |
45 | 41 | from .flows.llm_flows.functions import find_matching_function_call
|
46 | 42 | from .memory.base_memory_service import BaseMemoryService
|
47 | 43 | from .memory.in_memory_memory_service import InMemoryMemoryService
|
@@ -178,7 +174,6 @@ async def run_async(
|
178 | 174 | user_id: str,
|
179 | 175 | session_id: str,
|
180 | 176 | new_message: types.Content,
|
181 |
| - state_delta: Optional[dict[str, Any]] = None, |
182 | 177 | run_config: RunConfig = RunConfig(),
|
183 | 178 | ) -> AsyncGenerator[Event, None]:
|
184 | 179 | """Main entry method to run the agent in this runner.
|
@@ -221,7 +216,6 @@ async def run_async(
|
221 | 216 | new_message,
|
222 | 217 | invocation_context,
|
223 | 218 | run_config.save_input_blobs_as_artifacts,
|
224 |
| - state_delta, |
225 | 219 | )
|
226 | 220 |
|
227 | 221 | invocation_context.agent = self._find_agent_to_run(session, root_agent)
|
@@ -290,7 +284,6 @@ async def _append_new_message_to_session(
|
290 | 284 | new_message: types.Content,
|
291 | 285 | invocation_context: InvocationContext,
|
292 | 286 | save_input_blobs_as_artifacts: bool = False,
|
293 |
| - state_delta: Optional[dict[str, Any]] = None, |
294 | 287 | ):
|
295 | 288 | """Appends a new message to the session.
|
296 | 289 |
|
@@ -322,19 +315,11 @@ async def _append_new_message_to_session(
|
322 | 315 | text=f'Uploaded file: {file_name}. It is saved into artifacts'
|
323 | 316 | )
|
324 | 317 | # Appends only. We do not yield the event because it's not from the model.
|
325 |
| - if state_delta: |
326 |
| - event = Event( |
327 |
| - invocation_id=invocation_context.invocation_id, |
328 |
| - author='user', |
329 |
| - actions=EventActions(state_delta=state_delta), |
330 |
| - content=new_message, |
331 |
| - ) |
332 |
| - else: |
333 |
| - event = Event( |
334 |
| - invocation_id=invocation_context.invocation_id, |
335 |
| - author='user', |
336 |
| - content=new_message, |
337 |
| - ) |
| 318 | + event = Event( |
| 319 | + invocation_id=invocation_context.invocation_id, |
| 320 | + author='user', |
| 321 | + content=new_message, |
| 322 | + ) |
338 | 323 | await self.session_service.append_event(session=session, event=event)
|
339 | 324 |
|
340 | 325 | async def run_live(
|
|
0 commit comments