8000 Share data between agents in liveAPI · Issue #1252 · google/adk-python · GitHub
[go: up one dir, main page]

Skip to content
Share data between agents in liveAPI #1252
Open
@pretbc

Description

@pretbc

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Is your feature request related to a problem? Please describe.
I would like to pass to other sub agents AUDIO which was part of live_queue from liveAPi root agent

Describe the solution you'd like
root agent has 2 sub agents which should analyze audio captured by liveAPI and then root agent should be able to continue with knowledge from sub agents

Describe alternatives you've considered

Make sub agents to be ToolAgents of root agent

artifact_service = InMemoryArtifactService()
    runner = Runner(
    agent=root_agent,
    app_name="affect_pipeline",
    session_service=InMemorySessionService(),
    artifact_service=artifact_service,
)

# inside root_agent
async def _on_audio(ctx, audio_bytes: bytes):

    part = types.Part.from_bytes(audio_bytes, "audio/wav")
    fname = f"user_{ctx.session.id}.wav"

    ctx.save_artifact(fname, part)      # make it visible to all agents
    ctx.session.state["latest_audio"] = fname

    # now call the children — they can load the clip themselves
    await ctx.invoke_tool("affect_alignment_tool", audio_file=fname)
    await ctx.invoke_tool("engagement_tool", audio_file=fname)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0