Commit 3e85bc4f by liimin

refactor(app): 优化 URL 参数处理和对话框样式

- 使用 Next.js 的 useSearchParams 钩子替换自定义 URL 参数处理逻辑
- 调整对话框样式,使其宽度自适应
- 移除未使用的导入和变量
- 优化代码结构和命名
1 parent 3cdcb57c
......@@ -2,6 +2,7 @@
import { useRef } from 'react'
// import { AVATAR_USER_URL, AVATAR_AI_URL, MAIN_TITLE } from '@/app/components/base/chat/constants'
import { PracticeStatus } from '../../types'
import { useSearchParams } from 'next/navigation'
/**
* 自定义 Hook,用于获取 URL 查询参数
* 保证只在组件首次挂载时执行一次
......@@ -25,10 +26,9 @@ type ParamsExtenal = {
presuppositionProblem?: string
}
export const useUrlParams = (): ParamsExtenal => {
const search = globalThis.location?.search ?? ''
const urlParams = new URLSearchParams(search)
const paramsObject: Inputs = Object.fromEntries(urlParams.entries())
const { practice_status, presuppositionProblem, domain, avatar, no_header, ...inputs } = paramsObject
const searchParams = useSearchParams()
const allParams: Inputs = Object.fromEntries(searchParams.entries())
const { practice_status, presuppositionProblem, domain, avatar, no_header, ...inputs } = allParams
// const isShowPracticeButton =
// practice_status === PracticeStatus.Practicing || practice_status === PracticeStatus.Failed
return {
......
......@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2025-04-16 18:17:38
* @LastEditors: limin
* @LastEditTime: 2025-07-21 16:25:39
* @LastEditTime: 2025-07-26 14:48:20
* @FilePath: \ai-assistant\app\components\base\chat\chat-with-history\index.tsx
*/
import type { FC } from 'react'
......
......@@ -89,7 +89,7 @@ function Confirm({
e.preventDefault()
e.stopPropagation()
}}>
<div ref={dialogRef} className={'relative w-full max-w-[480px] overflow-hidden'}>
<div ref={dialogRef} className={'relative w-[80%] max-w-[480px] overflow-hidden'}>
<div className='shadows-shadow-lg flex max-w-full flex-col items-start rounded-2xl border-[0.5px] border-solid border-components-panel-border bg-components-panel-bg'>
<div className='flex flex-col items-start gap-2 self-stretch pb-4 pl-6 pr-6 pt-6'>
<div className='title-2xl-semi-bold text-text-primary'>{title}</div>
......
/*
* @Author: liimin 17653212@qq.com
* @Date: 2025-04-16 18:17:52
* @LastEditors: liimin 17653212@qq.com
* @LastEditTime: 2025-05-14 11:46:39
* @LastEditors: limin
* @LastEditTime: 2025-07-26 14:57:24
* @FilePath: \ai-assistant\config\index.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 解析 URL 参数
const urlParams = new URLSearchParams(globalThis.location?.search)
const urlParams = new URLSearchParams(globalThis.location?.search || '')
const defaultDomain = 'https://aiassistant.glsx.com.cn'
// 从 URL 参数中获取 apiPrefix
const domain = urlParams.get('domain')
const domain = urlParams.get('domain') || defaultDomain
export const apiPrefix = `${domain}/console/api`
export const publicApiPrefix = `${domain}/api` // avoid browser private mode api cross origin
export const API_PREFIX: string = apiPrefix
......
const translation = {
title: 'Annotations',
name: 'Annotation Reply',
editBy: 'Answer edited by {{author}}',
noData: {
title: 'No annotations',
description: 'You can edit annotations during app debugging or import annotations in bulk here for a high-quality response.',
},
table: {
header: {
question: 'question',
answer: 'answer',
createdAt: 'created at',
hits: 'hits',
actions: 'actions',
addAnnotation: 'Add Annotation',
bulkImport: 'Bulk Import',
bulkExport: 'Bulk Export',
clearAll: 'Clear All Annotation',
},
},
editModal: {
title: 'Edit Annotation Reply',
queryName: 'User Query',
answerName: 'Storyteller Bot',
yourAnswer: 'Your Answer',
answerPlaceholder: 'Type your answer here',
yourQuery: 'Your Query',
queryPlaceholder: 'Type your query here',
removeThisCache: 'Remove this Annotation',
createdAt: 'Created At',
},
addModal: {
title: 'Add Annotation Reply',
queryName: 'Question',
answerName: 'Answer',
answerPlaceholder: 'Type answer here',
queryPlaceholder: 'Type query here',
createNext: 'Add another annotated response',
},
batchModal: {
title: 'Bulk Import',
csvUploadTitle: 'Drag and drop your CSV file here, or ',
browse: 'browse',
tip: 'The CSV file must conform to the following structure:',
question: 'question',
answer: 'answer',
contentTitle: 'chunk content',
content: 'content',
template: 'Download the template here',
cancel: 'Cancel',
run: 'Run Batch',
runError: 'Run batch failed',
processing: 'In batch processing',
completed: 'Import completed',
error: 'Import Error',
ok: 'OK',
},
errorMessage: {
answerRequired: 'Answer is required',
queryRequired: 'Question is required',
},
viewModal: {
annotatedResponse: 'Annotation Reply',
hitHistory: 'Hit History',
hit: 'Hit',
hits: 'Hits',
noHitHistory: 'No hit history',
},
hitHistoryTable: {
query: 'Query',
match: 'Match',
response: 'Response',
source: 'Source',
score: 'Score',
time: 'Time',
},
initSetup: {
title: 'Annotation Reply Initial Setup',
configTitle: 'Annotation Reply Setup',
......
const translation = {
title: 'Explore',
sidebar: {
discovery: 'Discovery',
chat: 'Chat',
workspace: 'Workspace',
action: {
pin: 'Pin',
unpin: 'Unpin',
rename: 'Rename',
delete: 'Delete',
},
delete: {
title: 'Delete app',
content: 'Are you sure you want to delete this app?',
},
},
apps: {
title: 'Explore Apps by Dify',
description: 'Use these template apps instantly or customize your own apps based on the templates.',
allCategories: 'Recommended',
},
appCard: {
addToWorkspace: 'Add to Workspace',
customize: 'Customize',
},
appCustomize: {
title: 'Create app from {{name}}',
subTitle: 'App icon & name',
nameRequired: 'App name is required',
},
category: {
Agent: 'Agent',
Assistant: 'Assistant',
Writing: 'Writing',
Translate: 'Translate',
Programming: 'Programming',
HR: 'HR',
Workflow: 'Workflow',
Entertainment: 'Entertainment',
},
}
......
const translation = {
common: {
welcome: '',
appUnavailable: 'App is unavailable',
appUnknownError: 'App is unavailable',
copy: 'Copy',
......@@ -37,46 +36,6 @@ const translation = {
tryToSolve: 'Try to solve',
temporarySystemIssue: 'Sorry, temporary system issue.',
},
generation: {
tabs: {
create: 'Run Once',
batch: 'Run Batch',
saved: 'Saved',
},
savedNoData: {
title: 'You haven\'t saved a result yet!',
description: 'Start generating content, and find your saved results here.',
startCreateContent: 'Start create content',
},
title: 'AI Completion',
queryTitle: 'Query content',
completionResult: 'Completion result',
queryPlaceholder: 'Write your query content...',
run: 'Execute',
execution: 'EXECUTION',
executions: '{{num}} EXECUTIONS',
copy: 'Copy',
resultTitle: 'AI Completion',
noData: 'AI will give you what you want here.',
csvUploadTitle: 'Drag and drop your CSV file here, or ',
browse: 'browse',
csvStructureTitle: 'The CSV file must conform to the following structure:',
downloadTemplate: 'Download the template here',
field: 'Field',
batchFailed: {
info: '{{num}} failed executions',
retry: 'Retry',
outputPlaceholder: 'No output content',
},
errorMsg: {
empty: 'Please input content in the uploaded file.',
fileStructNotMatch: 'The uploaded CSV file not match the struct.',
emptyLine: 'Row {{rowIndex}} is empty',
invalidLine: 'Row {{rowIndex}}: {{varName}} value can not be empty',
moreThanMaxLengthLine: 'Row {{rowIndex}}: {{varName}} value can not be more than {{maxLength}} characters',
atLeastOne: 'Please input at least one row in the uploaded file.',
},
},
}
export default translation
......@@ -27,31 +27,12 @@ import { LanguagesSupported } from '@/i18n/language'
const loadLangResources = (lang: string) => ({
translation: {
common: require(`./${lang}/common`).default,
// layout: require(`./${lang}/layout`).default,
// login: require(`./${lang}/login`).default,
// register: require(`./${lang}/register`).default,
// app: require(`./${lang}/app`).default,
// appOverview: require(`./${lang}/app-overview`).default,
appDebug: require(`./${lang}/app-debug`).default,
// appApi: require(`./${lang}/app-api`).default,
// appLog: require(`./${lang}/app-log`).default,
appAnnotation: require(`./${lang}/app-annotation`).default,
share: require(`./${lang}/share-app`).default,
// dataset: require(`./${lang}/dataset`).default,
// datasetDocuments: require(`./${lang}/dataset-documents`).default,
// datasetHitTesting: require(`./${lang}/dataset-hit-testing`).default,
// datasetSettings: require(`./${lang}/dataset-settings`).default,
// datasetCreation: require(`./${lang}/dataset-creation`).default,
explore: require(`./${lang}/explore`).default,
// billing: require(`./${lang}/billing`).default,
// custom: require(`./${lang}/custom`).default,
// tools: require(`./${lang}/tools`).default,
workflow: require(`./${lang}/workflow`).default,
// runLog: require(`./${lang}/run-log`).default,
// plugin: require(`./${lang}/plugin`).default,
// pluginTags: require(`./${lang}/plugin-tags`).default,
time: require(`./${lang}/time`).default,
// education: requireSilent(lang),
},
})
......
......@@ -5,7 +5,7 @@ import { LOCALE_COOKIE_NAME } from '@/config'
import { LanguagesSupported } from '@/i18n/language'
export const i18n = {
defaultLocale: 'en-US',
defaultLocale: 'zh-Hans',
locales: LanguagesSupported,
} as const
......
const translation = {
title: '标注',
name: '标注回复',
editBy: '{{author}}编辑的答案',
noData: {
title: '没有标注',
description: '你可以在应用会话调试中编辑标注,也可以在此批量导入标注用于高质量回复。',
},
table: {
header: {
question: '提问',
match: '匹配',
response: '回复',
answer: '答案',
createdAt: '创建时间',
hits: '命中次数',
actions: '操作',
addAnnotation: '添加标注',
bulkImport: '批量导入',
bulkExport: '批量导出',
clearAll: '删除所有标注',
},
},
editModal: {
title: '编辑标注回复',
queryName: '用户提问',
answerName: '机器回复',
yourAnswer: '您的回复',
answerPlaceholder: '在这里输入您的回复',
yourQuery: '您的提问',
queryPlaceholder: '在这里输入您的提问',
removeThisCache: '删除此标注',
createdAt: '创建于',
},
addModal: {
title: '添加标注回复',
queryName: '提问',
answerName: '回复',
answerPlaceholder: '输入回复',
queryPlaceholder: '输入提问',
createNext: '添加下一个标注回复',
},
batchModal: {
title: '批量导入',
csvUploadTitle: '将您的 CSV 文件拖放到此处,或',
browse: '选择文件',
tip: 'CSV 文件必须符合以下结构:',
question: '问题',
answer: '回答',
contentTitle: '分段内容',
content: '内容',
template: '下载模板',
cancel: '取消',
run: '导入',
runError: '批量导入失败',
processing: '批量处理中',
completed: '导入完成',
error: '导入出错',
ok: '确定',
},
errorMessage: {
answerRequired: '回复不能为空',
queryRequired: '提问不能为空',
},
viewModal: {
annotatedResponse: '标注回复',
hitHistory: '命中历史',
hit: '次命中',
hits: '次命中',
noHitHistory: '没有命中历史',
},
hitHistoryTable: {
question: '问题',
query: '提问',
match: '匹配',
response: '回复',
source: '来源',
score: '分数',
time: '时间',
},
initSetup: {
title: '标注回复初始设置',
configTitle: '标注回复设置',
......
const translation = {
title: '探索',
sidebar: {
discovery: '发现',
chat: '智聊',
workspace: '工作区',
action: {
pin: '置顶',
unpin: '取消置顶',
rename: '重命名',
delete: '删除',
},
delete: {
title: '删除程序',
content: '您确定要删除此程序吗?',
},
},
apps: {
title: '探索 Dify 的应用',
description: '使用这些模板应用程序,或根据模板自定义您自己的应用程序。',
allCategories: '推荐',
},
appCard: {
addToWorkspace: '添加到工作区',
customize: '自定义',
},
appCustomize: {
title: '从 {{name}} 创建应用程序',
subTitle: '应用程序图标和名称',
nameRequired: '应用程序名称不能为空',
},
category: {
Agent: 'Agent',
Assistant: '助手',
Writing: '写作',
Translate: '翻译',
Programming: '编程',
HR: '人力资源',
Workflow: '工作流',
Entertainment: '娱乐',
},
}
......
......@@ -33,46 +33,6 @@ const translation = {
tryToSolve: '尝试解决',
temporarySystemIssue: '抱歉,临时系统问题。',
},
generation: {
tabs: {
create: '运行一次',
batch: '批量运行',
saved: '已保存',
},
savedNoData: {
title: '您还没有保存结果!',
description: '开始生成内容,您可以在这里找到保存的结果。',
startCreateContent: '开始生成内容',
},
title: 'AI 智能书写',
queryTitle: '查询内容',
completionResult: '生成结果',
queryPlaceholder: '请输入文本内容',
run: '运行',
execution: '运行',
executions: '{{num}} 次运行',
copy: '拷贝',
resultTitle: 'AI 书写',
noData: 'AI 会在这里给你惊喜。',
csvUploadTitle: '将您的 CSV 文件拖放到此处,或',
browse: '浏览',
csvStructureTitle: 'CSV 文件必须符合以下结构:',
downloadTemplate: '下载模板',
field: '',
batchFailed: {
info: '{{num}} 次运行失败',
retry: '重试',
outputPlaceholder: '无输出内容',
},
errorMsg: {
empty: '上传文件的内容不能为空',
fileStructNotMatch: '上传文件的内容与结构不匹配',
emptyLine: '第 {{rowIndex}} 行的内容为空',
invalidLine: '第 {{rowIndex}} 行: {{varName}}值必填',
moreThanMaxLengthLine: '第 {{rowIndex}} 行: {{varName}}值超过最大长度 {{maxLength}}',
atLeastOne: '上传文件的内容不能少于一条',
},
},
}
export default translation
// import type { LangFuseConfig, LangSmithConfig, OpikConfig, TracingProvider } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/type'
// import type { App, AppMode, AppSSO, AppTemplate, SiteConfig } from '@/types/app'
// import type { Dependency } from '@/app/components/plugins/types'
import type { AppIconType, AppMode } from '@/types/app'
/* export type App = {
id: string
name: string
description: string
mode: AppMode
enable_site: boolean
enable_api: boolean
api_rpm: number
api_rph: number
is_demo: boolean
model_config: AppModelConfig
providers: Array<{ provider: string; token_is_set: boolean }>
site: SiteConfig
created_at: string
}
export type AppModelConfig = {
provider: string
model_id: string
configs: {
prompt_template: string
prompt_variables: Array<PromptVariable>
completion_params: CompletionParam
}
}
export type PromptVariable = {
key: string
name: string
description: string
type: string | number
default: string
options: string[]
}
export type CompletionParam = {
max_tokens: number
temperature: number
top_p: number
echo: boolean
stop: string[]
presence_penalty: number
frequency_penalty: number
}
export type SiteConfig = {
access_token: string
title: string
author: string
support_email: string
default_language: string
customize_domain: string
theme: string
customize_token_strategy: 'must' | 'allow' | 'not_allow'
prompt_public: boolean
} */
// export enum DSLImportMode {
// YAML_CONTENT = 'yaml-content',
// YAML_URL = 'yaml-url',
// }
// export enum DSLImportStatus {
// COMPLETED = 'completed',
// COMPLETED_WITH_WARNINGS = 'completed-with-warnings',
// PENDING = 'pending',
// FAILED = 'failed',
// }
// export type AppListResponse = {
// data: App[]
// has_more: boolean
// limit: number
// page: number
// total: number
// }
// export type AppDetailResponse = App
// export type DSLImportResponse = {
// id: string
// status: DSLImportStatus
// app_mode: AppMode
// app_id?: string
// current_dsl_version?: string
// imported_dsl_version?: string
// error: string
// leaked_dependencies: Dependency[]
// }
// export type AppSSOResponse = { enabled: AppSSO['enable_sso'] }
// export type AppTemplatesResponse = {
// data: AppTemplate[]
// }
// export type CreateAppResponse = App
// export type UpdateAppSiteCodeResponse = { app_id: string } & SiteConfig
// export type AppDailyMessagesResponse = {
// data: Array<{ date: string; message_count: number }>
// }
// export type AppDailyConversationsResponse = {
// data: Array<{ date: string; conversation_count: number }>
// }
// export type WorkflowDailyConversationsResponse = {
// data: Array<{ date: string; runs: number }>
// }
// export type AppStatisticsResponse = {
// data: Array<{ date: string }>
// }
// export type AppDailyEndUsersResponse = {
// data: Array<{ date: string; terminal_count: number }>
// }
// export type AppTokenCostsResponse = {
// data: Array<{ date: string; token_count: number; total_price: number; currency: number }>
// }
// export type UpdateAppModelConfigResponse = { result: string }
// export type ApiKeyItemResponse = {
// id: string
// token: string
// last_used_at: string
// created_at: string
// }
// export type ApiKeysListResponse = {
// data: ApiKeyItemResponse[]
// }
// export type CreateApiKeyResponse = {
// id: string
// token: string
// created_at: string
// }
// export type ValidateOpenAIKeyResponse = {
// result: string
// error?: string
// }
// export type UpdateOpenAIKeyResponse = ValidateOpenAIKeyResponse
// export type GenerationIntroductionResponse = {
// introduction: string
// }
export type AppVoicesListResponse = [
{
......@@ -162,16 +6,6 @@ export type AppVoicesListResponse = [
value: string
},
]
// export type TracingStatus = {
// enabled: boolean
// tracing_provider: TracingProvider | null
// }
// export type TracingConfig = {
// tracing_provider: TracingProvider
// tracing_config: LangSmithConfig | LangFuseConfig | OpikConfig
// }
export type LogAnnotation = {
id: string
content: string
......
// import type { AgentStrategy, ModelModeType, RETRIEVE_TYPE, ToolItem, TtsAutoPlay } from '@/types/app'
// import type {
// RerankingModeEnum,
// WeightedScoreEnum,
// } from '@/models/datasets'
// import type { FileUpload } from '@/app/components/base/features/types'
// import type {
// MetadataFilteringConditions,
// MetadataFilteringModeEnum,
// } from '@/app/components/workflow/nodes/knowledge-retrieval/types'
// import type { ModelConfig as NodeModelConfig } from '@/app/components/workflow/types'
export type Inputs = Record<string, string | number | object>
// export enum PromptMode {
// simple = 'simple',
// advanced = 'advanced',
// }
// export type PromptItem = {
// role?: PromptRole
// text: string
// }
// export type ChatPromptConfig = {
// prompt: PromptItem[]
// }
// export type ConversationHistoriesRole = {
// user_prefix: string
// assistant_prefix: string
// }
// export type CompletionPromptConfig = {
// prompt: PromptItem
// conversation_histories_role: ConversationHistoriesRole
// }
// export type BlockStatus = {
// context: boolean
// history: boolean
// query: boolean
// }
export enum PromptRole {
system = 'system',
user = 'user',
assistant = 'assistant',
}
// export type PromptVariable = {
// key: string
// name: string
// type: string // "string" | "number" | "select",
// default?: string | number
// required?: boolean
// options?: string[]
// max_length?: number
// is_context_var?: boolean
// enabled?: boolean
// config?: Record<string, any>
// icon?: string
// icon_background?: string
// }
// export type CompletionParams = {
// max_tokens: number
// temperature: number
// top_p: number
// presence_penalty: number
// frequency_penalty: number
// stop?: string[]
// }
// export type ModelId = 'gpt-3.5-turbo' | 'text-davinci-003'
// export type PromptConfig = {
// prompt_template: string
// prompt_variables: PromptVariable[]
// }
// export type MoreLikeThisConfig = {
// enabled: boolean
// }
// export type SuggestedQuestionsAfterAnswerConfig = MoreLikeThisConfig
// export type SpeechToTextConfig = MoreLikeThisConfig
// export type TextToSpeechConfig = {
// enabled: boolean
// voice?: string
// language?: string
// autoPlay?: TtsAutoPlay
// }
// export type CitationConfig = MoreLikeThisConfig
// export type AnnotationReplyConfig = {
// id: string
// enabled: boolean
// score_threshold: number
// embedding_model: {
// embedding_provider_name: string
// embedding_model_name: string
// }
// }
// export type ModerationContentConfig = {
// enabled: boolean
// preset_response?: string
// }
// export type ModerationConfig = MoreLikeThisConfig & {
// type?: string
// config?: {
// keywords?: string
// api_based_extension_id?: string
// inputs_config?: ModerationContentConfig
// outputs_config?: ModerationContentConfig
// } & Partial<Record<string, any>>
// }
// export type RetrieverResourceConfig = MoreLikeThisConfig
// export type AgentConfig = {
// enabled: boolean
// strategy: AgentStrategy
// max_iteration: number
// tools: ToolItem[]
// }
// // frontend use. Not the same as backend
// export type ModelConfig = {
// provider: string // LLM Provider: for example "OPENAI"
// model_id: string
// mode: ModelModeType
// configs: PromptConfig
// opening_statement: string | null
// more_like_this: MoreLikeThisConfig | null
// suggested_questions: string[] | null
// suggested_questions_after_answer: SuggestedQuestionsAfterAnswerConfig | null
// speech_to_text: SpeechToTextConfig | null
// text_to_speech: TextToSpeechConfig | null
// file_upload: FileUpload | null
// retriever_resource: RetrieverResourceConfig | null
// sensitive_word_avoidance: ModerationConfig | null
// annotation_reply: AnnotationReplyConfig | null
// dataSets: any[]
// agentConfig: AgentConfig
// }
// export type DatasetConfigItem = {
// enable: boolean
// value: number
// }
// export type DatasetConfigs = {
// retrieval_model: RETRIEVE_TYPE
// reranking_model: {
// reranking_provider_name: string
// reranking_model_name: string
// }
// top_k: number
// score_threshold_enabled: boolean
// score_threshold: number | null | undefined
// datasets: {
// datasets: {
// enabled: boolean
// id: string
// }[]
// }
// reranking_mode?: RerankingModeEnum
// weights?: {
// weight_type: WeightedScoreEnum
// vector_setting: {
// vector_weight: number
// embedding_provider_name: string
// embedding_model_name: string
// }
// keyword_setting: {
// keyword_weight: number
// }
// }
// reranking_enable?: boolean
// metadata_filtering_mode?: MetadataFilteringModeEnum
// metadata_filtering_conditions?: MetadataFilteringConditions
// metadata_model_config?: NodeModelConfig
// }
// export type DebugRequestBody = {
// inputs: Inputs
// query: string
// completion_params: CompletionParams
// model_config: ModelConfig
// }
// export type DebugResponse = {
// id: string
// answer: string
// created_at: string
// }
// export type DebugResponseStream = {
// id: string
// data: string
// created_at: string
// }
// export type FeedBackRequestBody = {
// message_id: string
// rating: 'like' | 'dislike'
// content?: string
// from_source: 'api' | 'log'
// }
// export type FeedBackResponse = {
// message_id: string
// rating: 'like' | 'dislike'
// }
// // Log session list
// export type LogSessionListQuery = {
// keyword?: string
// start?: string // format datetime(YYYY-mm-dd HH:ii)
// end?: string // format datetime(YYYY-mm-dd HH:ii)
// page: number
// limit: number // default 20. 1-100
// }
// export type LogSessionListResponse = {
// data: {
// id: string
// conversation_id: string
// query: string // user's query question
// message: string // prompt send to LLM
// answer: string
// created_at: string
// }[]
// total: number
// page: number
// }
// // log session detail and debug
// export type LogSessionDetailResponse = {
// id: string
// conversation_id: string
// model_provider: string
// query: string
// inputs: Record<string, string | number | object>[]
// message: string
// message_tokens: number // number of tokens in message
// answer: string
// answer_tokens: number // number of tokens in answer
// provider_response_latency: number // used time in ms
// from_source: 'api' | 'log'
// }
// export type SavedMessage = {
// id: string
// answer: string
// }
......@@ -6,7 +6,6 @@
* @FilePath: \ai-assistant\service\annotation.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// import type { Fetcher } from 'swr'
import { del, get, post } from './base'
// import type { AnnotationEnableStatus, AnnotationItemBasic, EmbeddingModelConfig } from '@/app/components/app/annotation/type'
// import { ANNOTATION_DEFAULT } from '@/config'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!