🔧 fix: Error Handling Improvements (#1518)

* style(Icon): remove error bubble from message icon

* fix(custom): `initializeClient` now throws error if apiKey or baseURL are admin provided but no env var was found

* refactor(tPresetSchema): match `conversationId` type to `tConversationSchema` but optional, use `extendedModelEndpointSchema` for `endpoint`

* fix(useSSE): minor improvements
- use `completed` set to avoid submitting unecessary abort request
- set preset with `newConversation` calls using initial conversation settings to prevent default Preset override as well as default settings
- return if there is a parsing error within `onerror` as expected errors from server are properly formatted
This commit is contained in:
Danny Avila 2024-01-08 09:30:38 -05:00 committed by GitHub
parent c9aaf502af
commit ead1c3c797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 57 additions and 14 deletions

View file

@ -200,11 +200,12 @@ export const tPresetSchema = tConversationSchema
})
.merge(
z.object({
conversationId: z.string().optional(),
conversationId: z.string().nullable().optional(),
presetId: z.string().nullable().optional(),
title: z.string().nullable().optional(),
defaultPreset: z.boolean().optional(),
order: z.number().optional(),
endpoint: extendedModelEndpointSchema.nullable(),
}),
);