PMFlow/backend/app/api/ai_steward_api/schemas.py

97 lines
2.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from __future__ import annotations
from .shared import *
class ProjectFromTextRequest(BaseModel):
"""零配置项目创建请求"""
input_text: str = Field(
...,
description="自然语言项目描述,例如:我们要做一个 AI 客服工具,基于 GPT-4o mini,对标 XX 竞品,3 周上线",
min_length=10,
max_length=500
)
class ProjectFromTextResponse(BaseModel):
"""零配置项目创建响应"""
project: Dict[str, Any]
signal: Dict[str, Any]
charter: Dict[str, Any]
tasks: List[Dict[str, Any]]
risks: List[Dict[str, Any]]
analysis: Dict[str, Any]
class CognitiveConflictResponse(BaseModel):
"""认知冲突响应"""
id: str
type: str
description: str
severity: str
resolution_suggestion: Optional[str] = None
related_users: List[str]
class DailyBriefingResponse(BaseModel):
"""每日简报响应"""
date: str
total_updates: int
your_updates: int
relevant_changes: List[Dict[str, Any]]
risk_alerts: List[Dict[str, Any]]
alignment_needed: List[Dict[str, Any]]
class FeishuCaptureRequest(BaseModel):
"""飞书信号捕获请求"""
group_chat_id: str
message_content: str
sender: str
feishu_message_id: Optional[str] = None
class BrowserCaptureRequest(BaseModel):
"""浏览器信号捕获请求"""
user_id: int
url: str
title: str
content_preview: str
class GitHubCaptureRequest(BaseModel):
"""GitHub信号捕获请求"""
repo_url: str
event_type: str
event_data: Dict[str, Any]
class ConflictDetectRequest(BaseModel):
"""认知冲突检测请求"""
project_id: int
detect_type: str = "all" # all, charter, definition
class SignalSourceOnboardRequest(BaseModel):
project_id: int = Field(..., ge=1)
instruction: str = Field(..., min_length=6, max_length=2000)
dry_run: bool = False
response_mode: Literal["fast", "complete"] = "fast"
class SignalSourceListResponse(BaseModel):
items: List[Dict[str, Any]]
class SignalSourceRepairRequest(BaseModel):
project_id: int = Field(..., ge=1)
registry_ids: List[int] = Field(default_factory=list, min_length=1, max_length=50)
sender: str = Field(default="PMFlow修复器", min_length=1, max_length=64)
class CodeCommentScanRequest(BaseModel):
"""代码注释扫描请求"""
code_content: str
file_path: str
line_number: int
project_id: int
class BlockerResolveRequest(BaseModel):
"""阻塞解决请求"""
blocker_id: int
resolution_note: str
class WorkflowTriggerRequest(BaseModel):
"""工作流触发请求"""
event_type: str
event_data: Dict[str, Any]