mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix(ui): explicit CacheSavePayloadValue typing for flatMap return
This commit is contained in:
parent
5abd7d469e
commit
4e611b238a
2 changed files with 4 additions and 4 deletions
|
|
@ -2,7 +2,7 @@ import { CACHE_FIELDS, CacheField, CacheSection, RedisType } from "./cacheSettin
|
|||
|
||||
export type CacheFormValue = string | number | boolean | undefined;
|
||||
export type CacheFormValues = Record<string, CacheFormValue>;
|
||||
export type CacheSavePayloadValue = string | number | boolean | unknown[];
|
||||
export type CacheSavePayloadValue = string | number | boolean | unknown[] | null;
|
||||
export type CacheSavePayload = Record<string, CacheSavePayloadValue>;
|
||||
|
||||
export const isFieldVisible = (field: CacheField, redisType: RedisType): boolean =>
|
||||
|
|
@ -80,10 +80,10 @@ export const buildCachePayload = (
|
|||
}).flatMap((field) => {
|
||||
// Send explicit null to clear semantic fields when semantic caching is disabled
|
||||
if (field.section === "semantic" && !semanticEnabled) {
|
||||
return [[field.name, null] as const];
|
||||
return [[field.name, null] as [string, CacheSavePayloadValue]];
|
||||
}
|
||||
const value = saveValueForField(field, values[field.name]);
|
||||
return value === undefined ? [] : [[field.name, value] as const];
|
||||
return value === undefined ? [] : [[field.name, value] as [string, CacheSavePayloadValue]];
|
||||
});
|
||||
|
||||
return { type, ...Object.fromEntries(entries) };
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue