fs-lawrisk/docs/PRD.md

73 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

我需要你帮我构建一个检索系统用户会输入问题中文期望匹配到对应的事项输出事项ID 事项名称 许可事项列表,例如:
用户输入:我要办一家电影院
输出:
  "risk\_subject": \[
  {
  "id": "384aeb24a23e913268aad33354f705e7",
  "name": "开办电影院",
  "permit\_ids": \[
  "04bfa019634ca1aa0b9f7c783fd85dce",
  "509b2872fc7c38c08f252a2b426fd49f",
  "54a79077-bd72-4ea9-8bb1-35afc69e2973",
  "709b4718d72229311066e529650b8abf",
  "8d49de002f24d37fcf3663574723e693",
  "8f7c8c613adfbd815a78c1e60ec4330e",
  "a0572119839422e1d11ee8801d6c58b7",
  "fa2f3e05c92297be096b63e25d30bfbe"
  ]
  }]
我希望你能用embedding模型来处理
首先先把事项名称从risk\_tables\_export.json 中提取出来然后建立一个fs\_law\_risk数据库,建立表law\_sub用来存放事项向量以json文件中的ID为主键保存名称和向量到数据库
再建立一个表名为law\_sub\_per,保存主题事项与许可事项的映射关系需要有主题事项id许可事项id列表
设置embedding相似度阈值0.5,大于阈值以上的事项全部返回
如果检索结果都小于0.5但大于0.4,返回第一个
暴露接口/fs-ai-asistant/api/workflow/lawrisk
跨域问题处理请复用smart\_cors\_middleware.py你可以把这个文件移动到合适的目录
* 你可以使用的postgreSQL
  - IP :8.138.196.105
  - port:5432
  - user:postgres
  - password:difyai123456
* API 以及doc参考
我们应该只需要用同步接口
  - 通用文本向量同步接口API详情https://help.aliyun.com/zh/model-studio/text-embedding-synchronous-api?spm=a2c4g.11186623.help-menu-2400256.d\_2\_7\_0.693e48233phHX8
  - 通用文本批处理接口API详情https://help.aliyun.com/zh/model-studio/text-embedding-batch-api?spm=a2c4g.11186623.help-menu-2400256.d\_2\_7\_1.59233560WBHuRz
  - API keysk-288824ef003e4e02bb963b8b3024b06a