feat: 增强日历功能并集成 AgentScope 代理服务
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
from core.agentscope.schemas.execution import ExecutionBatchOutput, ExecutionTaskOutput
|
||||
from core.agentscope.schemas.intent import IntentOutput, IntentTask
|
||||
from core.agentscope.schemas.report import ReportOutput
|
||||
from core.agentscope.schemas.runtime import RuntimeOutput
|
||||
|
||||
__all__ = [
|
||||
"ExecutionBatchOutput",
|
||||
"ExecutionTaskOutput",
|
||||
"IntentOutput",
|
||||
"IntentTask",
|
||||
"ReportOutput",
|
||||
"RuntimeOutput",
|
||||
]
|
||||
@@ -0,0 +1,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class ExecutionTaskOutput(BaseModel):
|
||||
task_id: str = Field(min_length=1)
|
||||
status: Literal["SUCCESS", "PARTIAL", "FAILED"]
|
||||
execution_summary: str = Field(min_length=1)
|
||||
execution_data: dict[str, Any] = Field(default_factory=dict)
|
||||
user_feedback_needs: list[str] = Field(default_factory=list)
|
||||
|
||||
|
||||
class ExecutionBatchOutput(BaseModel):
|
||||
task_results: list[ExecutionTaskOutput] = Field(default_factory=list)
|
||||
overall_status: Literal["SUCCESS", "PARTIAL", "FAILED"]
|
||||
aggregate_summary: str = Field(min_length=1)
|
||||
@@ -0,0 +1,31 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
|
||||
class IntentTask(BaseModel):
|
||||
task_id: str = Field(min_length=1)
|
||||
title: str = Field(min_length=1)
|
||||
objective: str = Field(min_length=1)
|
||||
|
||||
|
||||
class IntentOutput(BaseModel):
|
||||
route: Literal["DIRECT_RESPONSE", "TASK_EXECUTION"]
|
||||
intent_summary: str = Field(min_length=1)
|
||||
direct_response: str | None = None
|
||||
tasks: list[IntentTask] = Field(default_factory=list)
|
||||
complexity: Literal["simple", "complex"]
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_route(self) -> "IntentOutput":
|
||||
if self.route == "DIRECT_RESPONSE":
|
||||
if not self.direct_response:
|
||||
raise ValueError("direct_response is required for DIRECT_RESPONSE")
|
||||
if self.tasks:
|
||||
raise ValueError("tasks must be empty for DIRECT_RESPONSE")
|
||||
if self.route == "TASK_EXECUTION":
|
||||
if not self.tasks:
|
||||
raise ValueError("tasks is required for TASK_EXECUTION")
|
||||
return self
|
||||
@@ -0,0 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class ReportOutput(BaseModel):
|
||||
assistant_text: str = Field(min_length=1)
|
||||
response_metadata: dict[str, Any] = Field(default_factory=dict)
|
||||
@@ -0,0 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from core.agentscope.schemas.execution import ExecutionBatchOutput
|
||||
from core.agentscope.schemas.intent import IntentOutput
|
||||
from core.agentscope.schemas.report import ReportOutput
|
||||
|
||||
|
||||
class RuntimeOutput(BaseModel):
|
||||
intent: IntentOutput
|
||||
execution: ExecutionBatchOutput | None = None
|
||||
report: ReportOutput
|
||||
Reference in New Issue
Block a user