Skip to content

Commit a1ab655

Browse files
authored
Merge branch 'main' into fix-typos
2 parents b6e728a + 23f0383 commit a1ab655

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/google/adk/flows/llm_flows/functions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,7 @@ async def _process_function_live_helper(
310310
function_response = {
311311
'status': f'No active streaming function named {function_name} found'
312312
}
313-
elif inspect.isasyncgenfunction(tool.func):
314-
print('is async')
315-
313+
elif hasattr(tool, "func") and inspect.isasyncgenfunction(tool.func):
316314
# for streaming tool use case
317315
# we require the function to be a async generator function
318316
async def run_tool_and_update_queue(tool, function_args, tool_context):

src/google/adk/planners/built_in_planner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def apply_thinking_config(self, llm_request: LlmRequest) -> None:
5656
llm_request: The LLM request to apply the thinking config to.
5757
"""
5858
if self.thinking_config:
59+
llm_request.config = llm_request.config or types.GenerateContentConfig()
5960
llm_request.config.thinking_config = self.thinking_config
6061

6162
@override

src/google/adk/sessions/database_session_service.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
from datetime import datetime
1818
import json
1919
import logging
20-
from typing import Any
21-
from typing import Optional
20+
from typing import Any, Optional
2221
import uuid
2322

23+
from google.genai import types
2424
from sqlalchemy import Boolean
2525
from sqlalchemy import delete
2626
from sqlalchemy import Dialect
@@ -136,7 +136,7 @@ class StorageEvent(Base):
136136
author: Mapped[str] = mapped_column(String)
137137
branch: Mapped[str] = mapped_column(String, nullable=True)
138138
timestamp: Mapped[DateTime] = mapped_column(DateTime(), default=func.now())
139-
content: Mapped[dict[str, Any]] = mapped_column(DynamicJSON)
139+
content: Mapped[dict[str, Any]] = mapped_column(DynamicJSON, nullable=True)
140140
actions: Mapped[MutableDict[str, Any]] = mapped_column(PickleType)
141141

142142
long_running_tool_ids_json: Mapped[Optional[str]] = mapped_column(
@@ -576,8 +576,12 @@ def _merge_state(app_state, user_state, session_state):
576576
return merged_state
577577

578578

579-
def _decode_content(content: dict[str, Any]) -> dict[str, Any]:
579+
def _decode_content(
580+
content: Optional[dict[str, Any]],
581+
) -> Optional[types.Content]:
582+
if not content:
583+
return None
580584
for p in content["parts"]:
581585
if "inline_data" in p:
582586
p["inline_data"]["data"] = base64.b64decode(p["inline_data"]["data"][0])
583-
return content
587+
return types.Content.model_validate(content)

0 commit comments

Comments
 (0)