provider compatible in logs
This commit is contained in:
parent
be75a1e432
commit
f684e1c12e
@ -44,11 +44,12 @@ import Tooltip from '@/app/components/base/tooltip'
|
|||||||
import { CopyIcon } from '@/app/components/base/copy-icon'
|
import { CopyIcon } from '@/app/components/base/copy-icon'
|
||||||
import { buildChatItemTree, getThreadMessages } from '@/app/components/base/chat/utils'
|
import { buildChatItemTree, getThreadMessages } from '@/app/components/base/chat/utils'
|
||||||
import { getProcessedFilesFromResponse } from '@/app/components/base/file-uploader/utils'
|
import { getProcessedFilesFromResponse } from '@/app/components/base/file-uploader/utils'
|
||||||
|
import { correctProvider } from '@/utils'
|
||||||
|
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
dayjs.extend(timezone)
|
dayjs.extend(timezone)
|
||||||
|
|
||||||
interface IConversationList {
|
type IConversationList = {
|
||||||
logs?: ChatConversationsResponse | CompletionConversationsResponse
|
logs?: ChatConversationsResponse | CompletionConversationsResponse
|
||||||
appDetail: App
|
appDetail: App
|
||||||
onRefresh: () => void
|
onRefresh: () => void
|
||||||
@ -56,7 +57,7 @@ interface IConversationList {
|
|||||||
|
|
||||||
const defaultValue = 'N/A'
|
const defaultValue = 'N/A'
|
||||||
|
|
||||||
interface IDrawerContext {
|
type IDrawerContext = {
|
||||||
onClose: () => void
|
onClose: () => void
|
||||||
appDetail?: App
|
appDetail?: App
|
||||||
}
|
}
|
||||||
@ -159,7 +160,7 @@ const getFormattedChatList = (messages: ChatMessage[], conversationId: string, t
|
|||||||
// const displayedParams = CompletionParams.slice(0, -2)
|
// const displayedParams = CompletionParams.slice(0, -2)
|
||||||
const validatedParams = ['temperature', 'top_p', 'presence_penalty', 'frequency_penalty']
|
const validatedParams = ['temperature', 'top_p', 'presence_penalty', 'frequency_penalty']
|
||||||
|
|
||||||
interface IDetailPanel {
|
type IDetailPanel = {
|
||||||
detail: any
|
detail: any
|
||||||
onFeedback: FeedbackFunc
|
onFeedback: FeedbackFunc
|
||||||
onSubmitAnnotation: SubmitAnnotationFunc
|
onSubmitAnnotation: SubmitAnnotationFunc
|
||||||
@ -324,7 +325,7 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) {
|
|||||||
})?.name ?? 'custom'
|
})?.name ?? 'custom'
|
||||||
|
|
||||||
const modelName = (detail.model_config as any).model?.name
|
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 {
|
const {
|
||||||
currentModel,
|
currentModel,
|
||||||
currentProvider,
|
currentProvider,
|
||||||
|
@ -59,6 +59,9 @@ export async function fetchWithRetry<T = any>(fn: Promise<T>, retries = 3): Prom
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const correctProvider = (provider: string) => {
|
export const correctProvider = (provider: string) => {
|
||||||
|
if (!provider)
|
||||||
|
return ''
|
||||||
|
|
||||||
if (provider.includes('/'))
|
if (provider.includes('/'))
|
||||||
return provider
|
return provider
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user