This commit is contained in:
killua committed 2025-06-20 10:41:59 +08:00
1 parent 53ac11f489
commit b1c2488162
42 files changed
+114 -2

No files matched your search

View File
Whitespace-only changes.
View File
Whitespace-only changes.
+37
View File
@@ -0,0 +1,37 @@
from fastapi import APIRouter
from src.services.memory.implement.memory_impl_1 import MemoryImpl1
from src.services.planner.implement.planner_impl1 import PlannerImpl1
chat_router = APIRouter(prefix='/chat')
@chat_router.get("/chat1")
async def chat1(user_msg: str):
# 记忆模块
memory_service = MemoryImpl1()
memory_service.search_memory_info(user_msg)
memory_service.update_memory_info(user_msg)
# 决策模块
planner_service = PlannerImpl1()
plan_result =planner_service.plan(user_msg)
if plan_result['action'] == "answer":
"调用llm_service"
pass
elif plan_result['action'] == "content":
"调用content_service"
pass
elif plan_result['action'] == "function":
"调用function_service"
pass
elif plan_result['action'] == "game":
"调用game_service"
pass
# 进一步返回结果
return {}
@chat_router.get("/chat2")
async def chat2():
pass
+13
View File
@@ -0,0 +1,13 @@
from fastapi import APIRouter
chat_router = APIRouter(prefix='/rtc')
@chat_router.get("/rtc1")
async def rtc1():
pass
@chat_router.get("/rtc2")
async def rtc2():
pass
View File
Whitespace-only changes.
+8
View File
@@ -0,0 +1,8 @@
from fastapi import APIRouter
from src.api.v1.endpoints.chat import chat_router
from src.api.v1.endpoints.rtc import rtc_router
v1_router = APIRouter(prefix='/api/v1')
v1_router.include_router(chat_router, prefix='/chat')
v1_router.include_router(rtc_router, prefix='/rtc')
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
View File
Whitespace-only changes.
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
View File
Whitespace-only changes.
Whitespace-only changes.
View File
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
View File
Whitespace-only changes.
+1
View File
@@ -0,0 +1 @@
## llm api
View File
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,12 @@
from src.services.memory.memory_service import MemoryService
class MemoryImpl1(MemoryService):
def __init__(self):
super().__init__()
def search_memory_info(self, user_msg):
pass
def update_memory_info(self, user_msg):
pass
+13
View File
@@ -0,0 +1,13 @@
from abc import ABC, abstractmethod
class MemoryService1(ABC):
def __init__(self):
pass
def search_memory_info(self, user_msg):
"""抽象方法,用于根据用户消息搜索记忆信息"""
pass
def update_memory_info(self, user_msg):
"""抽象方法,用于更新记忆信息"""
pass
@@ -0,0 +1,9 @@
from src.services.planner.planner_service import PlannerService
class PlannerImpl1(PlannerService):
def __init__(self):
super().__init__()
def plan(self, user_msg):
"实现具体的规划逻辑"
pass
+10
View File
@@ -0,0 +1,10 @@
from abc import ABC, abstractmethod
class PlannerService(ABC):
def __init__(self):
pass
@abstractmethod
def plan(self, user_msg):
"用于规划出用户的下一步行动"
pass