修改 LLM 配置¶
POST /api/v1/llm_cfg/{appid}/modify
概述¶
修改指定 LLM 应用配置,支持改名、改 appId、改 site、改扩展配置和更换 token
路由参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| appid | string | Y | 待修改的 LLM 应用 appId |
Body 请求参数¶
| 参数名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| newAppId | string | 新的 appId,不传则保持原值;仅支持字母、数字、下划线 允许为空: False 允许为空字符串: True $maxCharacterLength: 128 |
|
| jsonContent | json | JSON 格式内容 |
|
| jsonContent.name | string | 应用名称,同一工作空间内唯一 允许为空: False 最大长度: 256 |
|
| jsonContent.type | string | 应用类型,当前仅支持 Langfuse允许为空: False 可选值: ['Langfuse'] |
|
| jsonContent.site | string | 站点地址 允许为空: False |
|
| jsonContent.extend | json | 其他扩展设置,原样存入 jsonContent.extend允许为空: False |
|
| clientToken | string | 新的 clientToken,不传则保持原 token 允许为空: False 允许为空字符串: True |
参数补充说明¶
接口说明¶
修改指定 appid 对应的 LLM 应用。
修改规则¶
newAppId可选,不传则保持原appIdjsonContent为局部更新clientToken可选,不传则保持原 token- 若传
newAppId,仅支持字母、数字、下划线
当前支持更新的 jsonContent 字段如下:
| 字段 | 说明 |
|---|---|
name |
应用名称 |
type |
应用类型 |
site |
站点地址 |
extend |
扩展配置 |
返回说明¶
- 成功后返回修改后的完整对象
clientToken返回实际 token 字符串- 若未传新 token,返回值中的
clientToken仍为原 token
典型场景¶
- 调整展示名
- 变更对接站点地址
- 旋转 client token
- 规范化 appId
错误语义¶
ft.InvalidLlmAppuuid:原始appid不存在ft.InvalidLlmAppId:newAppId包含非法字符ft.SignNameRepeat:newAppId与其他应用重复ft.LlmCfgNameRepeat:新名称重复
请求例子¶
curl 'https://openapi.guance.com/api/v1/llm_cfg/llm_app_demo/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"newAppId":"llm_app_demo_v2","jsonContent":{"name":"Langfuse Prod V2","site":"https://cloud.langfuse.com"}}' \
--compressed
响应¶
{
"code": 200,
"content": {
"appId": "llm_app_demo_v2",
"createAt": 1690813059,
"creator": "acnt_xxxx32",
"deleteAt": -1,
"id": 1,
"jsonContent": {
"name": "Langfuse Prod V2",
"type": "Langfuse",
"site": "https://cloud.langfuse.com",
"extend": {
"service": "prod"
}
},
"status": 0,
"updateAt": 1690813174.8154745,
"updator": "acnt_xxxx32",
"uuid": "llm_app_demo_v2",
"workspaceUUID": "wksp_xxxx32",
"clientToken": "token_xxx"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-68EEEB4A-9ABC-4DDB-A72B-40F07F2699A5"
}