| 
									
										
										
										
											2024-01-23 19:31:56 +08:00
										 |  |  | import type { AnnotationReplyConfig, ChatPromptConfig, CompletionPromptConfig, DatasetConfigs, PromptMode } from '@/models/debug' | 
					
						
							|  |  |  | import type { CollectionType } from '@/app/components/tools/types' | 
					
						
							| 
									
										
										
										
											2024-02-23 14:31:06 +08:00
										 |  |  | import type { LanguagesSupported } from '@/i18n/language' | 
					
						
							| 
									
										
										
										
											2023-07-17 00:14:32 +08:00
										 |  |  | export enum ProviderType { | 
					
						
							|  |  |  |   openai = 'openai', | 
					
						
							|  |  |  |   anthropic = 'anthropic', | 
					
						
							| 
									
										
										
										
											2023-08-12 00:57:13 +08:00
										 |  |  |   azure_openai = 'azure_openai', | 
					
						
							|  |  |  |   replicate = 'replicate', | 
					
						
							|  |  |  |   huggingface_hub = 'huggingface_hub', | 
					
						
							|  |  |  |   minimax = 'minimax', | 
					
						
							|  |  |  |   tongyi = 'tongyi', | 
					
						
							|  |  |  |   spark = 'spark', | 
					
						
							| 
									
										
										
										
											2023-07-17 00:14:32 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | export enum AppType { | 
					
						
							|  |  |  |   'chat' = 'chat', | 
					
						
							|  |  |  |   'completion' = 'completion', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-12 23:14:28 +08:00
										 |  |  | export enum ModelModeType { | 
					
						
							|  |  |  |   'chat' = 'chat', | 
					
						
							|  |  |  |   'completion' = 'completion', | 
					
						
							|  |  |  |   'unset' = '', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-18 11:53:35 +08:00
										 |  |  | export enum RETRIEVE_TYPE { | 
					
						
							|  |  |  |   oneWay = 'single', | 
					
						
							|  |  |  |   multiWay = 'multiple', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export enum RETRIEVE_METHOD { | 
					
						
							|  |  |  |   semantic = 'semantic_search', | 
					
						
							|  |  |  |   fullText = 'full_text_search', | 
					
						
							|  |  |  |   hybrid = 'hybrid_search', | 
					
						
							|  |  |  |   invertedIndex = 'invertedIndex', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | export type VariableInput = { | 
					
						
							|  |  |  |   key: string | 
					
						
							|  |  |  |   name: string | 
					
						
							|  |  |  |   value: string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * App modes | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export const AppModes = ['completion', 'chat'] as const | 
					
						
							|  |  |  | export type AppMode = typeof AppModes[number] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Variable type | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export const VariableTypes = ['string', 'number', 'select'] as const | 
					
						
							|  |  |  | export type VariableType = typeof VariableTypes[number] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Prompt variable parameter | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export type PromptVariable = { | 
					
						
							|  |  |  |   /** Variable key */ | 
					
						
							|  |  |  |   key: string | 
					
						
							|  |  |  |   /** Variable name */ | 
					
						
							|  |  |  |   name: string | 
					
						
							|  |  |  |   /** Type */ | 
					
						
							|  |  |  |   type: VariableType | 
					
						
							|  |  |  |   required: boolean | 
					
						
							|  |  |  |   /** Enumeration of single-selection drop-down values */ | 
					
						
							|  |  |  |   options?: string[] | 
					
						
							|  |  |  |   max_length?: number | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export type TextTypeFormItem = { | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   default: string | 
					
						
							| 
									
										
										
										
											2023-06-01 23:19:36 +08:00
										 |  |  |   label: string | 
					
						
							|  |  |  |   variable: string | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   required: boolean | 
					
						
							|  |  |  |   max_length: number | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export type SelectTypeFormItem = { | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  |   default: string | 
					
						
							| 
									
										
										
										
											2023-06-01 23:19:36 +08:00
										 |  |  |   label: string | 
					
						
							|  |  |  |   variable: string | 
					
						
							|  |  |  |   required: boolean | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   options: string[] | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | export type ParagraphTypeFormItem = { | 
					
						
							|  |  |  |   default: string | 
					
						
							|  |  |  |   label: string | 
					
						
							|  |  |  |   variable: string | 
					
						
							|  |  |  |   required: boolean | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * User Input Form Item | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export type UserInputFormItem = { | 
					
						
							|  |  |  |   'text-input': TextTypeFormItem | 
					
						
							|  |  |  | } | { | 
					
						
							|  |  |  |   'select': SelectTypeFormItem | 
					
						
							| 
									
										
										
										
											2024-02-04 16:10:46 +08:00
										 |  |  | } | { | 
					
						
							|  |  |  |   'paragraph': TextTypeFormItem | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-23 19:31:56 +08:00
										 |  |  | export type AgentTool = { | 
					
						
							|  |  |  |   provider_id: string | 
					
						
							|  |  |  |   provider_type: CollectionType | 
					
						
							|  |  |  |   provider_name: string | 
					
						
							|  |  |  |   tool_name: string | 
					
						
							|  |  |  |   tool_label: string | 
					
						
							|  |  |  |   tool_parameters: Record<string, any> | 
					
						
							|  |  |  |   enabled: boolean | 
					
						
							|  |  |  |   isDeleted?: boolean | 
					
						
							|  |  |  |   notAuthor?: boolean | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | export type ToolItem = { | 
					
						
							|  |  |  |   dataset: { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							|  |  |  |     id: string | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | { | 
					
						
							|  |  |  |   'sensitive-word-avoidance': { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							|  |  |  |     words: string[] | 
					
						
							|  |  |  |     canned_response: string | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2024-01-23 19:31:56 +08:00
										 |  |  | } | AgentTool | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export enum AgentStrategy { | 
					
						
							|  |  |  |   functionCall = 'function_call', | 
					
						
							|  |  |  |   react = 'react', | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Model configuration. The backend type. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export type ModelConfig = { | 
					
						
							|  |  |  |   opening_statement: string | 
					
						
							| 
									
										
										
										
											2024-01-23 19:31:56 +08:00
										 |  |  |   suggested_questions?: string[] | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   pre_prompt: string | 
					
						
							| 
									
										
										
										
											2023-10-12 23:14:28 +08:00
										 |  |  |   prompt_type: PromptMode | 
					
						
							|  |  |  |   chat_prompt_config: ChatPromptConfig | {} | 
					
						
							|  |  |  |   completion_prompt_config: CompletionPromptConfig | {} | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   user_input_form: UserInputFormItem[] | 
					
						
							| 
									
										
										
										
											2023-09-27 14:53:22 +08:00
										 |  |  |   dataset_query_variable?: string | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   more_like_this: { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   suggested_questions_after_answer: { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-07-07 17:50:42 +08:00
										 |  |  |   speech_to_text: { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2024-01-24 01:05:37 +08:00
										 |  |  |   text_to_speech: { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							| 
									
										
										
										
											2024-02-15 22:41:18 +08:00
										 |  |  |     voice?: string | 
					
						
							|  |  |  |     language?: string | 
					
						
							| 
									
										
										
										
											2024-01-24 01:05:37 +08:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-09-09 19:17:12 +08:00
										 |  |  |   retriever_resource: { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-11-06 19:36:32 +08:00
										 |  |  |   sensitive_word_avoidance: { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-12-18 15:41:24 +08:00
										 |  |  |   annotation_reply?: AnnotationReplyConfig | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   agent_mode: { | 
					
						
							|  |  |  |     enabled: boolean | 
					
						
							| 
									
										
										
										
											2024-01-23 19:31:56 +08:00
										 |  |  |     strategy?: AgentStrategy | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |     tools: ToolItem[] | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   model: { | 
					
						
							|  |  |  |     /** LLM provider, e.g., OPENAI */ | 
					
						
							|  |  |  |     provider: string | 
					
						
							|  |  |  |     /** Model name, e.g, gpt-3.5.turbo */ | 
					
						
							|  |  |  |     name: string | 
					
						
							| 
									
										
										
										
											2023-10-12 23:14:28 +08:00
										 |  |  |     mode: ModelModeType | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |     /** Default Completion call parameters */ | 
					
						
							|  |  |  |     completion_params: { | 
					
						
							|  |  |  |       /** Maximum number of tokens in the answer message returned by Completion */ | 
					
						
							|  |  |  |       max_tokens: number | 
					
						
							|  |  |  |       /** | 
					
						
							|  |  |  |        * A number between 0 and 2. | 
					
						
							|  |  |  |        * The larger the number, the more random the result; | 
					
						
							|  |  |  |        * otherwise, the more deterministic. | 
					
						
							|  |  |  |        * When in use, choose either `temperature` or `top_p`. | 
					
						
							|  |  |  |        * Default is 1. | 
					
						
							|  |  |  |        */ | 
					
						
							|  |  |  |       temperature: number | 
					
						
							|  |  |  |       /** | 
					
						
							|  |  |  |        * Represents the proportion of probability mass samples to take, | 
					
						
							|  |  |  |        * e.g., 0.1 means taking the top 10% probability mass samples. | 
					
						
							|  |  |  |        * The determinism between the samples is basically consistent. | 
					
						
							|  |  |  |        * Among these results, the `top_p` probability mass results are taken. | 
					
						
							|  |  |  |        * When in use, choose either `temperature` or `top_p`. | 
					
						
							|  |  |  |        * Default is 1. | 
					
						
							|  |  |  |        */ | 
					
						
							|  |  |  |       top_p: number | 
					
						
							|  |  |  |       /** When enabled, the Completion Text will concatenate the Prompt content together and return it. */ | 
					
						
							|  |  |  |       echo: boolean | 
					
						
							|  |  |  |       /** | 
					
						
							|  |  |  |        * Specify up to 4 to automatically stop generating before the text specified in `stop`. | 
					
						
							|  |  |  |        * Suitable for use in chat mode. | 
					
						
							|  |  |  |        * For example, specify "Q" and "A", | 
					
						
							|  |  |  |        * and provide some Q&A examples as context, | 
					
						
							|  |  |  |        * and the model will give out in Q&A format and stop generating before Q&A. | 
					
						
							|  |  |  |        */ | 
					
						
							|  |  |  |       stop: string[] | 
					
						
							|  |  |  |       /** | 
					
						
							|  |  |  |        * A number between -2.0 and 2.0. | 
					
						
							|  |  |  |        * The larger the value, the less the model will repeat topics and the more it will provide new topics. | 
					
						
							|  |  |  |        */ | 
					
						
							|  |  |  |       presence_penalty: number | 
					
						
							|  |  |  |       /** | 
					
						
							|  |  |  |        * A number between -2.0 and 2.0. | 
					
						
							|  |  |  |        * A lower setting will make the model appear less cultured, | 
					
						
							|  |  |  |        * always repeating expressions. | 
					
						
							|  |  |  |        * The difference between `frequency_penalty` and `presence_penalty` | 
					
						
							|  |  |  |        * is that `frequency_penalty` penalizes a word based on its frequency in the training data, | 
					
						
							|  |  |  |        * while `presence_penalty` penalizes a word based on its occurrence in the input text. | 
					
						
							|  |  |  |        */ | 
					
						
							|  |  |  |       frequency_penalty: number | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2023-10-12 23:14:28 +08:00
										 |  |  |   dataset_configs: DatasetConfigs | 
					
						
							| 
									
										
										
										
											2023-11-13 22:32:39 +08:00
										 |  |  |   file_upload?: { | 
					
						
							|  |  |  |     image: VisionSettings | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   files?: VisionFile[] | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export type Language = typeof LanguagesSupported[number] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Web Application Configuration | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export type SiteConfig = { | 
					
						
							|  |  |  |   /** Application URL Identifier: `http://dify.app/{access_token}` */ | 
					
						
							|  |  |  |   access_token: string | 
					
						
							|  |  |  |   /** Public Title */ | 
					
						
							|  |  |  |   title: string | 
					
						
							|  |  |  |   /** Application Description will be shown in the Client  */ | 
					
						
							|  |  |  |   description: string | 
					
						
							|  |  |  |   /** Author */ | 
					
						
							|  |  |  |   author: string | 
					
						
							|  |  |  |   /** User Support Email Address */ | 
					
						
							|  |  |  |   support_email: string | 
					
						
							|  |  |  |   /** | 
					
						
							|  |  |  |    * Default Language, e.g. zh-Hans, en-US | 
					
						
							|  |  |  |    * Use standard RFC 4646, see https://www.ruanyifeng.com/blog/2008/02/codes_for_language_names.html
 | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   default_language: Language | 
					
						
							|  |  |  |   /**  Custom Domain */ | 
					
						
							|  |  |  |   customize_domain: string | 
					
						
							|  |  |  |   /** Theme */ | 
					
						
							|  |  |  |   theme: string | 
					
						
							|  |  |  |   /** Custom Token strategy Whether Terminal Users can choose their OpenAI Key */ | 
					
						
							|  |  |  |   customize_token_strategy: 'must' | 'allow' | 'not_allow' | 
					
						
							|  |  |  |   /** Is Prompt Public */ | 
					
						
							|  |  |  |   prompt_public: boolean | 
					
						
							|  |  |  |   /** Web API and APP Base Domain Name */ | 
					
						
							|  |  |  |   app_base_url: string | 
					
						
							|  |  |  |   /** Copyright */ | 
					
						
							|  |  |  |   copyright: string | 
					
						
							|  |  |  |   /** Privacy Policy */ | 
					
						
							|  |  |  |   privacy_policy: string | 
					
						
							| 
									
										
										
										
											2023-06-13 14:54:12 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   icon: string | 
					
						
							|  |  |  |   icon_background: string | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * App | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export type App = { | 
					
						
							|  |  |  |   /** App ID */ | 
					
						
							|  |  |  |   id: string | 
					
						
							|  |  |  |   /** Name */ | 
					
						
							|  |  |  |   name: string | 
					
						
							| 
									
										
										
										
											2023-05-19 17:36:44 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   /** Icon */ | 
					
						
							|  |  |  |   icon: string | 
					
						
							|  |  |  |   /** Icon Background */ | 
					
						
							|  |  |  |   icon_background: string | 
					
						
							| 
									
										
										
										
											2023-06-01 23:19:36 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   /** Mode */ | 
					
						
							|  |  |  |   mode: AppMode | 
					
						
							| 
									
										
										
										
											2024-01-23 19:31:56 +08:00
										 |  |  |   is_agent: boolean | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   /** Enable web app */ | 
					
						
							|  |  |  |   enable_site: boolean | 
					
						
							|  |  |  |   /** Enable web API */ | 
					
						
							|  |  |  |   enable_api: boolean | 
					
						
							|  |  |  |   /** API requests per minute, default is 60 */ | 
					
						
							|  |  |  |   api_rpm: number | 
					
						
							|  |  |  |   /** API requests per hour, default is 3600 */ | 
					
						
							|  |  |  |   api_rph: number | 
					
						
							|  |  |  |   /** Whether it's a demo app */ | 
					
						
							|  |  |  |   is_demo: boolean | 
					
						
							|  |  |  |   /** Model configuration */ | 
					
						
							|  |  |  |   model_config: ModelConfig | 
					
						
							| 
									
										
										
										
											2023-05-25 16:59:47 +08:00
										 |  |  |   app_model_config: ModelConfig | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |   /** Timestamp of creation */ | 
					
						
							|  |  |  |   created_at: number | 
					
						
							|  |  |  |   /** Web Application Configuration */ | 
					
						
							|  |  |  |   site: SiteConfig | 
					
						
							|  |  |  |   /** api site url */ | 
					
						
							|  |  |  |   api_base_url: string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * App Template | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export type AppTemplate = { | 
					
						
							|  |  |  |   /** Name */ | 
					
						
							|  |  |  |   name: string | 
					
						
							|  |  |  |   /** Description */ | 
					
						
							|  |  |  |   description: string | 
					
						
							|  |  |  |   /** Mode */ | 
					
						
							|  |  |  |   mode: AppMode | 
					
						
							|  |  |  |   /** Model */ | 
					
						
							|  |  |  |   model_config: ModelConfig | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2023-11-13 22:32:39 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | export enum Resolution { | 
					
						
							|  |  |  |   low = 'low', | 
					
						
							|  |  |  |   high = 'high', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export enum TransferMethod { | 
					
						
							|  |  |  |   all = 'all', | 
					
						
							|  |  |  |   local_file = 'local_file', | 
					
						
							|  |  |  |   remote_url = 'remote_url', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-01 10:04:14 +08:00
										 |  |  | export const ALLOW_FILE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'webp', 'gif'] | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-13 22:32:39 +08:00
										 |  |  | export type VisionSettings = { | 
					
						
							|  |  |  |   enabled: boolean | 
					
						
							|  |  |  |   number_limits: number | 
					
						
							|  |  |  |   detail: Resolution | 
					
						
							|  |  |  |   transfer_methods: TransferMethod[] | 
					
						
							|  |  |  |   image_file_size_limit?: number | string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export type ImageFile = { | 
					
						
							|  |  |  |   type: TransferMethod | 
					
						
							|  |  |  |   _id: string | 
					
						
							|  |  |  |   fileId: string | 
					
						
							|  |  |  |   file?: File | 
					
						
							|  |  |  |   progress: number | 
					
						
							|  |  |  |   url: string | 
					
						
							|  |  |  |   base64Url?: string | 
					
						
							| 
									
										
										
										
											2023-11-16 11:56:11 +08:00
										 |  |  |   deleted?: boolean | 
					
						
							| 
									
										
										
										
											2023-11-13 22:32:39 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export type VisionFile = { | 
					
						
							|  |  |  |   id?: string | 
					
						
							|  |  |  |   type: string | 
					
						
							|  |  |  |   transfer_method: TransferMethod | 
					
						
							|  |  |  |   url: string | 
					
						
							|  |  |  |   upload_file_id: string | 
					
						
							| 
									
										
										
										
											2024-01-23 19:31:56 +08:00
										 |  |  |   belongs_to?: string | 
					
						
							| 
									
										
										
										
											2023-11-13 22:32:39 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-11-18 11:53:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | export type RetrievalConfig = { | 
					
						
							|  |  |  |   search_method: RETRIEVE_METHOD | 
					
						
							|  |  |  |   reranking_enable: boolean | 
					
						
							|  |  |  |   reranking_model: { | 
					
						
							|  |  |  |     reranking_provider_name: string | 
					
						
							|  |  |  |     reranking_model_name: string | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  |   top_k: number | 
					
						
							| 
									
										
										
										
											2023-11-27 15:38:05 +08:00
										 |  |  |   score_threshold_enabled: boolean | 
					
						
							| 
									
										
										
										
											2023-11-18 11:53:35 +08:00
										 |  |  |   score_threshold: number | 
					
						
							|  |  |  | } |