Skip to content

Commit 4e313a0

Browse files
committed
Apply review suggestions
1 parent 35d4823 commit 4e313a0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ai/ai-react-app/src/components/Layout/LeftSidebar.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,17 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({
108108
const handleCustomPersonaChange = (
109109
e: React.ChangeEvent<HTMLTextAreaElement>,
110110
) => {
111-
setCustomPersona(e.target.value);
111+
const newSystemInstructionText = e.target.value;
112+
setCustomPersona(newSystemInstructionText); // 1. update UI state
113+
const newSystemInstruction: Content = {
114+
parts: [{ text: newSystemInstructionText}],
115+
role: 'system'
116+
}
117+
// 2. Update model state upwards, triggering re-rendering
118+
handleModelParamsUpdate((prev: ModelParams) => ({
119+
...prev,
120+
systemInstruction: newSystemInstruction
121+
}));
112122
};
113123

114124
return (

0 commit comments

Comments
 (0)