udpate
This commit is contained in:
@@ -42,9 +42,13 @@ class CreateTemplateRequest(BaseModel):
|
||||
display_name: str
|
||||
description: Optional[str] = None
|
||||
agent_type: str = Field(..., description="platform or custom")
|
||||
agent_framework: str = Field(default="langchain", description="langchain, mcp, or a2a")
|
||||
image: str
|
||||
port: Optional[int] = None
|
||||
env_requirements: Optional[Dict] = Field(default_factory=dict)
|
||||
tools_config: Optional[Dict] = Field(default_factory=dict, description="Tools configuration JSON")
|
||||
default_model_provider: Optional[str] = Field(None, description="Default model provider")
|
||||
default_model_name: Optional[str] = Field(None, description="Default model name")
|
||||
cpu_request: Optional[str] = None
|
||||
cpu_limit: Optional[str] = None
|
||||
memory_request: Optional[str] = None
|
||||
@@ -103,7 +107,19 @@ class CreatePlatformAgentRequest(BaseModel):
|
||||
owner_id: str
|
||||
channel_id: Optional[str] = None
|
||||
tenant_id: Optional[str] = None
|
||||
namespace: Optional[str] = Field(default="ai-agents", description="Kubernetes namespace")
|
||||
query_params: Optional[Dict] = Field(default_factory=dict)
|
||||
# NEW: Framework-specific configurations
|
||||
agent_framework: Optional[str] = Field(None, description="Override template framework")
|
||||
tools_config: Optional[Dict] = Field(default_factory=dict, description="Tools configuration")
|
||||
tool_endpoint: Optional[str] = Field(None, description="External tool endpoint")
|
||||
tool_api_key: Optional[str] = Field(None, description="Tool API key")
|
||||
model_provider: Optional[str] = Field(None, description="Model provider")
|
||||
model_name: Optional[str] = Field(None, description="Model name")
|
||||
model_endpoint: Optional[str] = Field(None, description="Model endpoint")
|
||||
model_api_key: Optional[str] = Field(None, description="Model API key")
|
||||
storage_connection_string: Optional[str] = Field(None, description="Storage connection string")
|
||||
storage_account_name: Optional[str] = Field(None, description="Storage account name")
|
||||
|
||||
|
||||
# Custom Agent Models
|
||||
@@ -121,7 +137,20 @@ class CreateCustomAgentRequest(BaseModel):
|
||||
owner_id: str
|
||||
channel_id: Optional[str] = None
|
||||
tenant_id: Optional[str] = None
|
||||
namespace: Optional[str] = Field(default="ai-agents", description="Kubernetes namespace")
|
||||
environment_vars: Dict[str, str]
|
||||
# NEW: Framework-specific configurations
|
||||
agent_framework: Optional[str] = Field(None, description="Override template framework")
|
||||
tools_config: Optional[Dict] = Field(default_factory=dict, description="Tools configuration")
|
||||
tool_endpoint: Optional[str] = Field(None, description="External tool endpoint")
|
||||
tool_api_key: Optional[str] = Field(None, description="Tool API key")
|
||||
model_provider: Optional[str] = Field(None, description="Model provider")
|
||||
model_name: Optional[str] = Field(None, description="Model name")
|
||||
model_endpoint: Optional[str] = Field(None, description="Model endpoint")
|
||||
model_api_key: Optional[str] = Field(None, description="Model API key")
|
||||
storage_connection_string: Optional[str] = Field(None, description="Storage connection string")
|
||||
storage_account_name: Optional[str] = Field(None, description="Storage account name")
|
||||
# Resource configuration
|
||||
cpu_request: Optional[str] = None
|
||||
cpu_limit: Optional[str] = None
|
||||
memory_request: Optional[str] = None
|
||||
@@ -264,7 +293,7 @@ async def create_agent(request: CreateAgentRequest):
|
||||
logger.info(f"收到创建Agent请求: {request.name}, 模板: {request.template}")
|
||||
|
||||
# 验证模板类型
|
||||
valid_templates = ["echo_agent", "chat_agent", "code_agent", "search_agent", "mysql_agent", "postgresql_agent", "jina_search_agent"]
|
||||
valid_templates = ["echo_agent", "chat_agent", "code_agent", "search_agent", "mysql_agent", "postgresql_agent", "jina_search_agent", "azure_blob_agent", "azure_blob_agent_mcp", "azure_blob_agent_a2a"]
|
||||
if request.template not in valid_templates:
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
@@ -429,7 +458,7 @@ async def list_templates():
|
||||
Returns:
|
||||
模板列表及其配置信息
|
||||
"""
|
||||
valid_templates = ["echo_agent", "chat_agent", "code_agent", "search_agent", "mysql_agent", "postgresql_agent", "jina_search_agent"]
|
||||
valid_templates = ["echo_agent", "chat_agent", "code_agent", "search_agent", "mysql_agent", "postgresql_agent", "jina_search_agent", "azure_blob_agent"]
|
||||
|
||||
templates_info = []
|
||||
for template in valid_templates:
|
||||
@@ -451,7 +480,7 @@ async def list_platform_templates():
|
||||
平台提供的Agent模板列表
|
||||
"""
|
||||
# 平台 Agent 是预定义的标准模板
|
||||
platform_templates = ["echo_agent", "chat_agent", "code_agent", "search_agent", "jina_search_agent"]
|
||||
platform_templates = ["echo_agent", "chat_agent", "code_agent", "search_agent", "jina_search_agent", "azure_blob_agent"]
|
||||
|
||||
templates_info = []
|
||||
for template in platform_templates:
|
||||
@@ -501,7 +530,7 @@ async def get_template_info(template_name: str):
|
||||
Returns:
|
||||
模板详细信息(端口、所需环境变量等)
|
||||
"""
|
||||
valid_templates = ["echo_agent", "chat_agent", "code_agent", "search_agent", "mysql_agent", "postgresql_agent", "jina_search_agent"]
|
||||
valid_templates = ["echo_agent", "chat_agent", "code_agent", "search_agent", "mysql_agent", "postgresql_agent", "jina_search_agent", "azure_blob_agent"]
|
||||
|
||||
if template_name not in valid_templates:
|
||||
raise HTTPException(
|
||||
|
||||
Reference in New Issue
Block a user