mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix order of imports
This commit is contained in:
parent
70e67c872b
commit
dde78a8ae9
3 changed files with 9 additions and 14 deletions
|
@ -8,17 +8,11 @@ This is a Proxy
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
from mcp import ClientSession
|
||||||
from mcp import ClientSession
|
from mcp.client.sse import sse_client
|
||||||
from mcp.client.sse import sse_client
|
from mcp.types import Tool as MCPTool
|
||||||
from mcp.types import Tool as MCPTool
|
|
||||||
else:
|
|
||||||
# Provide fallback types for runtime incase `mcp` is not installed
|
|
||||||
ClientSession = None
|
|
||||||
MCPTool = object
|
|
||||||
sse_client = None
|
|
||||||
|
|
||||||
from litellm._logging import verbose_logger
|
from litellm._logging import verbose_logger
|
||||||
from litellm.types.mcp_server.mcp_server_manager import MCPInfo, MCPSSEServer
|
from litellm.types.mcp_server.mcp_server_manager import MCPInfo, MCPSSEServer
|
||||||
|
|
|
@ -265,7 +265,7 @@ if MCP_AVAILABLE:
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
verbose_logger.error(f"Error getting tools from {server.name}: {e}")
|
verbose_logger.exception(f"Error getting tools from {server.name}: {e}")
|
||||||
continue
|
continue
|
||||||
return list_tools_result
|
return list_tools_result
|
||||||
|
|
||||||
|
|
|
@ -127,9 +127,6 @@ from litellm.litellm_core_utils.core_helpers import (
|
||||||
from litellm.litellm_core_utils.credential_accessor import CredentialAccessor
|
from litellm.litellm_core_utils.credential_accessor import CredentialAccessor
|
||||||
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
|
from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj
|
||||||
from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler
|
from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler
|
||||||
from litellm.proxy._experimental.mcp_server.mcp_server_manager import (
|
|
||||||
global_mcp_server_manager,
|
|
||||||
)
|
|
||||||
from litellm.proxy._experimental.mcp_server.server import router as mcp_router
|
from litellm.proxy._experimental.mcp_server.server import router as mcp_router
|
||||||
from litellm.proxy._experimental.mcp_server.tool_registry import (
|
from litellm.proxy._experimental.mcp_server.tool_registry import (
|
||||||
global_mcp_tool_registry,
|
global_mcp_tool_registry,
|
||||||
|
@ -1966,6 +1963,10 @@ class ProxyConfig:
|
||||||
|
|
||||||
mcp_servers_config = config.get("mcp_servers", None)
|
mcp_servers_config = config.get("mcp_servers", None)
|
||||||
if mcp_servers_config:
|
if mcp_servers_config:
|
||||||
|
from litellm.proxy._experimental.mcp_server.mcp_server_manager import (
|
||||||
|
global_mcp_server_manager,
|
||||||
|
)
|
||||||
|
|
||||||
global_mcp_server_manager.load_servers_from_config(mcp_servers_config)
|
global_mcp_server_manager.load_servers_from_config(mcp_servers_config)
|
||||||
|
|
||||||
## CREDENTIALS
|
## CREDENTIALS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue