chore: 迁移服务器前同步本地修改
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
import asyncio
|
||||
import datetime
|
||||
from typing import Union
|
||||
from kilostar.utils.ray_compat import actor_class
|
||||
from kilostar.adapter.model_adapter.agent_factory import AgentFactory
|
||||
from kilostar.core.global_state_machine.global_state_machine import GlobalStateMachine
|
||||
from kilostar.core.global_state_machine.model_provider import Provider
|
||||
@@ -28,7 +27,6 @@ from pydantic_ai import RunContext, Agent
|
||||
from kilostar.utils.prompts import agent_prompt
|
||||
|
||||
|
||||
@actor_class
|
||||
class RegulatoryNode:
|
||||
"""RegulatoryNode(监管节点):用户请求的直接对话节点。
|
||||
|
||||
@@ -234,12 +232,12 @@ class RegulatoryNode:
|
||||
return
|
||||
try:
|
||||
import uuid
|
||||
from kilostar.utils.ray_hook import ray_actor_hook
|
||||
from kilostar.utils.actor import get_actor
|
||||
|
||||
postgres_database = ray_actor_hook("postgres_database").postgres_database
|
||||
postgres_database = get_actor("postgres_database")
|
||||
task_id = uuid.uuid4().hex
|
||||
chat_id = payload.platform_id if payload.platform == "client" else None
|
||||
await postgres_database.create_task.remote(
|
||||
await postgres_database.create_task(
|
||||
task_id=task_id,
|
||||
user_id=payload.user_name,
|
||||
command=payload.message,
|
||||
|
||||
@@ -13,12 +13,10 @@
|
||||
# limitations under the License.
|
||||
from typing import Literal, Optional
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from kilostar.utils.agent_model import ResponseModel, DepsModel, RequestModel
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class RegulatoryNodeResponse(ResponseModel):
|
||||
class RegulatoryNodeResponse(BaseModel):
|
||||
"""
|
||||
RegulatoryNodeResponse类
|
||||
一切regulatory_node回复的父类
|
||||
@@ -26,14 +24,14 @@ class RegulatoryNodeResponse(ResponseModel):
|
||||
|
||||
pass
|
||||
|
||||
class RegulatoryNodeRequest(RequestModel):
|
||||
class RegulatoryNodeRequest(BaseModel):
|
||||
"""
|
||||
RegulatoryNodeRequest类
|
||||
向regulatory请求的父类
|
||||
"""
|
||||
pass
|
||||
|
||||
class RegulatoryNodeDeps(DepsModel):
|
||||
class RegulatoryNodeDeps(BaseModel):
|
||||
"""
|
||||
RegulatoryNodeDeps类
|
||||
regulatory_node的依赖模型
|
||||
@@ -44,7 +42,7 @@ class RegulatoryNodeDeps(DepsModel):
|
||||
retry_count: int = 0
|
||||
error_history: str = ""
|
||||
|
||||
class MessageRequest(RequestModel):
|
||||
class MessageRequest(BaseModel):
|
||||
"""
|
||||
MessageRequest类
|
||||
任何消息渠道向regulatory_node发送消息请求的模型
|
||||
|
||||
Reference in New Issue
Block a user