使用AnythingLLM的api调用

 目标

AnythingLLM是一个图形化的工具,想要在项目中使用,就必须使用API调用。

好在AnythingLLM提供了这样的工具。

官方文档

API Access and Keys | AnythingLLM by Mintplex Labs

申请API-KEY

创建新的API-KEY

访问Swagger

访问本地的http://localhost:3001/api/docs/ 可以查询到官方的文档。

测试API

点击左上角的Authorize进行认证,API key是作为请求头传入的。

找到工作空间的进行POST的Chat

得到了这样的响应:

可以看到成功发挥了AnythingLLM的查询文档功能。

{
  "id": "63dd7a4b-45f9-4b29-84be-74a0119f85e6",
  "type": "textResponse",
  "close": true,
  "error": null,
  "chatId": 17,
  "textResponse": "ECharts is a powerful, open-source JavaScript visualization library that offers flexible chart types, robust rendering engines, and professional data analysis capabilities. It allows developers to create dynamic, interactive visualizations for web applications using various charts such as line charts, bar charts, scatter plots, pie charts, and more. ECharts supports customization in terms of appearance, layout, and interactivity, making it suitable for a wide range of uses from simple dashboards to complex data analysis tools.",
  "sources": [
    {
      "id": "5be5be5f-a394-41b0-a47e-1db35c9fc8ce",
      "url": "file://C:\\Users\\81067\\AppData\\Roaming\\anythingllm-desktop\\storage\\hotdir\\echarts使用 英文文档.docx",
      "title": "echarts使用 英文文档.docx",
      "docAuthor": "no author found",
      "description": "No description found.",
      "docSource": "pdf file uploaded by the user.",
      "chunkSource": "",
      "published": "2024/6/23 12:24:49",
      "wordCount": 871,
      "token_count_estimate": 904,
      "text": "<document_metadata>\nsourceDocument: echarts使用 英文文档.docx\npublished: 2024/6/23 12:24:49\n</document_metadata>\n\nECh
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

neter.asia

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值