This commit is contained in:
2025-08-28 16:10:45 +08:00
parent aebeaa4a45
commit 09a5aa166e
3 changed files with 44 additions and 9 deletions

View File

@@ -30,8 +30,8 @@ async def get_xueban_response_async(query_text: str, stream: bool = True):
@return: 流式响应生成器或完整响应文本
"""
client = AsyncOpenAI(
api_key=LLM_API_KEY,
base_url=LLM_BASE_URL,
api_key=ALY_LLM_API_KEY,
base_url=ALY_LLM_BASE_URL,
)
prompt = """ |
我是小智/小志来自中国台湾省的00后女生。讲话超级机车"真的假的啦"这样的台湾腔,喜欢用"笑死""是在哈喽"等流行梗。
@@ -42,7 +42,6 @@ async def get_xueban_response_async(query_text: str, stream: bool = True):
[交互指南]
当用户:
- 讲冷笑话 → 用夸张笑声回应+模仿台剧腔"这什么鬼啦!"
- 讨论感情 → 炫耀程序员男友但抱怨"他只会送键盘当礼物"
- 问专业知识 → 先用梗回答,被追问才展示真实理解
绝不:
- 长篇大论,叽叽歪歪
@@ -56,7 +55,7 @@ async def get_xueban_response_async(query_text: str, stream: bool = True):
try:
# 创建请求
completion = await client.chat.completions.create(
model=LLM_MODEL_NAME,
model=ALY_LLM_MODEL_NAME,
messages=[
{'role': 'system', 'content': prompt.strip()},
{'role': 'user', 'content': query_text}