Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,6 @@ API_BASE_URL = "http://key.aistory.uk/v1/chat/completions" # 替换为你自己
|
|
| 6 |
API_KEY = "sk-HfD4NYIN6bq2DkSfIiUcciRvo9MkgMdFCsahP9NWEOUPHe8H" # 替换为你自己的 API 密钥
|
| 7 |
|
| 8 |
|
| 9 |
-
|
| 10 |
# 定义 AI 响应函数,调用第三方 API
|
| 11 |
def ai_response(message, chat_history):
|
| 12 |
# 定义系统提示词
|
|
@@ -20,7 +19,7 @@ def ai_response(message, chat_history):
|
|
| 20 |
|
| 21 |
# 构建请求体
|
| 22 |
payload = {
|
| 23 |
-
"model": "
|
| 24 |
"messages": conversation,
|
| 25 |
"max_tokens": 150
|
| 26 |
}
|
|
|
|
| 6 |
API_KEY = "sk-HfD4NYIN6bq2DkSfIiUcciRvo9MkgMdFCsahP9NWEOUPHe8H" # 替换为你自己的 API 密钥
|
| 7 |
|
| 8 |
|
|
|
|
| 9 |
# 定义 AI 响应函数,调用第三方 API
|
| 10 |
def ai_response(message, chat_history):
|
| 11 |
# 定义系统提示词
|
|
|
|
| 19 |
|
| 20 |
# 构建请求体
|
| 21 |
payload = {
|
| 22 |
+
"model": "gpt-4o", # 使用 gpt-4o 模型(如果此模型为该 API 支持的模型)
|
| 23 |
"messages": conversation,
|
| 24 |
"max_tokens": 150
|
| 25 |
}
|