feat: advanced prompt (#1330)
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: Gillian97 <jinling.sunshine@gmail.com>
This commit is contained in:
@@ -1,5 +1,41 @@
|
||||
import type { ModelModeType } from '@/types/app'
|
||||
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
|
||||
@@ -17,6 +53,7 @@ export type CompletionParams = {
|
||||
top_p: number
|
||||
presence_penalty: number
|
||||
frequency_penalty: number
|
||||
stop?: string[]
|
||||
}
|
||||
|
||||
export type ModelId = 'gpt-3.5-turbo' | 'text-davinci-003'
|
||||
@@ -42,6 +79,7 @@ export type RetrieverResourceConfig = MoreLikeThisConfig
|
||||
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
|
||||
@@ -50,6 +88,14 @@ export type ModelConfig = {
|
||||
retriever_resource: RetrieverResourceConfig | null
|
||||
dataSets: any[]
|
||||
}
|
||||
export type DatasetConfigItem = {
|
||||
enable: boolean
|
||||
value: number
|
||||
}
|
||||
export type DatasetConfigs = {
|
||||
top_k: number
|
||||
score_threshold: DatasetConfigItem
|
||||
}
|
||||
|
||||
export type DebugRequestBody = {
|
||||
inputs: Inputs
|
||||
|
Reference in New Issue
Block a user