MCPcopy Index your code
hub / github.com/google/adk-python / simplify_content

Function simplify_content

tests/unittests/testing_utils.py:166–179  ·  view source on GitHub ↗
(
    content: types.Content,
)

Source from the content-addressed store, hash-verified

164# - If there are multiple parts, return parts
165# - remove function_call_id if it exists
166def simplify_content(
167 content: types.Content,
168) -> Union[str, types.Part, list[types.Part]]:
169 for part in content.parts:
170 if part.function_call and part.function_call.id:
171 part.function_call.id = None
172 if part.function_response and part.function_response.id:
173 part.function_response.id = None
174 if len(content.parts) == 1:
175 if content.parts[0].text:
176 return content.parts[0].text.strip()
177 else:
178 return content.parts[0]
179 return content.parts
180
181
182def get_user_content(message: types.ContentUnion) -> types.Content:

Callers 3

simplify_eventsFunction · 0.70
simplify_contentsFunction · 0.70

Calls 1

stripMethod · 0.80

Tested by

no test coverage detected