Skip to content

Commit 21a80f5

Browse files
committed
fix(agent): support instruction provider in agent module
1 parent 3e8e505 commit 21a80f5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

veadk/agent.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
from __future__ import annotations
1616

17-
from typing import Optional
17+
from typing import Optional, Union
1818

1919
from google.adk.agents import LlmAgent, RunConfig
2020
from google.adk.agents.base_agent import BaseAgent
21-
from google.adk.agents.llm_agent import ToolUnion
21+
from google.adk.agents.llm_agent import InstructionProvider, ToolUnion
2222
from google.adk.agents.run_config import StreamingMode
2323
from google.adk.models.lite_llm import LiteLlm
2424
from google.adk.runners import Runner
@@ -57,8 +57,8 @@ class Agent(LlmAgent):
5757
description: str = DEFAULT_DESCRIPTION
5858
"""The description of the agent. This will be helpful in A2A scenario."""
5959

60-
instruction: str = DEFAULT_INSTRUCTION
61-
"""The instruction for the agent, such as principles of function calling."""
60+
instruction: Union[str, InstructionProvider] = DEFAULT_INSTRUCTION
61+
"""The instruction for the agent."""
6262

6363
model_name: str = Field(default_factory=lambda: settings.model.name)
6464
"""The name of the model for agent running."""
@@ -93,9 +93,6 @@ class Agent(LlmAgent):
9393
tracers: list[BaseTracer] = []
9494
"""The tracers provided to agent."""
9595

96-
serve_url: str = ""
97-
"""The url of agent serving host. Show in agent card."""
98-
9996
def model_post_init(self, __context: Any) -> None:
10097
super().model_post_init(None) # for sub_agents init
10198

0 commit comments

Comments
 (0)