Skip to content

AI Chat Room Server and Android Client of ChatGPT and NewBing

License

Notifications You must be signed in to change notification settings

The---onE/AI-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Chat

AI Chat Room Server and Android Client of ChatGPT and NewBing

引用

接口

接口 类型 功能
/api/openai POST 将请求直接转发至https://api.openai.com/v1/chat/completions
/api/chatgpt POST 读取请求内容后通过Langchain处理调用模型,根据请求内容进行不同处理
/upload/ GET 提供上传文件和URL的页面
/file POST 上传文件读取后通过Embedding保存到向量数据库
/url POST 上传URL读取网页后通过Embedding保存到向量数据库
/api/bing POST 读取请求内容通过EdgeGPT调用New Bing

ChatGPT接口特殊处理

  • /api/chatgpt接口会读取body["message"],根据其中特定内容进行特殊处理
  • body["message"][0]["role"]system,则根据body["message"][0]["content"]进行处理,以特定的文档作为文本背景
content前缀 content内容 功能
f: file/url index 通过index查找上传的文件或URL保存在向量数据库的内容作为文本背景
u: URL 通过SeleniumURLLoader加载网页,并通过Embedding保存在向量数据库作为文本背景
b: BV号 通过BiliBiliLoader加载BV号对应的B站视频字幕,并通过Embedding保存在向量数据库作为文本背景
t: 文本 直接将文本通过Embedding保存在向量数据库作为文本背景
system身份 不进行特殊处理,直接通过langchain的ChatOpenAI进行对话
  • 在有文本背景的情况下,会根据body["message"][-1]["content"]进行处理
content前缀 content内容 功能
:s 通过MapReduceDocumentsChain对文本背景的原文全文进行总结
:s 总结prompt 通过MapReduceDocumentsChain对文本背景的原文全文通过提示词进行总结
prompt 通过ConversationalRetrievalChain在向量数据库中寻找相关的文档作为文本背景进行对话

Demo

  • ChatGPT特殊处理
    url file bilibili
  • New Bing
    newbing
  • ChatGPT
    chatgpt
  • 列表
    list delete

About

AI Chat Room Server and Android Client of ChatGPT and NewBing

Resources

License

Stars

Watchers

Forks

Packages

No packages published