Skip to content

Commit b25c0e4

Browse files
authored
fix: prompt assistants with responses (#538)
assistants were prompted two times, once with responses, once without only the last completion was recorded
1 parent 022b837 commit b25c0e4

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/hooks/useAssistants.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,17 @@ const useAssistants = (): UseAssistantsValues => {
167167
promptMode,
168168
),
169169
);
170+
} else {
171+
promise = promptAssistant(
172+
assistant,
173+
promptForSingleResponse(
174+
instructions.title.content,
175+
t,
176+
includeDetails ? instructions.details?.content : undefined,
177+
promptMode,
178+
),
179+
);
170180
}
171-
promise = promptAssistant(
172-
assistant,
173-
promptForSingleResponse(
174-
instructions.title.content,
175-
t,
176-
includeDetails ? instructions.details?.content : undefined,
177-
promptMode,
178-
),
179-
);
180181
return promise.then(async (assistantResponseAppData) => {
181182
if (assistantResponseAppData) {
182183
const { completion: response, assistantId } =

0 commit comments

Comments
 (0)