ai.py 812 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. from __future__ import annotations
  2. from typing import Any, Literal
  3. from pydantic import BaseModel, Field
  4. class AgentChatRequest(BaseModel):
  5. message: str
  6. thread_id: str | None = None
  7. mine_id: str | None = None
  8. workflow: str = "chat"
  9. context: dict[str, Any] = Field(default_factory=dict)
  10. class AgentRunResponse(BaseModel):
  11. run_id: str
  12. session_id: str
  13. workflow: str
  14. status: str
  15. output: Any = None
  16. error: str = ""
  17. class WorkflowRunRequest(BaseModel):
  18. mine_id: str
  19. workflow: Literal["diagnosis", "evaluation", "knowledge_qa", "document_analysis"]
  20. payload: dict[str, Any] = Field(default_factory=dict)
  21. requested_by: str = ""
  22. class AgentCapability(BaseModel):
  23. name: str
  24. label: str
  25. enabled: bool
  26. description: str
  27. model: str = ""