mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-21 14:23:33 +08:00
- 重构 api.py:
- 按模块划分为不同的 router
- 添加 openai 兼容的转发接口,项目默认使用该接口以实现模型负载均衡
- 添加 /tools 接口,可以获取/调用编写的 agent tools
- 移除所有 EmbeddingFuncAdapter,统一改用 get_Embeddings
- 待办:
- /chat/chat 接口改为 openai 兼容
- 添加 /chat/kb_chat 接口,openai 兼容
- 改变 ntlk/knowledge_base/logs 等数据目录位置
24 lines
603 B
Python
24 lines
603 B
Python
from __future__ import annotations
|
|
|
|
from typing import List
|
|
|
|
from fastapi import APIRouter, Request
|
|
|
|
from server.chat.chat import chat
|
|
from server.chat.feedback import chat_feedback
|
|
from server.chat.file_chat import file_chat
|
|
|
|
|
|
chat_router = APIRouter(prefix="/chat", tags=["ChatChat 对话"])
|
|
|
|
chat_router.post("/chat",
|
|
summary="与llm模型对话(通过LLMChain)",
|
|
)(chat)
|
|
|
|
chat_router.post("/feedback",
|
|
summary="返回llm模型对话评分",
|
|
)(chat_feedback)
|
|
|
|
chat_router.post("/file_chat",
|
|
summary="文件对话"
|
|
)(file_chat) |