Skip to content

Commit b497bcb

Browse files
GovernmentPlatesThiefMaster
authored andcommitted
Add custom prompt option
1 parent 3f196c3 commit b497bcb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ai_summary/indico_ai_summary/client/components/ind_summarize_button.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,16 @@ function SummarizeButton({eventId, streamResponse, llmInfo}) {
135135
};
136136

137137
const getPrompts = async () => {
138+
let prompts = [];
138139
try {
139-
const prompts = await indicoAxios.get(getStoredPrompts({event_id: eventId}));
140-
setPrompts(prompts.data);
140+
prompts = await indicoAxios.get(getStoredPrompts({event_id: eventId}));
141141
} catch (e) {
142142
handleAxiosError(e);
143143
}
144+
// Append a custom prompt option
145+
prompts = prompts.data;
146+
prompts.push({name: 'Custom Prompt', text: ''});
147+
setPrompts(prompts);
144148
};
145149

146150
const renderSummarizeButton = (loading, streamResponse, error) => {

0 commit comments

Comments
 (0)