Summary
src/google/adk/examples/example_util.py:49 has a TODO from the original author:
# TODO(yaojie): Add unit tests for this function.
def convert_examples_to_text(examples: list[Example], model: Optional[str]) -> str:
This function handles few-shot example formatting for system instructions and currently has zero test coverage. The related build_example_si and _get_latest_message_from_user helpers are also untested.
Proposed test cases
- Basic text-only examples
- Function call + function response formatting
- Mixed content (text + function call)
- Empty examples list
- Gemini 2 vs non-Gemini 2 format branch (
_FUNCTION_PREFIX vs _FUNCTION_CALL_PREFIX)
build_example_si with list input vs BaseExampleProvider input
_get_latest_message_from_user with empty session, non-user author, function responses
Happy to submit a PR for this.