🔧 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

@ -16,7 +16,7 @@ import { cn } from '~/utils';
const Icon: React.FC<IconProps> = (props) => {
const { user } = useAuthContext();
const { size = 30, isCreatedByUser, button, model = '', endpoint, error, jailbreak } = props;
const { size = 30, isCreatedByUser, button, model = '', endpoint, jailbreak } = props;
if (isCreatedByUser) {
const username = user?.name || 'User';
@ -130,11 +130,11 @@ const Icon: React.FC<IconProps> = (props) => {
)}
>
{icon}
{error && (
{/* {error && (
<span className="absolute right-0 top-[20px] -mr-2 flex h-4 w-4 items-center justify-center rounded-full border border-white bg-red-500 text-[10px] text-white">
!
</span>
)}
)} */}
</div>
);
}