Skip to content

v0.4.0

Choose a tag to compare

@manojlds manojlds released this 28 Apr 11:18
· 6 commits to main since this release

Changed (breaking)

  • All runtime read methods on SkillSource and SkillsRegistry are now coroutines. I/O-bound sources (databases, remote registries, object storage) can now perform real non-blocking I/O end-to-end, instead of forcing every consumer to wrap a synchronous source with asyncio.to_thread at the call site.
    • SkillSource.list_metadata, load_skill, iter_names, has_skill, get_metadata, refresh, clear_cache, list_files, and read_file are now async def.
    • SkillsRegistry.list_metadata, load_skill, read_reference, list_files, read_file, validate_all, refresh, clear_cache, to_prompt_xml, to_prompt_text, get_skills_prompt, iter_names, has_skill, and get_metadata are now async def.
    • SkillsAgent.get_tools, get_instruction, and build are now async def.
    • The with_skills, create_skills_agent, and inject_skills_prompt helpers in adk_skills_agent.helpers are now async def.
    • The callables produced by create_use_skill_tool and create_read_reference_tool are now async def. ADK already supports async tool callables, so no agent-side change is required.
  • create_use_skill_tool no longer takes include_skills_listing. Callers that want the available-skills listing in the tool description should pass the pre-rendered XML via the new available_skills_xml argument: xml = await registry.to_prompt_xml(); create_use_skill_tool(registry, available_skills_xml=xml). This avoids duplicating the async listing step inside the tool factory.
  • SkillsRegistry.__len__ and SkillsRegistry.__contains__ were removed because the underlying lookups are now async (__len__ and __contains__ cannot be coroutines). Replace len(registry) with len(await registry.list_metadata()) and name in registry with await registry.has_skill(name).
  • SkillSource.iter_names now returns a list[str] (rather than yielding an iterator) so it can be implemented as a single coroutine.

Added

  • Module-level _format_metadata_xml / _format_metadata_text helpers in adk_skills_agent.registry so prompt-shape utilities can be reused without re-running the metadata gather.
  • pytest-asyncio>=0.23 dev dependency, with asyncio_mode = "auto" in pyproject.toml so async tests do not need explicit decorators.

Migration notes

  • with_skills(...), create_skills_agent(...), and SkillsAgent.build(...) are now coroutines. Wherever you build agents at module top-level, switch the call site to asyncio.run(create_skills_agent(...)) (or await ... from inside another async context).
  • ADK's before_agent_callback and tool callables already support async def, so wiring the new async tools into an ADK agent does not require any additional adapter — return them directly from your tool list.
  • Custom SkillSource implementations must change their method signatures from def to async def for the runtime methods listed above. Sources whose underlying I/O is synchronous (filesystem, in-memory, sqlite3) can wrap blocking calls with asyncio.to_thread(...); sources backed by asyncio-aware drivers (asyncpg, aiomysql, httpx.AsyncClient, …) can call into them directly.

Full Changelog: v0.3.0...v0.4.0