diff --git a/api_doc/README.md b/api_doc/README.md index bcdf5ab..7c64dce 100644 --- a/api_doc/README.md +++ b/api_doc/README.md @@ -10,7 +10,8 @@ ## 基本信息 - API 版本:v1 -- 默认后端地址(本地):`http://localhost:8091` +- 默认后端地址(生产示例):`https://agent.cyjai.com` + (本地开发仍可用 `http://localhost:8091`,按需替换) - 鉴权方式:`Authorization: Bearer ` - API 前缀:`/api/v1` - 数据落盘:对话与文件落盘到 API 用户独立目录(见 `auth.md`) @@ -47,7 +48,7 @@ ## 快速开始(curl) > 将 `` 替换为你的 Bearer Token。 -> 默认后端:`http://localhost:8091`,如不同请修改。 +> 默认后端:`https://agent.cyjai.com`,本地调试请改为 `http://localhost:8091`。 ### 0)创建工作区 @@ -56,7 +57,7 @@ curl -sS -X POST \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "workspace_id": "ws1" }' \ - http://localhost:8091/api/v1/workspaces + https://agent.cyjai.com/api/v1/workspaces ``` ### 1)创建对话(指定工作区) @@ -64,7 +65,7 @@ curl -sS -X POST \ ```bash curl -sS -X POST \ -H "Authorization: Bearer " \ - http://localhost:8091/api/v1/workspaces/ws1/conversations + https://agent.cyjai.com/api/v1/workspaces/ws1/conversations ``` 返回示例: @@ -86,7 +87,7 @@ curl -sS -X POST \ "model_key": null, "max_iterations": 100 # 默认 100,示例显式填写便于对齐 }' \ - http://localhost:8091/api/v1/workspaces/ws1/messages + https://agent.cyjai.com/api/v1/workspaces/ws1/messages ``` 返回示例(202): @@ -109,7 +110,7 @@ curl -sS -X POST \ ```bash curl -sS \ -H "Authorization: Bearer " \ - "http://localhost:8091/api/v1/tasks/60322db3-f884-4a1e-a9b3-6eeb07fbab47?from=0" + "https://agent.cyjai.com/api/v1/tasks/60322db3-f884-4a1e-a9b3-6eeb07fbab47?from=0" ``` ### 3)停止任务(可选) @@ -117,7 +118,7 @@ curl -sS \ ```bash curl -sS -X POST \ -H "Authorization: Bearer " \ - http://localhost:8091/api/v1/tasks/60322db3-f884-4a1e-a9b3-6eeb07fbab47/cancel + https://agent.cyjai.com/api/v1/tasks/60322db3-f884-4a1e-a9b3-6eeb07fbab47/cancel ``` ## 统一约定:响应结构与错误处理 diff --git a/api_doc/examples.md b/api_doc/examples.md index 9ebedad..d300248 100644 --- a/api_doc/examples.md +++ b/api_doc/examples.md @@ -1,6 +1,6 @@ # 示例(curl / Python / JS / Flutter) -默认服务端:`http://localhost:8091` +默认服务端:`https://agent.cyjai.com` 通用 Header: @@ -16,7 +16,7 @@ ## 1) curl:完整流程(工作区 + 对话 + 发送 + 轮询) ```bash -BASE_URL="http://localhost:8091" +BASE_URL="https://agent.cyjai.com" TOKEN="" WS="ws1" @@ -77,7 +77,7 @@ done import time import requests -BASE_URL = "http://localhost:8091" +BASE_URL = "https://agent.cyjai.com" TOKEN = "" WS = "ws1" @@ -129,7 +129,7 @@ while True: ## 3) JS:fetch(浏览器/Node) ```js -const BASE_URL = "http://localhost:8091"; +const BASE_URL = "https://agent.cyjai.com"; const TOKEN = ""; const WS = "ws1"; @@ -169,7 +169,7 @@ for (;;) { import 'dart:convert'; import 'package:http/http.dart' as http; -const baseUrl = "http://localhost:8091"; +const baseUrl = "https://agent.cyjai.com"; const token = ""; const ws = "ws1"; diff --git a/api_doc/files.md b/api_doc/files.md index 27e56fb..bdcc3d6 100644 --- a/api_doc/files.md +++ b/api_doc/files.md @@ -93,7 +93,7 @@ curl -sS -X POST \ -H "Authorization: Bearer " \ -F "file=@hello.txt" \ -F "dir=inputs" \ - http://localhost:8091/api/v1/workspaces/ws1/files/upload + https://agent.cyjai.com/api/v1/workspaces/ws1/files/upload ``` 列出 `ws1/user_upload/inputs`: @@ -101,7 +101,7 @@ curl -sS -X POST \ ```bash curl -sS \ -H "Authorization: Bearer " \ - "http://localhost:8091/api/v1/workspaces/ws1/files?path=inputs" + "https://agent.cyjai.com/api/v1/workspaces/ws1/files?path=inputs" ``` 下载目录 `ws1/user_upload/inputs`: @@ -109,6 +109,6 @@ curl -sS \ ```bash curl -L -o inputs.zip \ -H "Authorization: Bearer " \ - "http://localhost:8091/api/v1/workspaces/ws1/files/download?path=inputs" + "https://agent.cyjai.com/api/v1/workspaces/ws1/files/download?path=inputs" ``` diff --git a/api_doc/openapi.yaml b/api_doc/openapi.yaml index 4e961f1..04f12fe 100644 --- a/api_doc/openapi.yaml +++ b/api_doc/openapi.yaml @@ -9,7 +9,7 @@ info: - 事件流:与网页端 WebSocket 同粒度(text_chunk、tool_start 等) - 多工作区:所有对话/消息/文件都在指定 workspace 下进行 servers: - - url: http://localhost:8091 + - url: https://agent.cyjai.com components: securitySchemes: