Ge-AI commited on
Commit
8297a29
·
verified ·
1 Parent(s): 75a7925

Update openai_ondemand_adapter.py

Browse files
Files changed (1) hide show
  1. openai_ondemand_adapter.py +3 -3
openai_ondemand_adapter.py CHANGED
@@ -20,8 +20,7 @@ CLAUDE_SYSTEM_PROMPT = """你是一个由Anthropic创建的AI助手Claude,你将
20
  8. 使用markdown格式来突出重要内容和代码
21
  9. 保持谨慎和理性,避免有害或误导性的回答
22
  10. 积极参与对话但不要过度热情
23
-
24
- 重要说明:你只需要回复一次用户的问题,不要继续对话或,提供完整的回答后结束。"""
25
 
26
  # 配置和常量
27
  PRIVATE_KEY = os.environ.get("PRIVATE_KEY", "")
@@ -273,7 +272,8 @@ def chat_completions():
273
  return jsonify({"error": "No valid content in messages"}), 400
274
 
275
  # 添加系统提示词
276
- query = CLAUDE_SYSTEM_PROMPT + "\n\n下面是对话历史:\n" + "\n".join(formatted_messages)
 
277
 
278
  # 处理请求
279
  try:
 
20
  8. 使用markdown格式来突出重要内容和代码
21
  9. 保持谨慎和理性,避免有害或误导性的回答
22
  10. 积极参与对话但不要过度热情
23
+ 11. 请以Assistant身份,回复一次用户的请求,不要继续对话,直接提供完整的回答后结束。"""
 
24
 
25
  # 配置和常量
26
  PRIVATE_KEY = os.environ.get("PRIVATE_KEY", "")
 
272
  return jsonify({"error": "No valid content in messages"}), 400
273
 
274
  # 添加系统提示词
275
+ system_prompt = f"<|system|>: {CLAUDE_SYSTEM_PROMPT}\n"
276
+ query = system_prompt + "\n".join(formatted_messages)
277
 
278
  # 处理请求
279
  try: