diff --git a/docs/docs/api/app.md b/docs/docs/api/app.md index 3a0105543..3d7a9953b 100644 --- a/docs/docs/api/app.md +++ b/docs/docs/api/app.md @@ -48,7 +48,14 @@ DBGPT_API_KEY = "dbgpt" APP_ID="{YOUR_APP_ID}" client = Client(api_key=DBGPT_API_KEY) -response = client.chat_stream(messages="Introduce AWEL", model="chatgpt_proxyllm", chat_mode="chat_app", chat_param=APP_ID) + +async for data in client.chat_stream( + messages="Introduce AWEL", + model="chatgpt_proxyllm", + chat_mode="chat_app", + chat_param=APP_ID): + print(data) + ``` diff --git a/docs/docs/api/chat.md b/docs/docs/api/chat.md index 5ea2d8ef6..55284a28e 100644 --- a/docs/docs/api/chat.md +++ b/docs/docs/api/chat.md @@ -45,8 +45,12 @@ import TabItem from '@theme/TabItem'; from dbgpt.client.client import Client DBGPT_API_KEY = "dbgpt" -client = Client(api_key=DBGPT_API_KEY) -response = client.chat_stream(messages="Hello", model="chatgpt_proxyllm") + +async for data in client.chat_stream( + model="chatgpt_proxyllm", + messages="hello", +): + print(data) ``` @@ -104,7 +108,7 @@ from dbgpt.client.client import Client DBGPT_API_KEY = "dbgpt" client = Client(api_key=DBGPT_API_KEY) -response = client.chat(messages="Hello", model="chatgpt_proxyllm") +response = await client.chat(model="chatgpt_proxyllm" ,messages="hello") ``` diff --git a/docs/docs/api/flow.md b/docs/docs/api/flow.md index 8e4173139..ae649839b 100644 --- a/docs/docs/api/flow.md +++ b/docs/docs/api/flow.md @@ -48,7 +48,12 @@ DBGPT_API_KEY = "dbgpt" FLOW_ID="{YOUR_FLOW_ID}" client = Client(api_key=DBGPT_API_KEY) -response = client.chat_stream(messages="Hello", model="chatgpt_proxyllm", chat_mode="chat_flow", chat_param=FLOW_ID) +async for data in client.chat_stream( + messages="Introduce AWEL", + model="chatgpt_proxyllm", + chat_mode="chat_flow", + chat_param=FLOW_ID): + print(data) ``` diff --git a/docs/docs/api/knowledge.md b/docs/docs/api/knowledge.md index ef3818bb0..688add674 100644 --- a/docs/docs/api/knowledge.md +++ b/docs/docs/api/knowledge.md @@ -47,7 +47,13 @@ DBGPT_API_KEY = "dbgpt" SPACE_NAME="{YOUR_SPACE_NAME}" client = Client(api_key=DBGPT_API_KEY) -response = client.chat_stream(messages="Hello", model="chatgpt_proxyllm", chat_mode="chat_knowledge", chat_param=SPACE_NAME) + +async for data in client.chat_stream( + messages="Introduce AWEL", + model="chatgpt_proxyllm", + chat_mode="chat_knowledge", + chat_param=SPACE_NAME): + print(data) ```