MCPcopy Create free account
hub / github.com/InternScience/InternAgent / __init__

Method __init__

mcp_demo.py:97–110  ·  view source on GitHub ↗
(self, model: BaseModel, config: Dict[str, Any])

Source from the content-addressed store, hash-verified

95 """Assistant agent with support for both function-based and MCP tools"""
96
97 def __init__(self, model: BaseModel, config: Dict[str, Any]):
98 super().__init__(model, config)
99
100 # Get tool registry
101 self.tool_registry = get_registry()
102
103 # Get allowed tools list from config (whitelist mode)
104 self.allowed_tools = config.get("allowed_tools", None)
105
106 logger.info(f"MyAgent '{self.name}' initialized")
107 if self.allowed_tools:
108 logger.info(f"Allowed tools: {self.allowed_tools}")
109 else:
110 logger.info(f"All tools available")
111
112 async def _execute_tool(self, function_name: str, function_args: Dict[str, Any]) -> Any:
113 """Execute tool function (routes to either function-based or MCP tool)"""

Callers

nothing calls this directly

Calls 2

get_registryFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected