feat: support assistant frontend (#2139)
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
@@ -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 = {
|
||||
|
Reference in New Issue
Block a user