feat: 重构 memory 系统,支持 user memory 和 work memory 分离
This commit is contained in:
@@ -20,7 +20,7 @@ class ContextWindowMode(str, Enum):
|
||||
NUMBER = "number"
|
||||
|
||||
|
||||
class MemoryContextConfig(BaseModel):
|
||||
class MessageContextConfig(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
source: ContextSource = ContextSource.LATEST_CHAT
|
||||
@@ -32,7 +32,7 @@ class RuntimeConfig(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
enabled_tools: list[AgentTool] = Field(default_factory=list, max_length=32)
|
||||
context: MemoryContextConfig = Field(default_factory=MemoryContextConfig)
|
||||
context: MessageContextConfig = Field(default_factory=MessageContextConfig)
|
||||
|
||||
|
||||
class AutomationJobConfig(RuntimeConfig):
|
||||
@@ -46,6 +46,7 @@ class AutomationJob(BaseModel):
|
||||
|
||||
id: UUID
|
||||
owner_id: UUID
|
||||
bootstrap_key: str | None = Field(default=None, min_length=1, max_length=64)
|
||||
title: str = Field(..., min_length=1, max_length=255)
|
||||
config: AutomationJobConfig
|
||||
schedule_type: ScheduleType
|
||||
@@ -63,6 +64,7 @@ class AutomationJob(BaseModel):
|
||||
return cls(
|
||||
id=obj.id,
|
||||
owner_id=obj.owner_id,
|
||||
bootstrap_key=obj.bootstrap_key,
|
||||
title=obj.title,
|
||||
config=AutomationJobConfig.model_validate(obj.config or {}),
|
||||
schedule_type=obj.schedule_type,
|
||||
|
||||
Reference in New Issue
Block a user