File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,8 +263,9 @@ export function AiProvidersVertexEditPage() {
263263 . map ( ( entry ) => {
264264 const name = entry . name . trim ( ) ;
265265 const alias = entry . alias . trim ( ) ;
266- if ( ! name || ! alias ) return null ;
267- return { name, alias } ;
266+ if ( ! name ) return null ;
267+ // Vertex 模型只要求填写模型名,别名是可选展示名;不填别名时也必须保存模型名。
268+ return alias ? { name, alias } : { name } ;
268269 } )
269270 . filter ( Boolean ) as ProviderKeyConfig [ 'models' ] ,
270271 excludedModels : parseExcludedModels ( form . excludedText ) ,
Original file line number Diff line number Diff line change @@ -104,8 +104,9 @@ const serializeVertexModelAliases = (models?: ModelAlias[]) =>
104104 . map ( ( model ) => {
105105 const name = typeof model ?. name === 'string' ? model . name . trim ( ) : '' ;
106106 const alias = typeof model ?. alias === 'string' ? model . alias . trim ( ) : '' ;
107- if ( ! name || ! alias ) return null ;
108- return { name, alias } ;
107+ if ( ! name ) return null ;
108+ // Vertex 模型只要求模型名;别名为空时仍然保存模型名,避免新增模型被序列化层丢弃。
109+ return alias ? { name, alias } : { name } ;
109110 } )
110111 . filter ( Boolean )
111112 : undefined ;
You can’t perform that action at this time.
0 commit comments