feat: support assistant frontend (#2139)

Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
Joel
2024-01-23 19:31:56 +08:00
committed by GitHub
parent e65a2a400d
commit 7bbe12b2bd
194 changed files with 8726 additions and 1586 deletions

View File

@@ -1,4 +1,4 @@
import type { ModelModeType, RETRIEVE_TYPE } from '@/types/app'
import type { AgentStrategy, ModelModeType, RETRIEVE_TYPE, ToolItem } from '@/types/app'
export type Inputs = Record<string, string | number | object>
export enum PromptMode {
@@ -41,10 +41,14 @@ export type PromptVariable = {
name: string
type: string // "string" | "number" | "select",
default?: string | number
required: boolean
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 = {
@@ -98,7 +102,12 @@ export type ModerationConfig = MoreLikeThisConfig & {
}
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"
@@ -112,6 +121,7 @@ export type ModelConfig = {
retriever_resource: RetrieverResourceConfig | null
sensitive_word_avoidance: ModerationConfig | null
dataSets: any[]
agentConfig: AgentConfig
}
export type DatasetConfigItem = {
enable: boolean
@@ -127,6 +137,12 @@ export type DatasetConfigs = {
top_k: number
score_threshold_enabled: boolean
score_threshold: number
datasets: {
datasets: {
enabled: boolean
id: string
}[]
}
}
export type DebugRequestBody = {