1212# limitations under the License.
1313# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
1414
15- from typing import Dict , List , Optional
15+ from typing import Dict , Optional
1616
17- from camel . toolkits import BaseToolkit , FunctionTool , MCPToolkit
17+ from . mcp_toolkit import MCPToolkit
1818
1919
20- class OrigeneToolkit (BaseToolkit ):
20+ class OrigeneToolkit (MCPToolkit ):
2121 r"""OrigeneToolkit provides an interface for interacting with
2222 Origene MCP server.
2323
@@ -43,55 +43,14 @@ def __init__(
4343
4444 Args:
4545 config_dict (Optional[Dict]): Configuration dictionary for MCP
46- servers. If None, uses default configuration for chembl_mcp .
46+ servers. If None, raises ValueError as configuration is required .
4747 (default: :obj:`None`)
4848 timeout (Optional[float]): Connection timeout in seconds.
4949 (default: :obj:`None`)
5050 """
51- super ().__init__ (timeout = timeout )
52-
53- # Use default configuration if none provided
51+ # Validate that config_dict is provided
5452 if config_dict is None :
5553 raise ValueError ("config_dict must be provided" )
5654
57- self ._mcp_toolkit = MCPToolkit (
58- config_dict = config_dict ,
59- timeout = timeout ,
60- )
61-
62- async def connect (self ):
63- r"""Explicitly connect to the Origene MCP server."""
64- await self ._mcp_toolkit .connect ()
65-
66- async def disconnect (self ):
67- r"""Explicitly disconnect from the Origene MCP server."""
68- await self ._mcp_toolkit .disconnect ()
69-
70- async def __aenter__ (self ) -> "OrigeneToolkit" :
71- r"""Async context manager entry point.
72-
73- Returns:
74- OrigeneToolkit: The connected toolkit instance.
75-
76- Example:
77- async with OrigeneToolkit(config_dict=config) as toolkit:
78- tools = toolkit.get_tools()
79- """
80- await self .connect ()
81- return self
82-
83- async def __aexit__ (self , exc_type , exc_val , exc_tb ) -> None :
84- r"""Async context manager exit point.
85-
86- Automatically disconnects from the Origene MCP server.
87- """
88- await self .disconnect ()
89- return None
90-
91- def get_tools (self ) -> List [FunctionTool ]:
92- r"""Returns a list of tools provided by the Origene MCP server.
93-
94- Returns:
95- List[FunctionTool]: List of available tools.
96- """
97- return self ._mcp_toolkit .get_tools ()
55+ # Initialize parent MCPToolkit with provided configuration
56+ super ().__init__ (config_dict = config_dict , timeout = timeout )
0 commit comments