We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35d4823 commit 4e313a0Copy full SHA for 4e313a0
ai/ai-react-app/src/components/Layout/LeftSidebar.tsx
@@ -108,7 +108,17 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({
108
const handleCustomPersonaChange = (
109
e: React.ChangeEvent<HTMLTextAreaElement>,
110
) => {
111
- setCustomPersona(e.target.value);
+ 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
+ }));
122
};
123
124
return (
0 commit comments