LLM 設定の変更¶
POST /api/v1/llm_cfg/{appid}/modify
概要¶
指定した LLM アプリケーションの設定を変更します。名前、appId、site、拡張設定の変更およびトークンの交換に対応しています。
ルートパラメータ¶
| パラメータ名 | 型 | 必須 | 説明 |
|---|---|---|---|
| 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。指定しない場合は元のトークンを保持します。 空を許可: False 空文字列を許可: True |
パラメータ補足説明¶
API の説明¶
指定された appid に対応する LLM アプリケーションを変更します。
変更ルール¶
newAppIdはオプションです。指定しない場合は元のappIdを保持します。jsonContentは部分更新です。clientTokenはオプションです。指定しない場合は元のトークンを保持します。newAppIdを指定する場合、英数字とアンダースコアのみ使用可能です。
現在更新可能な jsonContent フィールドは以下の通りです。
| フィールド | 説明 |
|---|---|
name |
アプリケーション名 |
type |
アプリケーションタイプ |
site |
サイトアドレス |
extend |
拡張設定 |
戻り値の説明¶
- 成功すると、変更後の完全なオブジェクトが返されます。
clientTokenには実際のトークン文字列が返されます。- 新しいトークンを指定しなかった場合、戻り値の
clientTokenは元のトークンのままです。
代表的なユースケース¶
- 表示名の調整
- 連携先サイトアドレスの変更
- 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"
}