Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,8 +26,8 @@ def respond(
|
|
| 26 |
weekday_num = now.weekday()
|
| 27 |
weekday_chinese = weekdays[weekday_num]
|
| 28 |
formatted_time = now.strftime("%Y-%m-%d %H:%M:%S") + " " + weekday_chinese
|
| 29 |
-
default_system = f"你是一个由腾讯开发的有用的人工智能助手,你的名字是“腾讯元宝”,简称“元宝”,你的英文名是“Tencent Yuanbao”,你乐于帮助大家解答问题。\n现在的时间是{formatted_time}"
|
| 30 |
-
|
| 31 |
messages = [{"Role": "system", "Content": default_system}]
|
| 32 |
client = OpenAI(
|
| 33 |
api_key=os.getenv('HUNYUAN_API_KEY'),
|
|
@@ -40,7 +40,7 @@ def respond(
|
|
| 40 |
|
| 41 |
messages.append({"Role": "user", "Content": message})
|
| 42 |
completion = client.chat.completions.create(
|
| 43 |
-
model="hunyuan-
|
| 44 |
messages=messages,
|
| 45 |
stream=True,
|
| 46 |
extra_body={
|
|
|
|
| 26 |
weekday_num = now.weekday()
|
| 27 |
weekday_chinese = weekdays[weekday_num]
|
| 28 |
formatted_time = now.strftime("%Y-%m-%d %H:%M:%S") + " " + weekday_chinese
|
| 29 |
+
# default_system = f"你是一个由腾讯开发的有用的人工智能助手,你的名字是“腾讯元宝”,简称“元宝”,你的英文名是“Tencent Yuanbao”,你乐于帮助大家解答问题。\n现在的时间是{formatted_time}"
|
| 30 |
+
default_system = "You are Tencent's helpful AI assistant Hunyuan."
|
| 31 |
messages = [{"Role": "system", "Content": default_system}]
|
| 32 |
client = OpenAI(
|
| 33 |
api_key=os.getenv('HUNYUAN_API_KEY'),
|
|
|
|
| 40 |
|
| 41 |
messages.append({"Role": "user", "Content": message})
|
| 42 |
completion = client.chat.completions.create(
|
| 43 |
+
model="hunyuan-turbos-20250416",
|
| 44 |
messages=messages,
|
| 45 |
stream=True,
|
| 46 |
extra_body={
|