diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx index b78aaffef2..4e86d06b5b 100644 --- a/web/app/components/app/log/list.tsx +++ b/web/app/components/app/log/list.tsx @@ -44,11 +44,12 @@ import Tooltip from '@/app/components/base/tooltip' import { CopyIcon } from '@/app/components/base/copy-icon' import { buildChatItemTree, getThreadMessages } from '@/app/components/base/chat/utils' import { getProcessedFilesFromResponse } from '@/app/components/base/file-uploader/utils' +import { correctProvider } from '@/utils' dayjs.extend(utc) dayjs.extend(timezone) -interface IConversationList { +type IConversationList = { logs?: ChatConversationsResponse | CompletionConversationsResponse appDetail: App onRefresh: () => void @@ -56,7 +57,7 @@ interface IConversationList { const defaultValue = 'N/A' -interface IDrawerContext { +type IDrawerContext = { onClose: () => void appDetail?: App } @@ -159,7 +160,7 @@ const getFormattedChatList = (messages: ChatMessage[], conversationId: string, t // const displayedParams = CompletionParams.slice(0, -2) const validatedParams = ['temperature', 'top_p', 'presence_penalty', 'frequency_penalty'] -interface IDetailPanel { +type IDetailPanel = { detail: any onFeedback: FeedbackFunc onSubmitAnnotation: SubmitAnnotationFunc @@ -324,7 +325,7 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) { })?.name ?? 'custom' const modelName = (detail.model_config as any).model?.name - const provideName = (detail.model_config as any).model?.provider as any + const provideName = correctProvider((detail.model_config as any).model?.provider as any) const { currentModel, currentProvider, diff --git a/web/utils/index.ts b/web/utils/index.ts index d165596fe3..b8b499ae32 100644 --- a/web/utils/index.ts +++ b/web/utils/index.ts @@ -59,6 +59,9 @@ export async function fetchWithRetry(fn: Promise, retries = 3): Prom } export const correctProvider = (provider: string) => { + if (!provider) + return '' + if (provider.includes('/')) return provider