Fix variable typo (#8084)
This commit is contained in:
parent
b1918dae5e
commit
2d7954c7da
215 changed files with 599 additions and 597 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import type { Fetcher } from 'swr'
|
||||
import { del, get, patch, post, put } from './base'
|
||||
import type { ApikeysListResponse, AppDailyConversationsResponse, AppDailyEndUsersResponse, AppDailyMessagesResponse, AppDetailResponse, AppListResponse, AppSSOResponse, AppStatisticsResponse, AppTemplatesResponse, AppTokenCostsResponse, AppVoicesListResponse, CreateApiKeyResponse, GenerationIntroductionResponse, TracingConfig, TracingStatus, UpdateAppModelConfigResponse, UpdateAppSiteCodeResponse, UpdateOpenAIKeyResponse, ValidateOpenAIKeyResponse, WorkflowDailyConversationsResponse } from '@/models/app'
|
||||
import type { ApiKeysListResponse, AppDailyConversationsResponse, AppDailyEndUsersResponse, AppDailyMessagesResponse, AppDetailResponse, AppListResponse, AppSSOResponse, AppStatisticsResponse, AppTemplatesResponse, AppTokenCostsResponse, AppVoicesListResponse, CreateApiKeyResponse, GenerationIntroductionResponse, TracingConfig, TracingStatus, UpdateAppModelConfigResponse, UpdateAppSiteCodeResponse, UpdateOpenAIKeyResponse, ValidateOpenAIKeyResponse, WorkflowDailyConversationsResponse } from '@/models/app'
|
||||
import type { CommonResponse } from '@/models/common'
|
||||
import type { AppIconType, AppMode, ModelConfig } from '@/types/app'
|
||||
import type { TracingProvider } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
|
||||
|
|
@ -110,8 +110,8 @@ export const fetchAppListNoMock: Fetcher<AppListResponse, { url: string; params:
|
|||
return get<AppListResponse>(url, params)
|
||||
}
|
||||
|
||||
export const fetchApiKeysList: Fetcher<ApikeysListResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
|
||||
return get<ApikeysListResponse>(url, params)
|
||||
export const fetchApiKeysList: Fetcher<ApiKeysListResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
|
||||
return get<ApiKeysListResponse>(url, params)
|
||||
}
|
||||
|
||||
export const delApikey: Fetcher<CommonResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import type { AnnotationReply, MessageEnd, MessageReplace, ThoughtItem } from '@
|
|||
import type { VisionFile } from '@/types/app'
|
||||
import type {
|
||||
IterationFinishedResponse,
|
||||
IterationNextedResponse,
|
||||
IterationNextResponse,
|
||||
IterationStartedResponse,
|
||||
NodeFinishedResponse,
|
||||
NodeStartedResponse,
|
||||
|
|
@ -57,7 +57,7 @@ export type IOnWorkflowFinished = (workflowFinished: WorkflowFinishedResponse) =
|
|||
export type IOnNodeStarted = (nodeStarted: NodeStartedResponse) => void
|
||||
export type IOnNodeFinished = (nodeFinished: NodeFinishedResponse) => void
|
||||
export type IOnIterationStarted = (workflowStarted: IterationStartedResponse) => void
|
||||
export type IOnIterationNexted = (workflowStarted: IterationNextedResponse) => void
|
||||
export type IOnIterationNext = (workflowStarted: IterationNextResponse) => void
|
||||
export type IOnIterationFinished = (workflowFinished: IterationFinishedResponse) => void
|
||||
export type IOnTextChunk = (textChunk: TextChunkResponse) => void
|
||||
export type IOnTTSChunk = (messageId: string, audioStr: string, audioType?: string) => void
|
||||
|
|
@ -84,7 +84,7 @@ export type IOtherOptions = {
|
|||
onNodeStarted?: IOnNodeStarted
|
||||
onNodeFinished?: IOnNodeFinished
|
||||
onIterationStart?: IOnIterationStarted
|
||||
onIterationNext?: IOnIterationNexted
|
||||
onIterationNext?: IOnIterationNext
|
||||
onIterationFinish?: IOnIterationFinished
|
||||
onTextChunk?: IOnTextChunk
|
||||
onTTSChunk?: IOnTTSChunk
|
||||
|
|
@ -137,7 +137,7 @@ const handleStream = (
|
|||
onNodeStarted?: IOnNodeStarted,
|
||||
onNodeFinished?: IOnNodeFinished,
|
||||
onIterationStart?: IOnIterationStarted,
|
||||
onIterationNext?: IOnIterationNexted,
|
||||
onIterationNext?: IOnIterationNext,
|
||||
onIterationFinish?: IOnIterationFinished,
|
||||
onTextChunk?: IOnTextChunk,
|
||||
onTTSChunk?: IOnTTSChunk,
|
||||
|
|
@ -187,7 +187,7 @@ const handleStream = (
|
|||
return
|
||||
}
|
||||
if (bufferObj.event === 'message' || bufferObj.event === 'agent_message') {
|
||||
// can not use format here. Because message is splited.
|
||||
// can not use format here. Because message is splitted.
|
||||
onData(unicodeToChar(bufferObj.answer), isFirstMessage, {
|
||||
conversationId: bufferObj.conversation_id,
|
||||
taskId: bufferObj.task_id,
|
||||
|
|
@ -223,7 +223,7 @@ const handleStream = (
|
|||
onIterationStart?.(bufferObj as IterationStartedResponse)
|
||||
}
|
||||
else if (bufferObj.event === 'iteration_next') {
|
||||
onIterationNext?.(bufferObj as IterationNextedResponse)
|
||||
onIterationNext?.(bufferObj as IterationNextResponse)
|
||||
}
|
||||
else if (bufferObj.event === 'iteration_completed') {
|
||||
onIterationFinish?.(bufferObj as IterationFinishedResponse)
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ import type {
|
|||
ProcessRuleResponse,
|
||||
RelatedAppResponse,
|
||||
SegmentDetailModel,
|
||||
SegmentUpdator,
|
||||
SegmentUpdater,
|
||||
SegmentsQuery,
|
||||
SegmentsResponse,
|
||||
createDocumentResponse,
|
||||
} from '@/models/datasets'
|
||||
import type { CommonResponse, DataSourceNotionWorkspace } from '@/models/common'
|
||||
import type {
|
||||
ApikeysListResponse,
|
||||
ApiKeysListResponse,
|
||||
CreateApiKeyResponse,
|
||||
} from '@/models/app'
|
||||
import type { RetrievalConfig } from '@/types/app'
|
||||
|
|
@ -184,11 +184,11 @@ export const disableSegment: Fetcher<CommonResponse, { datasetId: string; segmen
|
|||
return patch<CommonResponse>(`/datasets/${datasetId}/segments/${segmentId}/disable`)
|
||||
}
|
||||
|
||||
export const updateSegment: Fetcher<{ data: SegmentDetailModel; doc_form: string }, { datasetId: string; documentId: string; segmentId: string; body: SegmentUpdator }> = ({ datasetId, documentId, segmentId, body }) => {
|
||||
export const updateSegment: Fetcher<{ data: SegmentDetailModel; doc_form: string }, { datasetId: string; documentId: string; segmentId: string; body: SegmentUpdater }> = ({ datasetId, documentId, segmentId, body }) => {
|
||||
return patch<{ data: SegmentDetailModel; doc_form: string }>(`/datasets/${datasetId}/documents/${documentId}/segments/${segmentId}`, { body })
|
||||
}
|
||||
|
||||
export const addSegment: Fetcher<{ data: SegmentDetailModel; doc_form: string }, { datasetId: string; documentId: string; body: SegmentUpdator }> = ({ datasetId, documentId, body }) => {
|
||||
export const addSegment: Fetcher<{ data: SegmentDetailModel; doc_form: string }, { datasetId: string; documentId: string; body: SegmentUpdater }> = ({ datasetId, documentId, body }) => {
|
||||
return post<{ data: SegmentDetailModel; doc_form: string }>(`/datasets/${datasetId}/documents/${documentId}/segment`, { body })
|
||||
}
|
||||
|
||||
|
|
@ -221,8 +221,8 @@ export const fetchNotionPagePreview: Fetcher<{ content: string }, { workspaceID:
|
|||
return get<{ content: string }>(`notion/workspaces/${workspaceID}/pages/${pageID}/${pageType}/preview`)
|
||||
}
|
||||
|
||||
export const fetchApiKeysList: Fetcher<ApikeysListResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
|
||||
return get<ApikeysListResponse>(url, params)
|
||||
export const fetchApiKeysList: Fetcher<ApiKeysListResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
|
||||
return get<ApiKeysListResponse>(url, params)
|
||||
}
|
||||
|
||||
export const delApikey: Fetcher<CommonResponse, { url: string; params: Record<string, any> }> = ({ url, params }) => {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ export const fetchPromptTemplate = ({
|
|||
})
|
||||
}
|
||||
|
||||
export const fetchTextGenerationMessge = ({
|
||||
export const fetchTextGenerationMessage = ({
|
||||
appId,
|
||||
messageId,
|
||||
}: { appId: string; messageId: string }) => {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type { IOnCompleted, IOnData, IOnError, IOnFile, IOnIterationFinished, IOnIterationNexted, IOnIterationStarted, IOnMessageEnd, IOnMessageReplace, IOnNodeFinished, IOnNodeStarted, IOnTTSChunk, IOnTTSEnd, IOnTextChunk, IOnTextReplace, IOnThought, IOnWorkflowFinished, IOnWorkflowStarted } from './base'
|
||||
import type { IOnCompleted, IOnData, IOnError, IOnFile, IOnIterationFinished, IOnIterationNext, IOnIterationStarted, IOnMessageEnd, IOnMessageReplace, IOnNodeFinished, IOnNodeStarted, IOnTTSChunk, IOnTTSEnd, IOnTextChunk, IOnTextReplace, IOnThought, IOnWorkflowFinished, IOnWorkflowStarted } from './base'
|
||||
import {
|
||||
del as consoleDel, get as consoleGet, patch as consolePatch, post as consolePost,
|
||||
delPublic as del, getPublic as get, patchPublic as patch, postPublic as post, ssePost,
|
||||
} from './base'
|
||||
import type { Feedbacktype } from '@/app/components/base/chat/chat/type'
|
||||
import type { FeedbackType } from '@/app/components/base/chat/chat/type'
|
||||
import type {
|
||||
AppConversationData,
|
||||
AppData,
|
||||
|
|
@ -86,7 +86,7 @@ export const sendWorkflowMessage = async (
|
|||
onNodeFinished: IOnNodeFinished
|
||||
onWorkflowFinished: IOnWorkflowFinished
|
||||
onIterationStart: IOnIterationStarted
|
||||
onIterationNext: IOnIterationNexted
|
||||
onIterationNext: IOnIterationNext
|
||||
onIterationFinish: IOnIterationFinished
|
||||
onTextChunk: IOnTextChunk
|
||||
onTextReplace: IOnTextReplace
|
||||
|
|
@ -180,7 +180,7 @@ export const fetchAppMeta = async (isInstalledApp: boolean, installedAppId = '')
|
|||
return (getAction('get', isInstalledApp))(getUrl('meta', isInstalledApp, installedAppId)) as Promise<AppMeta>
|
||||
}
|
||||
|
||||
export const updateFeedback = async ({ url, body }: { url: string; body: Feedbacktype }, isInstalledApp: boolean, installedAppId = '') => {
|
||||
export const updateFeedback = async ({ url, body }: { url: string; body: FeedbackType }, isInstalledApp: boolean, installedAppId = '') => {
|
||||
return (getAction('post', isInstalledApp))(getUrl(url, isInstalledApp, installedAppId), { body })
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export const fetchWorkflowRunHistory: Fetcher<WorkflowRunHistoryResponse, string
|
|||
return get<WorkflowRunHistoryResponse>(url)
|
||||
}
|
||||
|
||||
export const fetcChatRunHistory: Fetcher<ChatRunHistoryResponse, string> = (url) => {
|
||||
export const fetchChatRunHistory: Fetcher<ChatRunHistoryResponse, string> = (url) => {
|
||||
return get<ChatRunHistoryResponse>(url)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue