fix(knowledge): 修正 getConnector 不返回 fileConnectorConfig 问题

- 移除 collection-get 命令中对 fileConnectorConfig 字段的输出
- 文档中补充说明 getConnector 不返回 storeType、regionId、bucketName 等字段
- 更新类型定义,去除 RagConnectorInfo 中的 fileConnectorConfig 字段
- 明确这些字段只在创建连接时请求体中传入,查询时不可读取
This commit is contained in:
zeyu.fz
2026-08-14 11:21:44 +08:00
parent b7a4efe619
commit eb4f9af3e7
3 changed files with 4 additions and 21 deletions
+1 -4
View File
@@ -93,18 +93,15 @@ text 模式:
id: conn-xxx
name: my-collection
description: team docs
storeType: PLATFORM
```
> 如果是 `CUSTOM` 存储,额外显示 `ossRegion` 和 `ossBucket`(注意:实测 getConnector 响应可能不返回 fileConnectorConfig,storeType 显示为 `-`)。
quiet 模式:输出集合 ID。
json 模式:返回 API 原始响应。
**注意事项**
- 无特殊注意事项。
- getConnector 不返回 `fileConnectorConfig`(`storeType`/`regionId`/`bucketName`),这些字段仅在创建时通过请求体传入,查询时不可读回。
**示例**
@@ -66,15 +66,8 @@ export default defineCommand({
emitBare(`id: ${collection?.connectorId ?? "-"}`);
emitBare(`name: ${collection?.connectorName ?? "-"}`);
emitBare(`description: ${collection?.description ?? "-"}`);
const storeType = collection?.fileConnectorConfig?.storeType;
emitBare(`storeType: ${storeType ?? "-"}`);
if (storeType === "CUSTOM") {
// Defensive branch: live-verified getConnector responses do NOT echo
// fileConnectorConfig at all (storeType prints "-"); kept in case the
// server starts returning it. Field names follow the create contract.
emitBare(` ossRegion: ${collection?.fileConnectorConfig?.regionId ?? "-"}`);
emitBare(` ossBucket: ${collection?.fileConnectorConfig?.bucketName ?? "-"}`);
}
// getConnector does not return fileConnectorConfig (storeType/regionId/bucketName);
// these fields are only available on the create request body.
return;
}
emitResult(response, format);
+1 -8
View File
@@ -324,19 +324,12 @@ export interface RagListFileData {
export type RagListFileResponse = RagConnectorResponse<RagListFileData>;
export type RagDescribeFileResponse = RagConnectorResponse<RagDataCenterFile>;
/** POST addConnector / getConnector */
/** POST addConnector response / getConnector response — server does NOT echo fileConnectorConfig (live-verified) */
export interface RagConnectorInfo {
connectorId?: string;
connectorName?: string;
description?: string;
connectorType?: string;
fileConnectorConfig?: {
storeType?: string;
/** CUSTOM request fields: regionId/bucketName (per add-connector.md, live-verified) */
regionId?: string;
bucketName?: string;
[key: string]: unknown;
};
[key: string]: unknown;
}
export type RagAddConnectorResponse = RagConnectorResponse<RagConnectorInfo>;