mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-16 04:02:55 -06:00
No public description
PiperOrigin-RevId: 749399264
This commit is contained in:
parent
6742ab9236
commit
32dc145ace
@ -17,10 +17,10 @@ import copy
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any, Optional
|
||||||
from typing import Optional
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from google.genai import types
|
||||||
from sqlalchemy import Boolean
|
from sqlalchemy import Boolean
|
||||||
from sqlalchemy import delete
|
from sqlalchemy import delete
|
||||||
from sqlalchemy import Dialect
|
from sqlalchemy import Dialect
|
||||||
@ -136,7 +136,7 @@ class StorageEvent(Base):
|
|||||||
author: Mapped[str] = mapped_column(String)
|
author: Mapped[str] = mapped_column(String)
|
||||||
branch: Mapped[str] = mapped_column(String, nullable=True)
|
branch: Mapped[str] = mapped_column(String, nullable=True)
|
||||||
timestamp: Mapped[DateTime] = mapped_column(DateTime(), default=func.now())
|
timestamp: Mapped[DateTime] = mapped_column(DateTime(), default=func.now())
|
||||||
content: Mapped[dict[str, Any]] = mapped_column(DynamicJSON)
|
content: Mapped[dict[str, Any]] = mapped_column(DynamicJSON, nullable=True)
|
||||||
actions: Mapped[MutableDict[str, Any]] = mapped_column(PickleType)
|
actions: Mapped[MutableDict[str, Any]] = mapped_column(PickleType)
|
||||||
|
|
||||||
long_running_tool_ids_json: Mapped[Optional[str]] = mapped_column(
|
long_running_tool_ids_json: Mapped[Optional[str]] = mapped_column(
|
||||||
@ -576,8 +576,12 @@ def _merge_state(app_state, user_state, session_state):
|
|||||||
return merged_state
|
return merged_state
|
||||||
|
|
||||||
|
|
||||||
def _decode_content(content: dict[str, Any]) -> dict[str, Any]:
|
def _decode_content(
|
||||||
|
content: Optional[dict[str, Any]],
|
||||||
|
) -> Optional[types.Content]:
|
||||||
|
if not content:
|
||||||
|
return None
|
||||||
for p in content["parts"]:
|
for p in content["parts"]:
|
||||||
if "inline_data" in p:
|
if "inline_data" in p:
|
||||||
p["inline_data"]["data"] = base64.b64decode(p["inline_data"]["data"][0])
|
p["inline_data"]["data"] = base64.b64decode(p["inline_data"]["data"][0])
|
||||||
return content
|
return types.Content.model_validate(content)
|
||||||
|
Loading…
Reference in New Issue
Block a user