Skip to content

input_schema to include Field description to calling agent #5459

@marcopellegrino-devoteam

Description

I find it frustrating when the parameters of an agent input_schema needs to be filled in specific way and such rules need to be incorporated in the calling agent instruction. Instead, it feels more logical to incorporate such rules in the input_schema by reusing the Pydantic description field. This is especially crucial when the sub-agent is not always available to the caller (imagine a caller agent that has different sub-agents depending on the user properties). In that case, I currently need to have these rules in the caller agent instruction even if the latter cannot even always use this sub-agent.

Let's imagine this input_schema:

class ExampleInput(BaseModel):
    """Input schema for a RAG.

    The coordinator provides this when invoking the RAG agent, including the user's language
    """

    question: str = Field(
        ...,
        description=(
            "A self-contained search query optimized for vector retrieval against internal knowledge bases. Only use key words"
        ),
    )
    user_language: str = Field(
        ...,
        description=(
            "The language of the very last message from the user. Use the full English name, e.g., English, Italian, German,..."
        ),
    )

Currently, when an input schema is passed to a called agent, only the field types are passed, but not their descriptions. E.g. :
sub_agent1: {'question': {'type': <Type.STRING: 'STRING'>}, 'language': {'type': <Type.STRING: 'STRING'>}} -> {'type': <Type.STRING: 'STRING'>}

While I wished it was:
sub_agent1: {'question': {'type': <Type.STRING: 'STRING'>, 'description': 'A self-contained search query optimized for vector retrieval against internal knowledge bases. Only use key words'}, 'language': {'type': <Type.STRING: 'STRING'>, 'description': 'The language of the very last message from the user. Use the full English name, e.g., English, Italian, German,...'}} -> {'type': <Type.STRING: 'STRING'>}

ADK 1.30.0
Python 3.11

Metadata

Metadata

Labels

core[Component] This issue is related to the core interface and implementationneeds review[Status] The PR/issue is awaiting review from the maintainer

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions