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

私有知识库 Coco AI 实战(四):打造 ES 索引参数小助手

经过前面的实战,我们已经能够快速、准确的检索 ES 官方文档的内容了,但是还是要自己去阅读。既然 Coco AI 能与大模型交互,我们何不直接用大模型来阅读文档,回答我们的问题?

模型配置

我们进入 Coco AI 管理后台,选择模型提供商菜单。这里我配置通义千问的模型。

🤔 如果没有这个菜单的小伙伴,请下载最新版本的 Coco Server。

填入对应的 URL 和 API 密钥,保存。

确保最下面的启用状态是打开的,这样我们的模型就配置完了。

小助手配置

进入 AI 助手菜单,选择新增。

填写字段内容,类型选择深度思考,模型设置参考图片选择。

对于每个模型,我们可以配置单独的提示词及随机性等参数。点击应答模型后面的菜单图标会出现具体的设置界面。

提示词设置我们给设置一个根据上下文回答问题的提示词。

您将获得一段对话和一个后续问题。如有必要,请将后续问题重新表述为一个独立的问题,以便LLM能够在知识库中进行信息检索。⸻上下文:{{.context}}用户查询:{{.query}} ⸻请根据上述信息生成您的回答,优先考虑LLM工具的输出(如有)。确保您的回答具有深思熟虑、准确性和良好的结构。如果提供的信息不足,请告知用户需要更多详细信息,或提供友好、对话式的回应。对于复杂的答案,请使用清晰且组织良好的Markdown格式,以提高可读性。

对意图识别模型设置提示词。

You are an AI assistant trained to understand and analyze user queries.
You will be given a conversation below and a follow-up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the LLM to search the knowledge base for information.Conversation:
{{.history}}Tool List:
{{.tool_list}}Network sources List:
{{.network_sources}}The user has provided the following query:
{{.query}}You need help to figure out the following tasks:
- Please analyze the query and identify the user's primary intent. Determine if they are looking for information, making a request, or seeking clarification. brief as field: 'intent',
- Categorize the intent in </Category>,  and rephrase the query in several different forms to improve clarity.
- Provide possible variations of the query in <Query/> and identify relevant keywords in </Keyword> in JSON array format.
- Provide possible related queries in <Suggestion/> and expand the related query for query suggestion.
- Based on the tool list provided, analyze the user's query whether need to call external tools, output as field: 'need_call_tools'
- Analyze the user's query whether need to plan some complex sub-tasks in order to achieve the goal, output as field: 'need_plan_tasks'Please make sure the output is concise, well-organized, and easy to process.
Please present these possible query and keyword items in both English and Chinese.If the possible query is in English, keep the original English one, and translate it to Chinese and keep it as a new query, to be clear, you should output: [Apple, 苹果], neither just 'Apple' nor just '苹果'.
Wrap the valid JSON result in <JSON></JSON> tags.Your output should look like this format:
<JSON>
{"category": "<Intent's Category>","intent": "<User's Intent>","query": ["<Rephrased Query 1>","<Rephrased Query 2>","<Rephrased Query 3>"],"keyword": ["<Keyword 1>","<Keyword 2>","<Keyword 3>"],"suggestion": ["<Suggest Query 1>","<Suggest Query 2>","<Suggest Query 3>"],"need_plan_tasks":<true or false>,"need_call_tools":<true or false>
}
</JSON>

数据源我们选择 ES 文档的数据源,数据过滤我们可以增加一个过滤,只选取内容是索引设置相关的文档。

其他的 MCP 服务器和大模型工具暂时用不到,先关闭。

角色提示词,写一个。至此 ES 索引参数查询助手就配置好了。

最后,如果你有多个小助手,可以设置快捷访问。在设置-应用设置中,添加要展示的 AI 小助手,这样 Coco App 进入到 AI 模式时,可以快速选择需要的小助手。当然不设置,也是可以切换的。

Coco App 安装

本地电脑安装一个 Coco App,用来登录本地的 Coco Server。Coco App 支持一键呼出,功能都有快捷键,直接全键盘操作效率拉满。

安装好后启动,点击 Coco App 图标-偏好设置。

点击左侧 + 号,填入本地 Coco Server 地址,该信息可以去 Coco Server 管理平台查看。

点击登录,弹窗中点击打开 Coco app,我们就登录成功了。

实战搜索

快速验证下 Coco App 搜索功能,使用快捷键 shift+command+space 呼出 Coco App,输入信息看看能否有检索结果。

展示结果后,按下 command 键会显示快捷按键,一键打开资源。

实战 AI 聊天

在 Coco App 界面下,按 Command + T 切换到 AI 聊天模式,可以看到我们之前设置的快捷入口。如果没设置,可以在左上角切换 AI 小助手。

我们点击“ES 索引参数查询助手”后可以询问索引参数相关的问题。我们先直接用自然语言询问参数信息。

可以看到 AI 先检索到具体的官方文档《 Index Modules 》进行深入阅读后才回答我们的提问,结果也是非常正确。除此之外,我们还可以通过参数名询问参数作用。

以后有索引参数方面的问题,就直接找 ES 索引参数查询助手了。

Coco AI 官网: Coco AI - Search, Connect, Collaborate

相关文章:

  • 前端漏洞不扫描理由
  • Linux systemd 从理论到实践:现代系统管理的核心工具
  • C++ 单例对象自动释放(保姆级讲解)
  • Hearts of Iron IV 钢铁雄心 4 [DLC 解锁] [Windows SteamOS macOS]
  • 机器学习-入门-决策树(1)
  • 第17节:传统分类模型-随机森林与决策树
  • day10 python机器学习全流程实践
  • Azure Synapse Dedicated SQL pool企业权限管理
  • 数据库操作
  • 轻松实现CI/CD: 用Go编写的命令行工具简化Jenkins构建
  • Java练习8
  • 【AlphaFold2】Feature extraction:提取特征,为模型输入做准备|Datapipeline讲解
  • 激光扫描仪的用途及优势
  • Java常用注解通俗解释
  • 【计算机视觉】目标检测:深度解析YOLOv5:下一代实时目标检测框架实战指南
  • UniApp 小程序嵌套 H5 页面显示隐藏监听实践
  • CentOS NFS共享目录
  • 关于3D的一些基础知识
  • Objective-C Block 底层原理深度解析
  • WEBSTORM前端 —— 第2章:CSS —— 第4节:盒子模型
  • 83岁连丽如每周登台说书,还上了15堂连派评书课
  • 解读|特朗普“助攻”下加拿大自由党“惨胜”,卡尼仍需克服“特鲁多阴影”
  • 丁俊晖连续7年止步世锦赛16强,中国军团到了接棒的时候
  • 央行副行长:我们在研究丰富政策工具箱,将适时推出增量政策
  • 四川苍溪县教育局通报“工作人员辱骂举报学生”:停职检查
  • 公交公司须关注新出行需求:“单车巴士”能否常态化