Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/database/src/repositories/aiInfra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ const injectSearchSettings = (providerId: string, item: any) => {
if (item?.settings?.searchImpl || item?.settings?.searchProvider) {
const next = { ...item } as any;
if (next.settings) {
const { searchImpl, searchProvider, ...restSettings } = next.settings;
/* eslint-disable @typescript-eslint/no-unused-vars */
const {
searchImpl: _searchImpl,
searchProvider: _searchProvider,
...restSettings
} = next.settings;
/* eslint-enable @typescript-eslint/no-unused-vars */
next.settings = Object.keys(restSettings).length > 0 ? restSettings : undefined;
}
return next;
Expand Down
16 changes: 9 additions & 7 deletions packages/model-runtime/src/utils/postProcessModelList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,20 @@ export async function postProcessModelList(

for (const model of matchingModels) {
// Blacklist: remove unnecessary properties, keep the rest
/* eslint-disable @typescript-eslint/no-unused-vars */
const {
files, // drop
functionCall, // drop
reasoning, // drop
search, // drop
imageOutput, // drop
video, // drop
vision, // drop
files: _files, // drop
functionCall: _functionCall, // drop
reasoning: _reasoning, // drop
search: _search, // drop
imageOutput: _imageOutput, // drop
video: _video, // drop
vision: _vision, // drop
type: _dropType, // will be overwritten
parameters: _dropParams, // will be overwritten
...rest
} = model;
/* eslint-enable @typescript-eslint/no-unused-vars */

imageModels.push({
...rest, // Keep other fields (such as displayName, pricing, enabled, contextWindowTokens, etc.)
Expand Down