forked from tuvn86/webapp-conversation
feat: to new api
This commit is contained in:
parent
d728cbb267
commit
06f502a524
5 changed files with 59 additions and 8 deletions
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]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue