quivr/frontend/lib/helpers/setEmptyStringsUndefined.ts
Mamadou DICKO 6ff9309082
Feat/model config (#223)
* feat(axios): add global manager

* feat: add config page

* feat(axios): add backendUrl overwrite

* feat(brainConfig): add supabase url overwrite

* feat(chat): change model config logic + add more model

* feat: add openai and anthropic api key overwrite

* feat(config): save config in local storage

* feat(config): add reset button

* feat: move vertexai to config page

* ui: add brain config icon
2023-06-02 17:01:49 +02:00

12 lines
228 B
TypeScript

export const setEmptyStringsUndefined = (
obj: Record<string, unknown>
): Record<string, unknown> => {
Object.keys(obj).forEach((key) => {
if (obj[key] === "") {
obj[key] = undefined;
}
});
return obj;
};