feat: to new api

This commit is contained in:
Joel
2023-05-09 14:56:37 +08:00
parent d728cbb267
commit 06f502a524
5 changed files with 59 additions and 8 deletions

View File

@ -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]