MCPcopy Create free account
hub / github.com/google/adk-python / _part_to_text

Function _part_to_text

src/google/adk/tools/agent_tool.py:46–54  ·  view source on GitHub ↗

Returns user-visible text from a Part, including code execution output.

(part: types.Part)

Source from the content-addressed store, hash-verified

44
45
46def _part_to_text(part: types.Part) -> str:
47 """Returns user-visible text from a Part, including code execution output."""
48 if part.text:
49 return part.text
50 if part.code_execution_result and part.code_execution_result.output:
51 return part.code_execution_result.output.rstrip('\n')
52 if part.executable_code and part.executable_code.code:
53 return part.executable_code.code
54 return ''
55
56
57def _get_input_schema(agent: BaseAgent) -> Optional[type[BaseModel]]:

Callers 1

run_asyncMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected