mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-07 12:00:46 +00:00
feat(client): Modify api address
This commit is contained in:
@@ -1,25 +1,20 @@
|
||||
"""Client: Simple App CRUD example.
|
||||
|
||||
This example demonstrates how to use the dbgpt client to get, list apps.
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
DBGPT_API_KEY = "dbgpt"
|
||||
client = Client(api_key=DBGPT_API_KEY)
|
||||
# 1. List all apps
|
||||
res = await list_app(client)
|
||||
# 2. Get an app
|
||||
res = await get_app(client, app_id="bf1c7561-13fc-4fe0-bf5d-c22e724766a8")
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
from dbgpt.client import Client
|
||||
from dbgpt.client.app import list_app
|
||||
from dbgpt.client.client import Client
|
||||
|
||||
"""
|
||||
Client: Simple App CRUD example
|
||||
|
||||
This example demonstrates how to use the dbgpt client to get, list apps.
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
DBGPT_API_KEY = "dbgpt"
|
||||
client = Client(api_key=DBGPT_API_KEY)
|
||||
# 1. List all apps
|
||||
res = await list_app(client)
|
||||
# 2. Get an app
|
||||
res = await get_app(
|
||||
client, app_id="bf1c7561-13fc-4fe0-bf5d-c22e724766a8"
|
||||
)
|
||||
|
||||
"""
|
||||
|
||||
|
||||
async def main():
|
||||
|
@@ -1,13 +1,8 @@
|
||||
import asyncio
|
||||
"""Client: Simple Chat example.
|
||||
|
||||
from dbgpt.client.client import Client
|
||||
This example demonstrates how to use the dbgpt client to chat with the chatgpt model.
|
||||
|
||||
"""
|
||||
Client: Simple Chat example
|
||||
|
||||
This example demonstrates how to use the dbgpt client to chat with the chatgpt model.
|
||||
|
||||
Example:
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
DBGPT_API_KEY = "dbgpt"
|
||||
@@ -53,6 +48,10 @@ Client: Simple Chat example
|
||||
print(data.dict())
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
|
||||
from dbgpt.client import Client
|
||||
|
||||
|
||||
async def main():
|
||||
# initialize client
|
||||
|
@@ -1,38 +1,36 @@
|
||||
"""Client: Simple Flow CRUD example
|
||||
|
||||
This example demonstrates how to use the dbgpt client to create, get, update, and
|
||||
delete flows.
|
||||
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
DBGPT_API_KEY = "dbgpt"
|
||||
client = Client(api_key=DBGPT_API_KEY)
|
||||
# 1. Create a flow
|
||||
res = await create_flow(
|
||||
client,
|
||||
FlowPanel(name="test_flow", desc="for client flow", owner="dbgpt"),
|
||||
)
|
||||
# 2. Update a flow
|
||||
res = await update_flow(
|
||||
client,
|
||||
FlowPanel(name="test_flow", desc="for client flow333", owner="dbgpt"),
|
||||
)
|
||||
# 3. Delete a flow
|
||||
res = await delete_flow(client, flow_id="bf1c7561-13fc-4fe0-bf5d-c22e724766a8")
|
||||
# 4. Get a flow
|
||||
res = await get_flow(client, flow_id="bf1c7561-13fc-4fe0-bf5d-c22e724766a8")
|
||||
# 5. List all flows
|
||||
res = await list_flow(client)
|
||||
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
from dbgpt.client.client import Client
|
||||
from dbgpt.client import Client
|
||||
from dbgpt.client.flow import list_flow
|
||||
|
||||
"""
|
||||
Client: Simple Flow CRUD example
|
||||
|
||||
This example demonstrates how to use the dbgpt client to create, get, update, and delete flows.
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
DBGPT_API_KEY = "dbgpt"
|
||||
client = Client(api_key=DBGPT_API_KEY)
|
||||
# 1. Create a flow
|
||||
res = await create_flow(
|
||||
client,
|
||||
FlowPanel(name="test_flow", desc="for client flow", owner="dbgpt"),
|
||||
)
|
||||
# 2. Update a flow
|
||||
res = await update_flow(
|
||||
client,
|
||||
FlowPanel(name="test_flow", desc="for client flow333", owner="dbgpt"),
|
||||
)
|
||||
# 3. Delete a flow
|
||||
res = await delete_flow(
|
||||
client, flow_id="bf1c7561-13fc-4fe0-bf5d-c22e724766a8"
|
||||
)
|
||||
# 4. Get a flow
|
||||
res = await get_flow(client, flow_id="bf1c7561-13fc-4fe0-bf5d-c22e724766a8")
|
||||
# 5. List all flows
|
||||
res = await list_flow(client)
|
||||
|
||||
"""
|
||||
|
||||
|
||||
async def main():
|
||||
# initialize client
|
||||
|
@@ -1,13 +1,9 @@
|
||||
import asyncio
|
||||
"""Client: Simple Knowledge CRUD example.
|
||||
|
||||
from dbgpt.client.client import Client
|
||||
from dbgpt.client.knowledge import create_space
|
||||
from dbgpt.client.schemas import SpaceModel
|
||||
This example demonstrates how to use the dbgpt client to create, get, update, and
|
||||
delete knowledge spaces and documents.
|
||||
|
||||
"""Client: Simple Knowledge CRUD example
|
||||
|
||||
This example demonstrates how to use the dbgpt client to create, get, update, and delete knowledge spaces and documents.
|
||||
Example:
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
DBGPT_API_KEY = "dbgpt"
|
||||
@@ -66,6 +62,11 @@ from dbgpt.client.schemas import SpaceModel
|
||||
# 10. Delete a document
|
||||
res = await delete_document(client, "150")
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
from dbgpt.client import Client
|
||||
from dbgpt.client.knowledge import create_space
|
||||
from dbgpt.client.schemas import SpaceModel
|
||||
|
||||
|
||||
async def main():
|
||||
|
Reference in New Issue
Block a user