Skip to content

Commit

Permalink
only use config schema for default values on assistant creation (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
krishokr authored Oct 26, 2024
1 parent 0b07b1c commit f3d277f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function CreateAssistant() {
const architectureType = form.watch("config.configurable.type");
const tools = form.watch("config.configurable.tools");

// Only use config schema as defaults - don't use in edit
const { systemMessage, retrievalDescription } = useConfigSchema(
architectureType ?? "",
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ function EditAssistantForm({

const { toast } = useToast();

const { systemMessage, retrievalDescription } = useConfigSchema(
architectureType ?? "",
);

const { availableTools } = useAvailableTools();

useEffect(() => {
Expand All @@ -70,18 +66,6 @@ function EditAssistantForm({
}
}, [selectedAssistant]);

useEffect(() => {
if (architectureType) {
// @ts-ignore
form.setValue("config.configurable.system_message", systemMessage);
form.setValue(
"config.configurable.retrieval_description",
// @ts-ignore
retrievalDescription,
);
}
}, [architectureType]);

useEffect(() => {
if (architectureType !== "agent") {
// Set undefined agent_type if bot is not an agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default function FilesDialog({ form, classNames }: TFilesDialog) {
</Button>
</DialogClose>
</DialogFooter>
</DialogContent>
`` </DialogContent>
</Dialog>
);
}

0 comments on commit f3d277f

Please sign in to comment.