mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-20 21:06:39 +08:00
feat: to new api
This commit is contained in:
25
types/app.ts
25
types/app.ts
@ -6,7 +6,8 @@ export type PromptVariable = {
|
||||
type: "string" | "number" | "select",
|
||||
default?: string | number,
|
||||
options?: string[]
|
||||
max_length: number
|
||||
max_length?: number
|
||||
required: boolean
|
||||
}
|
||||
|
||||
export type PromptConfig = {
|
||||
@ -14,6 +15,28 @@ export type PromptConfig = {
|
||||
prompt_variables: PromptVariable[],
|
||||
}
|
||||
|
||||
export type TextTypeFormItem = {
|
||||
label: string,
|
||||
variable: string,
|
||||
required: boolean
|
||||
max_length: number
|
||||
}
|
||||
|
||||
export type SelectTypeFormItem = {
|
||||
label: string,
|
||||
variable: string,
|
||||
required: boolean,
|
||||
options: string[]
|
||||
}
|
||||
/**
|
||||
* User Input Form Item
|
||||
*/
|
||||
export type UserInputFormItem = {
|
||||
'text-input': TextTypeFormItem
|
||||
} | {
|
||||
'select': SelectTypeFormItem
|
||||
}
|
||||
|
||||
export const MessageRatings = ['like', 'dislike', null] as const
|
||||
export type MessageRating = typeof MessageRatings[number]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user