mirror of https://github.com/kortix-ai/suna.git
Refactor KortixMCP to KortixMCPTools and update imports
- Renamed `KortixMCP` to `KortixMCPTools` across the SDK for consistency. - Updated import statements in relevant files to reflect the new class name. - Modified the `create` method in `KortixAgent` to use `mcp_tools` instead of `tools`, enhancing clarity in tool management.
This commit is contained in:
parent
bef187319f
commit
4da30a7b9a
|
@ -7,6 +7,6 @@ A Python SDK for creating and managing AI agents with thread execution capabilit
|
|||
__version__ = "0.1.0"
|
||||
|
||||
from .kortix.kortix import Kortix
|
||||
from .kortix.tools import AgentPressTools, KortixMCP
|
||||
from .kortix.tools import AgentPressTools, KortixMCPTools
|
||||
|
||||
__all__ = ["Kortix", "AgentPressTools", "KortixMCP"]
|
||||
__all__ = ["Kortix", "AgentPressTools", "KortixMCPTools"]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from .api.threads import AgentStartRequest
|
||||
from .thread import Thread, AgentRun
|
||||
from .tools import AgentPressTools, KortixMCP, KortixTools
|
||||
from .tools import AgentPressTools, KortixMCPTools, KortixTools
|
||||
from .api.agents import (
|
||||
AgentCreateRequest,
|
||||
AgentPress_ToolConfig,
|
||||
|
@ -37,16 +37,16 @@ class KortixAgent:
|
|||
self._client = client
|
||||
|
||||
async def create(
|
||||
self, name: str, system_prompt: str, model: str, tools: list[KortixTools] = []
|
||||
self, name: str, system_prompt: str, model: str, mcp_tools: list[KortixTools] = []
|
||||
) -> Agent:
|
||||
agentpress_tools = {}
|
||||
custom_mcps: list[CustomMCP] = []
|
||||
for tool in tools:
|
||||
for tool in mcp_tools:
|
||||
if isinstance(tool, AgentPressTools):
|
||||
agentpress_tools[tool] = AgentPress_ToolConfig(
|
||||
enabled=True, description=tool.get_description()
|
||||
)
|
||||
elif isinstance(tool, KortixMCP):
|
||||
elif isinstance(tool, KortixMCPTools):
|
||||
mcp = tool
|
||||
custom_mcps.append(
|
||||
CustomMCP(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from .api import agents, threads
|
||||
from .agent import KortixAgent
|
||||
from .thread import KortixThread
|
||||
from .tools import AgentPressTools, KortixMCP
|
||||
from .tools import AgentPressTools, KortixMCPTools
|
||||
|
||||
|
||||
class Kortix:
|
||||
|
|
|
@ -3,7 +3,7 @@ from enum import Enum
|
|||
from fastmcp import Client as FastMCPClient
|
||||
|
||||
|
||||
class KortixMCP:
|
||||
class KortixMCPTools:
|
||||
def __init__(
|
||||
self, endpoint: str, name: str, allowed_tools: list[str] | None = None
|
||||
):
|
||||
|
@ -60,4 +60,4 @@ class AgentPressTools(str, Enum):
|
|||
return desc
|
||||
|
||||
|
||||
KortixTools = Union[AgentPressTools, KortixMCP]
|
||||
KortixTools = Union[AgentPressTools, KortixMCPTools]
|
||||
|
|
Loading…
Reference in New Issue