mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-14 01:41:25 -06:00
Merge branch 'main' into #247-OpenAPIToolSet-Considering-Required-parameters
This commit is contained in:
commit
42f87a9c94
@ -15,9 +15,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
from typing import AsyncGenerator
|
||||
from typing import Generator
|
||||
from typing import Optional
|
||||
from typing import AsyncGenerator, Generator, Optional
|
||||
|
||||
from google.genai import types
|
||||
from typing_extensions import override
|
||||
@ -202,8 +200,14 @@ def _get_contents(
|
||||
# Parse the events, leaving the contents and the function calls and
|
||||
# responses from the current agent.
|
||||
for event in events:
|
||||
if not event.content or not event.content.role:
|
||||
# Skip events without content, or generated neither by user nor by model.
|
||||
if (
|
||||
not event.content
|
||||
or not event.content.role
|
||||
or not event.content.parts
|
||||
or event.content.parts[0].text == ''
|
||||
):
|
||||
# Skip events without content, or generated neither by user nor by model
|
||||
# or has empty text.
|
||||
# E.g. events purely for mutating session states.
|
||||
continue
|
||||
if not _is_event_belongs_to_branch(current_branch, event):
|
||||
|
Loading…
Reference in New Issue
Block a user