mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-14 01:41:25 -06:00
chore: Refines mcp_agent instruction to include the allowed folder in the instruction.
PiperOrigin-RevId: 760057162
This commit is contained in:
parent
9324801b75
commit
e278ca9541
@ -19,10 +19,16 @@ from google.adk.agents.llm_agent import LlmAgent
|
|||||||
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
|
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
|
||||||
from google.adk.tools.mcp_tool.mcp_toolset import StdioServerParameters
|
from google.adk.tools.mcp_tool.mcp_toolset import StdioServerParameters
|
||||||
|
|
||||||
|
_allowed_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
root_agent = LlmAgent(
|
root_agent = LlmAgent(
|
||||||
model='gemini-2.0-flash',
|
model='gemini-2.0-flash',
|
||||||
name='enterprise_assistant',
|
name='enterprise_assistant',
|
||||||
instruction='Help user accessing their file systems',
|
instruction=f"""\
|
||||||
|
Help user accessing their file systems.
|
||||||
|
|
||||||
|
Allowed directory: {_allowed_path}
|
||||||
|
""",
|
||||||
tools=[
|
tools=[
|
||||||
MCPToolset(
|
MCPToolset(
|
||||||
connection_params=StdioServerParameters(
|
connection_params=StdioServerParameters(
|
||||||
@ -30,7 +36,7 @@ root_agent = LlmAgent(
|
|||||||
args=[
|
args=[
|
||||||
'-y', # Arguments for the command
|
'-y', # Arguments for the command
|
||||||
'@modelcontextprotocol/server-filesystem',
|
'@modelcontextprotocol/server-filesystem',
|
||||||
os.path.dirname(os.path.abspath(__file__)),
|
_allowed_path,
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
# don't want agent to do write operation
|
# don't want agent to do write operation
|
||||||
|
Loading…
Reference in New Issue
Block a user