Browse Source

Update 'README.md'

天问 1 year ago
parent
commit
24f8042063
1 changed files with 10 additions and 3 deletions
  1. 10 3
      README.md

+ 10 - 3
README.md

@@ -31,7 +31,10 @@ chat_completion = client.chat.completions.create(
 异步:
 ```
 import asyncio
-from openai import AsyncOpenAI
+from openai import AsyncOpenAI, APIStatusError, AsyncStream
+from openai.types.chat import (
+    ChatCompletionChunk,
+)
 client = AsyncOpenAI()
 
 async def main() -> None:
@@ -64,7 +67,7 @@ for part in stream:
     print(part.choices[0].delta.content or "")
 ```
 
-在notebook中这样写比较好(notebook 不方便写.env等web应用):
+在 notebook 中这样写比较好(notebook 不方便写.env等web应用):
 ```
 openai.api_key = '...'
 
@@ -97,7 +100,7 @@ client.files.create(
 )
 ```
 
-支持调用 AzureOpenAI,公用相同接口
+支持调用 **AzureOpenAI**,公用相同接口
 
 ```
 from openai import AzureOpenAI
@@ -120,3 +123,7 @@ completion = client.chat.completions.create(
 print(completion.model_dump_json(indent=2))
 ```
 
+
+
+
+