advanced_prompt_templates.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. CONTEXT = "Use the following context as your learned knowledge, inside <context></context> XML tags.\n\n<context>\n{{#context#}}\n</context>\n\nWhen answer to user:\n- If you don't know, just say that you don't know.\n- If you don't know when you are not sure, ask for clarification.\nAvoid mentioning that you obtained the information from the context.\nAnd answer according to the language of the user's question.\n"
  2. BAICHUAN_CONTEXT = "用户在与一个客观的助手对话。助手会尊重找到的材料,给出全面专业的解释,但不会过度演绎。同时回答中不会暴露引用的材料:\n\n```\n{{#context#}}\n```\n\n"
  3. CHAT_APP_COMPLETION_PROMPT_CONFIG = {
  4. "completion_prompt_config": {
  5. "prompt": {
  6. "text": "{{#pre_prompt#}}\nHere is the chat histories between human and assistant, inside <histories></histories> XML tags.\n\n<histories>\n{{#histories#}}\n</histories>\n\n\nHuman: {{#query#}}\n\nAssistant: "
  7. },
  8. "conversation_histories_role": {
  9. "user_prefix": "Human",
  10. "assistant_prefix": "Assistant"
  11. }
  12. },
  13. "stop": ["Human:"]
  14. }
  15. CHAT_APP_CHAT_PROMPT_CONFIG = {
  16. "chat_prompt_config": {
  17. "prompt": [{
  18. "role": "system",
  19. "text": "{{#pre_prompt#}}"
  20. }]
  21. }
  22. }
  23. COMPLETION_APP_CHAT_PROMPT_CONFIG = {
  24. "chat_prompt_config": {
  25. "prompt": [{
  26. "role": "user",
  27. "text": "{{#pre_prompt#}}"
  28. }]
  29. }
  30. }
  31. COMPLETION_APP_COMPLETION_PROMPT_CONFIG = {
  32. "completion_prompt_config": {
  33. "prompt": {
  34. "text": "{{#pre_prompt#}}"
  35. }
  36. },
  37. "stop": ["Human:"]
  38. }
  39. BAICHUAN_CHAT_APP_COMPLETION_PROMPT_CONFIG = {
  40. "completion_prompt_config": {
  41. "prompt": {
  42. "text": "{{#pre_prompt#}}\n\n用户和助手的历史对话内容如下:\n```\n{{#histories#}}\n```\n\n\n\n用户:{{#query#}}"
  43. },
  44. "conversation_histories_role": {
  45. "user_prefix": "用户",
  46. "assistant_prefix": "助手"
  47. }
  48. },
  49. "stop": ["用户:"]
  50. }
  51. BAICHUAN_CHAT_APP_CHAT_PROMPT_CONFIG = {
  52. "chat_prompt_config": {
  53. "prompt": [{
  54. "role": "system",
  55. "text": "{{#pre_prompt#}}"
  56. }]
  57. }
  58. }
  59. BAICHUAN_COMPLETION_APP_CHAT_PROMPT_CONFIG = {
  60. "chat_prompt_config": {
  61. "prompt": [{
  62. "role": "user",
  63. "text": "{{#pre_prompt#}}"
  64. }]
  65. }
  66. }
  67. BAICHUAN_COMPLETION_APP_COMPLETION_PROMPT_CONFIG = {
  68. "completion_prompt_config": {
  69. "prompt": {
  70. "text": "{{#pre_prompt#}}"
  71. }
  72. },
  73. "stop": ["用户:"]
  74. }