mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-21 07:26:50 +00:00
feat: implement tools loading api
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class MCPServerMetadataRequest(BaseModel):
|
||||
"""Request model for MCP server metadata."""
|
||||
|
||||
type: str = Field(
|
||||
..., description="The type of MCP server connection (stdio or sse)"
|
||||
)
|
||||
command: Optional[str] = Field(
|
||||
None, description="The command to execute (for stdio type)"
|
||||
)
|
||||
args: Optional[List[str]] = Field(
|
||||
None, description="Command arguments (for stdio type)"
|
||||
)
|
||||
url: Optional[str] = Field(
|
||||
None, description="The URL of the SSE server (for sse type)"
|
||||
)
|
||||
env: Optional[Dict[str, str]] = Field(None, description="Environment variables")
|
||||
|
||||
|
||||
class MCPServerMetadataResponse(BaseModel):
|
||||
"""Response model for MCP server metadata."""
|
||||
|
||||
type: str = Field(
|
||||
..., description="The type of MCP server connection (stdio or sse)"
|
||||
)
|
||||
command: Optional[str] = Field(
|
||||
None, description="The command to execute (for stdio type)"
|
||||
)
|
||||
args: Optional[List[str]] = Field(
|
||||
None, description="Command arguments (for stdio type)"
|
||||
)
|
||||
url: Optional[str] = Field(
|
||||
None, description="The URL of the SSE server (for sse type)"
|
||||
)
|
||||
env: Optional[Dict[str, str]] = Field(None, description="Environment variables")
|
||||
tools: List = Field(
|
||||
default_factory=list, description="Available tools from the MCP server"
|
||||
)
|
||||
Reference in New Issue
Block a user