diff --git a/src/apps/chat/components/message/fragments-content/BlockPartError_NetDisconnected.tsx b/src/apps/chat/components/message/fragments-content/BlockPartError_NetDisconnected.tsx index 57aaa8ab0..1cc215e02 100644 --- a/src/apps/chat/components/message/fragments-content/BlockPartError_NetDisconnected.tsx +++ b/src/apps/chat/components/message/fragments-content/BlockPartError_NetDisconnected.tsx @@ -18,7 +18,7 @@ export function BlockPartError_NetDisconnected(props: { // external state const model = useLLM(props.messageGeneratorLlmId) ?? null; - const { csfAvailable, csfActive, csfToggle } = useModelServiceClientSideFetch(true, model); + const { csfAvailable, csfActive, csfToggle, vendorName } = useModelServiceClientSideFetch(true, model); return ( - Experimental: enable direct connection to the AI service, to bypass server timeouts, and try again. + Experimental: enable direct connection to {vendorName} to bypass server timeouts - then try again. {/* Toggle */} @@ -63,6 +63,8 @@ export function BlockPartError_NetDisconnected(props: { borderRadius: 'sm', bgcolor: 'background.popup', boxShadow: 'md', + // border: '1px solid', + // borderColor: 'divider', }} > @@ -71,7 +73,7 @@ export function BlockPartError_NetDisconnected(props: { Direct Connection {csfActive && '- Now Try Again'} - Connect directly from this client -> AI service + Connect directly from this client -> {vendorName || 'AI service'} diff --git a/src/apps/chat/components/message/fragments-content/BlockPartError_RequestExceeded.tsx b/src/apps/chat/components/message/fragments-content/BlockPartError_RequestExceeded.tsx index 5dacb2d92..b603c027a 100644 --- a/src/apps/chat/components/message/fragments-content/BlockPartError_RequestExceeded.tsx +++ b/src/apps/chat/components/message/fragments-content/BlockPartError_RequestExceeded.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { Alert, Box, FormHelperText, Switch, Typography } from '@mui/joy'; +import { Alert, Box, FormHelperText, Switch } from '@mui/joy'; import WarningRoundedIcon from '@mui/icons-material/WarningRounded'; import type { ContentScaling } from '~/common/app.theme'; @@ -19,13 +19,13 @@ export function BlockPartError_RequestExceeded(props: { // external state const model = useLLM(props.messageGeneratorLlmId) ?? null; - const { csfAvailable, csfActive, csfToggle } = useModelServiceClientSideFetch(true, model); + const { csfAvailable, csfActive, csfToggle, vendorName } = useModelServiceClientSideFetch(true, model); return ( @@ -36,70 +36,69 @@ export function BlockPartError_RequestExceeded(props: { Request Too Large
- Your message or attachments exceed the limit of the Vercel edge network. + Your message or attachments exceed the limit of the Vercel edge network
{/* Recovery options */} - {csfAvailable ? ( - + {csfAvailable ? <> - {/* Explanation */} - - Experimental: enable direct connection to the AI services, and try again. - - - {/* Toggle */} - - - - - Direct Connection {csfActive && '- Now Try Again'} - - - Bypassing servers and connect directly from this client -> AI provider - - - - csfToggle(e.target.checked)} - /> - - - {/* Regenerate button */} - {/*{props.onRegenerate && (*/} - {/* }*/} - {/* onClick={props.onRegenerate}*/} - {/* sx={{ alignSelf: 'flex-start' }}*/} - {/* >*/} - {/* {csfActive ? 'Regenerate with Direct Connection' : 'Regenerate'}*/} - {/* */} - {/*)}*/} + {/* Explanation */} + + Experimental: enable Direct Connection to {vendorName} to work around size limitations. - ) : ( + + {/* Toggle */} + + + + + Direct Connection {csfActive && '- Now Try Again'} + + + Connect directly from this client -> {vendorName || 'AI service'} + + + + csfToggle(e.target.checked)} + /> + + + {/* Regenerate button */} + {/*{props.onRegenerate && (*/} + {/* }*/} + {/* onClick={props.onRegenerate}*/} + {/* sx={{ alignSelf: 'flex-start' }}*/} + {/* >*/} + {/* {csfActive ? 'Regenerate with Direct Connection' : 'Regenerate'}*/} + {/* */} + {/*)}*/} + + : ( - - Suggestions: - - + + Suggestions: + +
  • Use the cleanup button in the right pane to hide old messages
  • Remove large attachments from the conversation
  • {/*
  • Reduce conversation length before sending
  • */} -
    +
    )} diff --git a/src/common/stores/llms/hooks/useModelServiceClientSideFetch.ts b/src/common/stores/llms/hooks/useModelServiceClientSideFetch.ts index 20f2b1712..1c2b43567 100644 --- a/src/common/stores/llms/hooks/useModelServiceClientSideFetch.ts +++ b/src/common/stores/llms/hooks/useModelServiceClientSideFetch.ts @@ -38,5 +38,5 @@ export function useModelServiceClientSideFetch(enabled: boolean, model: DLLM | n llmsStoreActions().updateServiceSettings(serviceId, { [csfKey]: false }); }, [csfKey, serviceId]); - return { csfAvailable, csfActive, csfToggle, csfReset }; + return { csfAvailable, csfActive, csfToggle, csfReset, vendorName: vendor?.name || vendor?.id || 'AI Service' }; }