跳到主要内容
版本:v0.6.1

App

Get started with the App API

Chat App

POST /api/v2/chat/completions

Examples

Stream Chat App

from dbgpt.client import Client

DBGPT_API_KEY = "dbgpt"
APP_ID="{YOUR_APP_ID}"

client = Client(api_key=DBGPT_API_KEY)

async for data in client.chat_stream(
messages="Introduce AWEL",
model="chatgpt_proxyllm",
chat_mode="chat_app",
chat_param=APP_ID
):
print(data)

Chat Completion Stream Response

data: {"id": "109bfc28-fe87-452c-8e1f-d4fe43283b7d", "created": 1710919480, "model": "chatgpt_proxyllm", "choices": [{"index": 0, "delta": {"role": "assistant", "content": "```agent-plans\n[{\"name\": \"Introduce Awel\", \"num\": 2, \"status\": \"complete\", \"agent\": \"Human\", \"markdown\": \"```agent-messages\\n[{\\\"sender\\\": \\\"Summarizer\\\", \\\"receiver\\\": \\\"Human\\\", \\\"model\\\": \\\"chatgpt_proxyllm\\\", \\\"markdown\\\": \\\"Agentic Workflow Expression Language (AWEL) is a specialized language designed for developing large model applications with intelligent agent workflows. It offers flexibility and functionality, allowing developers to focus on business logic for LLMs applications without getting bogged down in model and environment details. AWEL uses a layered API design architecture, making it easier to work with. You can find examples and source code to get started with AWEL, and it supports various operators and environments. AWEL is a powerful tool for building native data applications through workflows and agents.\"}]\n```"}}]}

data: [DONE]

Get App

GET /api/v2/serve/apps/{app_id}
DBGPT_API_KEY=dbgpt
APP_ID={YOUR_APP_ID}
curl -X GET "http://localhost:5670/api/v2/serve/apps/$APP_ID" -H "Authorization: Bearer $DBGPT_API_KEY"

Query Parameters


app_id string Required

app id


Response body

Return App Object

List App

GET /api/v2/serve/apps
DBGPT_API_KEY=dbgpt

curl -X GET 'http://localhost:5670/api/v2/serve/apps' -H "Authorization: Bearer $DBGPT_API_KEY"

Response body

Return App Object List

The App Model


app_code string

unique app id


app_name string

app name


app_describe string

app describe


team_mode string

team mode


language string

language


team_context string

team context


user_code string

user code


sys_code string

sys code


is_collected string

is collected


icon string

icon


created_at string

created at


updated_at string

updated at


details string

app details List[AppDetailModel]


The App Detail Model


app_code string

app code


app_name string

app name


agent_name string

agent name


node_id string

node id


resources string

resources


prompt_template string

prompt template


llm_strategy string

llm strategy


llm_strategy_value string

llm strategy value


created_at string

created at


updated_at string

updated at