feat: sync deployed v1.0.0-rc.38-custom.42
Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
1 parent
aa6c3f50f4
commit
ceddfd3d6b
828 files changed
+122253
-13702
No files matched your search
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { api } from '@/lib/api'
|
||||
import { requireServerSuccess } from '@/lib/server-error-message'
|
||||
|
||||
import { API_ENDPOINTS } from './constants'
|
||||
import type {
|
||||
@@ -48,6 +49,7 @@ export async function getUserModels(group: string): Promise<ModelOption[]> {
|
||||
params: { group },
|
||||
})
|
||||
const { data } = res
|
||||
requireServerSuccess(data)
|
||||
|
||||
if (!data.success || !Array.isArray(data.data)) {
|
||||
return []
|
||||
@@ -65,6 +67,7 @@ export async function getUserModels(group: string): Promise<ModelOption[]> {
|
||||
export async function getUserGroups(): Promise<GroupOption[]> {
|
||||
const res = await api.get(API_ENDPOINTS.USER_GROUPS)
|
||||
const { data } = res
|
||||
requireServerSuccess(data)
|
||||
|
||||
if (!data.success || !data.data) {
|
||||
return []
|
||||
|
||||
@@ -18,7 +18,8 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
import { handleServerError } from '@/lib/handle-server-error'
|
||||
|
||||
import { sendChatCompletion } from '../api'
|
||||
import { ERROR_MESSAGES } from '../constants'
|
||||
@@ -225,7 +226,7 @@ export function useChatHandler({
|
||||
flushStreamUpdates(generation)
|
||||
setIsRequesting(false)
|
||||
const displayError = getDisplayError(error)
|
||||
toast.error(displayError)
|
||||
handleServerError(new Error(displayError))
|
||||
const errorTitle = t(ERROR_MESSAGES.API_REQUEST_ERROR)
|
||||
onMessageUpdate((prev) => {
|
||||
if (generation !== requestGenerationRef.current) return prev
|
||||
|
||||
@@ -37,7 +37,9 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { useEffect } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { toast } from 'sonner'
|
||||
|
||||
import { handleServerError } from '@/lib/handle-server-error'
|
||||
import { requireServerSuccess } from '@/lib/server-error-message'
|
||||
|
||||
import { getUserGroups, getUserModels } from '../api'
|
||||
import {
|
||||
@@ -75,7 +77,8 @@ export function usePlaygroundOptions({
|
||||
isLoading: isLoadingModels,
|
||||
} = useQuery({
|
||||
queryKey: ['playground-models', currentGroup],
|
||||
queryFn: () => getUserModels(currentGroup),
|
||||
queryFn: async () =>
|
||||
requireServerSuccess(await getUserModels(currentGroup)),
|
||||
enabled: currentGroup !== '',
|
||||
})
|
||||
|
||||
@@ -85,13 +88,14 @@ export function usePlaygroundOptions({
|
||||
isError: isGroupsError,
|
||||
} = useQuery({
|
||||
queryKey: ['playground-groups'],
|
||||
queryFn: getUserGroups,
|
||||
queryFn: async () => requireServerSuccess(await getUserGroups()),
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (!isModelsError) return
|
||||
|
||||
toast.error(
|
||||
handleServerError(
|
||||
modelsError,
|
||||
getOptionLoadErrorMessage(
|
||||
modelsError,
|
||||
t('Failed to load playground models')
|
||||
@@ -102,7 +106,8 @@ export function usePlaygroundOptions({
|
||||
useEffect(() => {
|
||||
if (!isGroupsError) return
|
||||
|
||||
toast.error(
|
||||
handleServerError(
|
||||
groupsError,
|
||||
getOptionLoadErrorMessage(
|
||||
groupsError,
|
||||
t('Failed to load playground groups')
|
||||
|
||||
Reference in new issue
Block a user