This commit is contained in:
parent
55aa7e30e9
commit
942c1bea71
|
|
@ -287,8 +287,8 @@ class ConversationState(rx.State):
|
|||
conversation_id=self.actived_conversation_id
|
||||
)
|
||||
usage = usage_validate_python(conversation.usage)
|
||||
# 匹配工作类型
|
||||
match conversation.work:
|
||||
# 匹配工作流类型
|
||||
match conversation.work_flow:
|
||||
# 预定航班
|
||||
case WorkType.BOOK_FLIGHT:
|
||||
from application.workshop.book_flight import run_stream_events
|
||||
|
|
|
|||
|
|
@ -64,16 +64,14 @@ class Run(BaseModel):
|
|||
)
|
||||
|
||||
|
||||
class WorkType(StrEnum):
|
||||
class WorkFlowType(StrEnum):
|
||||
"""
|
||||
工作类型枚举
|
||||
工作流类型枚举
|
||||
"""
|
||||
|
||||
BOOK_FLIGHT = "预定航班"
|
||||
|
||||
|
||||
|
||||
|
||||
class Deps(BaseModel):
|
||||
"""
|
||||
依赖项类
|
||||
|
|
@ -82,13 +80,12 @@ class Deps(BaseModel):
|
|||
...
|
||||
|
||||
|
||||
class Work(BaseModel):
|
||||
class WorkFlow(BaseModel):
|
||||
"""
|
||||
工作类
|
||||
工作流类
|
||||
"""
|
||||
|
||||
type: WorkType = Field(..., description="工作类型")
|
||||
status: TaskStatus = Field(default=TaskStatus.NONE, description="工作状态")
|
||||
type: WorkFlowType = Field(..., description="工作类型")
|
||||
deps: Deps | None = Field(default=None, description="工作依赖项")
|
||||
usage: RunUsage = Field(default=RunUsage(), description="工作使用量")
|
||||
usage_limits: UsageLimits | None = Field(
|
||||
|
|
@ -104,7 +101,7 @@ class Conversation(BaseModel):
|
|||
|
||||
id: str = Field(..., description="会话唯一标识")
|
||||
description: str = Field(..., description="会话描述")
|
||||
work: Work | None = Field(default=None, description="绑定工作实例")
|
||||
work_flow: WorkFlow | None = Field(default=None, description="工作流")
|
||||
user_prompt: str = Field(default="", description="用户提示词")
|
||||
usage: dict[str, Any] = Field(..., description="会话使用量")
|
||||
messages: dict[str, Message] = Field(..., description="消息字典")
|
||||
|
|
|
|||
Loading…
Reference in New Issue