junli16 commited on
Commit
56b484b
·
verified ·
1 Parent(s): 9a68c94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -23
app.py CHANGED
@@ -17,29 +17,6 @@ import json
17
  import time
18
  import re
19
 
20
- import os
21
- from openai import OpenAI
22
-
23
- client = OpenAI(
24
- # 使用你提供的API Key
25
- api_key="sk-757ddbeab14343dd80d270c418e7ed74",
26
- base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
27
- )
28
- completion = client.chat.completions.create(
29
- model="qwen3-max",
30
- messages=[
31
- {"role": "system", "content": "You are a helpful assistant."},
32
- {"role": "user", "content": "你是谁?"},
33
- ],
34
- stream=True
35
- )
36
- for chunk in completion:
37
- # 处理可能的空内容(避免NoneType错误)
38
- if chunk.choices[0].delta.content:
39
- print(chunk.choices[0].delta.content, end="", flush=True)
40
-
41
-
42
-
43
 
44
 
45
 
 
17
  import time
18
  import re
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
 
22