@@ -23,6 +23,7 @@ import { z } from 'zod';
2323
2424const schema = z . object ( {
2525 name : z . string ( ) . min ( 1 ) ,
26+ is_public : z . boolean ( ) . optional ( ) ,
2627 llm_id : z . number ( ) . optional ( ) ,
2728 fast_llm_id : z . number ( ) . optional ( ) ,
2829 reranker_id : z . number ( ) . optional ( ) ,
@@ -42,6 +43,7 @@ const schema = z.object({
4243const field = formFieldLayout < typeof schema > ( ) ;
4344
4445const nameSchema = z . string ( ) . min ( 1 ) ;
46+ const isPublicSchema = z . boolean ( ) ;
4547const kbSchema = z . object ( { id : z . number ( ) } ) . array ( ) . min ( 1 ) ;
4648const kgGraphDepthSchema = z . number ( ) . min ( 1 ) . optional ( ) ;
4749
@@ -53,6 +55,9 @@ export function CreateChatEngineForm ({ defaultChatEngineOptions }: { defaultCha
5355
5456 const form = useForm ( {
5557 onSubmit : onSubmitHelper ( schema , async data => {
58+ if ( data . is_public == null ) {
59+ data . is_public = true ;
60+ }
5661 const ce = await createChatEngine ( data ) ;
5762 startTransition ( ( ) => {
5863 router . push ( `/chat-engines/${ ce . id } ` ) ;
@@ -85,6 +90,9 @@ export function CreateChatEngineForm ({ defaultChatEngineOptions }: { defaultCha
8590 < field . Basic required name = "name" label = "Name" defaultValue = "" validators = { { onSubmit : nameSchema , onBlur : nameSchema } } >
8691 < FormInput placeholder = "Enter chat engine name" />
8792 </ field . Basic >
93+ < field . Contained name = 'is_public' label = "Is Public" defaultValue = { true } >
94+ < FormSwitch />
95+ </ field . Contained >
8896 < SubSection title = "Models" >
8997 < field . Basic name = "llm_id" label = "LLM" >
9098 < LLMSelect />
@@ -279,4 +287,4 @@ const llmPromptDescriptions: { [P in typeof llmPromptFields[number]]: string } =
279287 'clarifying_question_prompt' : 'Prompt template for generating clarifying questions when the user\'s input needs more context or specificity' ,
280288 'generate_goal_prompt' : 'Prompt template for generating conversation goals and objectives based on user input' ,
281289 'further_questions_prompt' : 'Prompt template for generating follow-up questions to continue the conversation' ,
282- } ;
290+ } ;
0 commit comments