doc:update api docs

This commit is contained in:
aries_ckt 2024-03-20 21:37:52 +08:00
parent 75f086a41d
commit 01ea5f8064
4 changed files with 28 additions and 6 deletions

View File

@ -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)
```
</TabItem>
</Tabs>

View File

@ -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)
```
</TabItem>
</Tabs>
@ -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")
```
</TabItem>
</Tabs>

View File

@ -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)
```
</TabItem>
</Tabs>

View File

@ -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)
```
</TabItem>
</Tabs>