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:
mykonos-ibiza 2025-08-01 01:31:05 +05:30
parent bef187319f
commit 4da30a7b9a
4 changed files with 9 additions and 9 deletions

View File

@ -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"]

View File

@ -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(

View File

@ -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:

View File

@ -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]