You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

retrieval_categorize_and_generate.json 3.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {
  2. "components": {
  3. "begin": {
  4. "obj":{
  5. "component_name": "Begin",
  6. "params": {
  7. "prologue": "Hi there!"
  8. }
  9. },
  10. "downstream": ["answer:0"],
  11. "upstream": []
  12. },
  13. "answer:0": {
  14. "obj": {
  15. "component_name": "Answer",
  16. "params": {}
  17. },
  18. "downstream": ["categorize:0"],
  19. "upstream": ["begin", "generate:0", "switch:0"]
  20. },
  21. "categorize:0": {
  22. "obj": {
  23. "component_name": "Categorize",
  24. "params": {
  25. "llm_id": "deepseek-chat",
  26. "category_description": {
  27. "product_related": {
  28. "description": "The question is about the product usage, appearance and how it works.",
  29. "examples": "Why it always beaming?\nHow to install it onto the wall?\nIt leaks, what to do?",
  30. "to": "retrieval:0"
  31. },
  32. "others": {
  33. "description": "The question is not about the product usage, appearance and how it works.",
  34. "examples": "How are you doing?\nWhat is your name?\nAre you a robot?\nWhat's the weather?\nWill it rain?",
  35. "to": "message:0"
  36. }
  37. }
  38. }
  39. },
  40. "downstream": ["retrieval:0", "message:0"],
  41. "upstream": ["answer:0"]
  42. },
  43. "message:0": {
  44. "obj":{
  45. "component_name": "Message",
  46. "params": {
  47. "messages": [
  48. "Sorry, I don't know. I'm an AI bot."
  49. ]
  50. }
  51. },
  52. "downstream": ["answer:0"],
  53. "upstream": ["categorize:0"]
  54. },
  55. "retrieval:0": {
  56. "obj": {
  57. "component_name": "Retrieval",
  58. "params": {
  59. "similarity_threshold": 0.2,
  60. "keywords_similarity_weight": 0.3,
  61. "top_n": 6,
  62. "top_k": 1024,
  63. "rerank_id": "BAAI/bge-reranker-v2-m3",
  64. "kb_ids": ["869a236818b811ef91dffa163e197198"]
  65. }
  66. },
  67. "downstream": ["generate:0"],
  68. "upstream": ["switch:0"]
  69. },
  70. "generate:0": {
  71. "obj": {
  72. "component_name": "Generate",
  73. "params": {
  74. "llm_id": "deepseek-chat",
  75. "prompt": "You are an intelligent assistant. Please summarize the content of the knowledge base to answer the question. Please list the data in the knowledge base and answer in detail. When all knowledge base content is irrelevant to the question, your answer must include the sentence \"The answer you are looking for is not found in the knowledge base!\" Answers need to consider chat history.\n Here is the knowledge base:\n {input}\n The above is the knowledge base.",
  76. "temperature": 0.2
  77. }
  78. },
  79. "downstream": ["answer:0"],
  80. "upstream": ["retrieval:0"]
  81. }
  82. },
  83. "history": [],
  84. "messages": [],
  85. "reference": {},
  86. "path": [],
  87. "answer": []
  88. }