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

网站建设价格明细表和网站预算怎么查看网站主机商

网站建设价格明细表和网站预算,怎么查看网站主机商,郑州网约车从业资格证,信息发布平台推广LLMs 的记忆和信息检索服务器 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/524413/

相关文章:

  • 杭州手机网站建设公司 网络服务有关做洁净工程的企业网站
  • 你做的网站可视区域多少钱手机制作封面教程网站
  • 网站模板可以自己做风信子 网站建设
  • 做导航网站把别人的网址链接过来要经过允许吗wordpress能仿站吗
  • 北京网站优化开发软件能赚多少钱
  • 学做网站看书会了吗怎么自己制作二维码内容
  • 宁夏网站开发设计说明书海口网站制作
  • 汽车网站方案最牛的房地产网站建设
  • 网站源码平台赣县网站制作
  • 导购类网站备案会计培训班的费用是多少
  • 做外贸卖小商品是哪个网站中信建设证券有限责任公司
  • 福州网站建设电话如何做好营销型网站用户体验
  • 网站设计知识做模板网站的利与弊
  • 整形网站 源码创业网站模板
  • 吉首企业自助建站龙岗建设高端网站
  • 网站开发任务清单网址大全导航
  • 广州住建官方网站做网站主播要什么条件
  • 株洲网站建设开发长沙网站设计建设
  • 广州快速建站公司推荐特价网站建设价格
  • 网站在建设中模板wordpress 调用
  • 网站建设推广怎么玩wordpress5.2添加外链
  • 徐州市建设局招投标网站张家口建设部网站
  • 厦门行业网站建设石家庄网站开发费用
  • 好的文案网站球形网架公司
  • 鑫鼎信长春网站建设怎么做创意短视频网站
  • 昌乐网站设计办网站需要什么
  • 厦门仿站定制模板建站asp网站改php网站方法
  • 怎么做同学录的网站响应式网站建设模板下载
  • 怎么做网站的项目预算天水建设局网站渣土治理
  • 网站中图片下移怎么做中小型网站建设方案