mirror of
https://github.com/QwenLM/Qwen.git
synced 2026-05-20 16:35:47 +08:00
update readme
This commit is contained in:
12
README_JA.md
12
README_JA.md
@@ -328,6 +328,8 @@ APIの使い方も簡単だ。以下の例をご覧ください:
|
||||
import openai
|
||||
openai.api_base = "http://localhost:8000/v1"
|
||||
openai.api_key = "none"
|
||||
|
||||
# create a request activating streaming response
|
||||
for chunk in openai.ChatCompletion.create(
|
||||
model="Qwen-7B",
|
||||
messages=[
|
||||
@@ -337,6 +339,16 @@ for chunk in openai.ChatCompletion.create(
|
||||
):
|
||||
if hasattr(chunk.choices[0].delta, "content"):
|
||||
print(chunk.choices[0].delta.content, end="", flush=True)
|
||||
|
||||
# create a request not activating streaming response
|
||||
response = openai.ChatCompletion.create(
|
||||
model="Qwen-7B",
|
||||
messages=[
|
||||
{"role": "user", "content": "你好"}
|
||||
],
|
||||
stream=False
|
||||
)
|
||||
print(response.choices[0].message.content)
|
||||
```
|
||||
|
||||
## ツールの使用
|
||||
|
||||
Reference in New Issue
Block a user