File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222from fastapi .staticfiles import StaticFiles
2323from google .adk .agents .run_config import RunConfig , StreamingMode
2424from google .genai import types
25+ from pydantic import BaseModel
2526
2627from veadk .cli .studio .models import (
2728 GetAgentResponse ,
@@ -151,6 +152,14 @@ async def runner_run_sse(user_text: str):
151152 yield f"data: { json .dumps (TOOL_INPUT_AVAILABLE )} \n \n "
152153
153154 for function_response in event .get_function_responses ():
155+ # for load_memory and load_knowledgebase tools, the output is based BaseModel
156+ # we have to convert it
157+ for key , value in function_response .response .items ():
158+ if isinstance (value , BaseModel ):
159+ function_response .response [key ] = value .model_dump (
160+ exclude_none = False
161+ )
162+
154163 TOOL_OUTPUT_AVAILABLE = {
155164 "type" : "tool-output-available" ,
156165 "toolCallId" : function_response .id ,
You can’t perform that action at this time.
0 commit comments