Skip to content

Commit

Permalink
fix: pointer being reversed in parsers
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Dec 13, 2023
1 parent 621b914 commit 57a5a69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/parsers/basic_input_output_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const BasicInputOutputParser: MessageParser = {
* From UX, only the last interaction need to parse suggestedActions.
*/
const isLatestInteraction =
options.interactions.reverse()[0]?.interaction_id === interaction.interaction_id;
[...options.interactions].reverse()[0]?.interaction_id === interaction.interaction_id;
const suggestedActions = isLatestInteraction
? parseSuggestedActions(
(interaction.additional_info?.['QuestionSuggestor.output'] as string | null) || ''
Expand Down
4 changes: 3 additions & 1 deletion server/services/storage/agent_framework_storage_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export class AgentFrameworkStorageService implements StorageService {
for (const interaction of finalInteractions) {
finalMessages = [
...finalMessages,
...(await messageParserRunner.run(interaction, { interactions: finalInteractions })),
...(await messageParserRunner.run(interaction, {
interactions: [...(finalInteractions || [])],
})),
];
}
return {
Expand Down

0 comments on commit 57a5a69

Please sign in to comment.