prompt_buyer.go 987 B

12345678910111213141516171819202122232425262728293031
  1. package prompt
  2. import (
  3. "data_ai/ai"
  4. "data_ai/ul"
  5. "unicode/utf8"
  6. )
  7. // 获取外围抽取字段
  8. func AcquireBuyerInfo(detail string) map[string]interface{} {
  9. content := PromptBuyerText(detail)
  10. zp := ai.PostZhiPuInfo(content)
  11. return zp
  12. }
  13. // 提示词优选
  14. func PromptBuyerText(detail string) string {
  15. if utf8.RuneCountInString(detail) > ul.MaxLen {
  16. detail = string([]rune(detail)[:ul.MaxLen])
  17. }
  18. content := `请根据我提供的正文进行"实体单位"的抽取;
  19. 你在识别"实体单位"的时候,只能返回一个实体单位,不要返回多个实体单位,如果识别不出来,请填写"无";
  20. 请将上述的识别结果、信息分类结果,按照JSON格式输出,
  21. 严格按照json格式
  22. {
  23. "实体单位":"实体单位",
  24. }
  25. 请回答我的问题,不要联想,不要无中生有,不要生成解释,对于尚未确定或未明确的信息请在JSON对应的值填写:无
  26. 正文内容:` + "\n" + detail + "\n结果JSON:"
  27. return content
  28. }