Commit: ccf7ac7

Date: July 25, 2025 at 5:54 AM

This change simplifies the Agent interface to be

```

type Agent interface {

Spec() *AgentSpec

Run(context.Context, InvocationContext) iter.Seq2[Event, error]

// TODO: RunLive

}

```

And consolidate common properties of ADK Agents into `AgentSpec`.

In the offline discussion, AgentSpec was suggested as a type in a sub package and used by LLMAgent and other custom agents. However, circular dependency makes it challenging and harder to maintain.

I hope it's not too bad to have AgentSpec along with the Agent.

The AgentSpec needs some initialization so it can be associated with the Agent that is containing the AgentSpec.

This is done by `Init`.

For example, if a logic in the AgentSpec needs to call the logic implemented in the containing Agent, it needs to know which Agent implementation it should use. See the usage of `AgentSpec.self` in this draft.

Instead of making the interface include methods like `Name`, `Parent`, `SubAgents`, `Description`, ...

I propose to have just `Spec()` that returns the Agent's AgentSpec. That will help us avoid expanding the interface.

Adding methods or fields to AgentSpec won't break custom agents in the future.

For LLMAgent, this PR experiments with the variadic Option

that can configure both LLMAgent's AgentSpec and LLMAgent's own properties.