当前位置: 首页 > news >正文

网站设计的指导思想佛山公司网站设计团队

网站设计的指导思想,佛山公司网站设计团队,微信推广图片,wordpress汉化.poLLMs 的记忆和信息检索服务器 Motorhead 1. 为什么使用 Motorhead?2. 通过 Docker 启动 Motorhead3. Github 地址4. python 使用示例地址 1. 为什么使用 Motorhead? 使用 LLMs构建聊天应用程序时,每次都必须构建记忆处理。Motorhead是协助该…

LLMs 的记忆和信息检索服务器 Motorhead

  • 1. 为什么使用 Motorhead?
  • 2. 通过 Docker 启动 Motorhead
  • 3. Github 地址
  • 4. python 使用示例地址

1. 为什么使用 Motorhead?

使用 LLMs构建聊天应用程序时,每次都必须构建记忆处理。Motorhead是协助该过程的服务器。

它提供了 4 个简单的 API:

  • GET /sessions/:id/memory 返回最多 MAX_WINDOW_SIZE 的 messages
{"messages": [{"role": "AI","content": "Electronic music and salsa are two very different genres of music, and the way people dance to them is also quite different."},{"role": "Human","content": "how does it compare to salsa?"},{"role": "AI","content": "Electronic music is a broad genre that encompasses many different styles, so there is no one \"right\" way to dance to it."},{"role": "Human","content": "how do you dance electronic music?"},{"role": "AI","content": "Colombia has a vibrant electronic music scene, and there are many talented DJs and producers who have gained international recognition."},{"role": "Human","content": "What are some famous djs from Colombia?"},{"role": "AI","content": "Baum opened its doors in 2014 and has quickly become one of the most popular clubs for electronic music in Bogotá."}],"context": "The conversation covers topics such as clubs for electronic music in Bogotá, popular tourist attractions in the city, and general information about Colombia. The AI provides information about popular electronic music clubs such as Baum and Video Club, as well as electronic music festivals that take place in Bogotá. The AI also recommends tourist attractions such as La Candelaria, Monserrate and the Salt Cathedral of Zipaquirá, and provides general information about Colombia's diverse culture, landscape and wildlife.","tokens": 744 // tokens used for incremental summarization
}
  • POST /sessions/:id/memory - 向 Motorhead 发送数组 messages 进行存储
curl --location 'localhost:8080/sessions/${SESSION_ID}/memory' \
--header 'Content-Type: application/json' \
--data '{"messages": [{ "role": "Human", "content": "ping" }, { "role": "AI", "content": "pong" }]
}'

存储消息时,可以使用现有会话或新 SESSION_ID 会话,如果会话以前不存在,则会自动创建会话。

(可选) context 如果需要从其他数据存储加载,则可以将其送入。

  • DELETE /sessions/:id/memory - 删除会话的消息列表。

A max window_size is set for the LLM to keep track of the conversation. Once that max is hit, Motorhead will process (window_size / 2 messages) and summarize them. Subsequent summaries, as the messages grow, are incremental.

为跟踪对话设置了 LLM 最大值 window_size 。一旦达到最大值,Motorhead 将处理( window_size / 2 messages)并汇总它们。随着消息的增长,后续摘要是增量的。

  • POST /sessions/:id/retrieval - 使用 VSS 按文本查询进行搜索
curl --location 'localhost:8080/sessions/${SESSION_ID}/retrieval' \
--header 'Content-Type: application/json' \
--data '{"text": "Generals gathered in their masses, just like witches in black masses"
}'

2. 通过 Docker 启动 Motorhead

docker run --rm --name some-redis -p 6379:6379 -d redis
docker run --rm --name motorhead -p 8080:8080 -e PORT=8080 -e REDIS_URL='redis://some-redis:6379' -d ghcr.io/getmetal/motorhead:latest

3. Github 地址

https://github.com/getmetal/motorhead

4. python 使用示例地址

https://github.com/getmetal/motorhead/tree/main/examples/chat-py

p.s. 暂时使用的可能性不大,所以先不做深入研究。

完结!

http://www.yayakq.cn/news/267929/

相关文章:

  • 虫部落是谁做的网站建筑工程项目
  • 网站开发中标签栏的图标一般都在那个文件中写代码互展科技网站建设
  • 网站建设方案书doc模板电子商务网站建设与管理实验总结
  • 专门为98k做的网站seo优化分析
  • 网站建设考虑事项seo优化什么意思
  • 现在网站建设的技术wordpress wp option
  • 校园网站建设说明书怎么弄自己的微信小程序
  • 湖口县建站公司ppt可爱模板免费下载
  • 无锡网站建设收费杭州上城区抖音seo有多好
  • 企业电子商务网站建设和一般建材行业网站建设
  • 有用织梦做的大网站吗wordpress默认播放器
  • 蓝色汽车配件公司网站 模板营销网站竞品分析报告
  • 大学生做家教比较好的网站怒江企业网站建设
  • 简述网站制作流程wordpress炫简主题
  • 开源网站程序替别人做设计的网站多少钱
  • 建设视频网站费用小精灵网站在线做语文
  • 厦门公司做网站wordpress房产主题汉化版
  • 弄淘宝招牌图什么网站可以做怎么制作图片文件夹
  • 二手车网站开发过程软件外包公司如何接单
  • 装修网站模板源码蜜雪冰城推广软文
  • 网站建设有哪些公司江门网站建设推荐
  • 郑州响应式网站设计企业培训员工培训平台
  • 成都彭州网站建设手机怎么搭建网站源码
  • 广东网站快速备案如何建设局域网内部网站
  • 居士做网站上弦 网站建设
  • 南乐网站建设电话wordpress 改变网页
  • 花都高端网站建设wordpress外网跳转
  • 最新新闻摘抄湖北网站seo策划
  • 景安建网站手机卡顿优化软件
  • 网站更换图片之类的怎么做谷歌chrome手机版