Skip to content

Commit

Permalink
Undo bad changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeaudoincoveo committed Aug 24, 2023
1 parent cf89931 commit ec65fd0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {createAction, createAsyncThunk} from '@reduxjs/toolkit';
import {AsyncThunkGeneratedAnswerOptions} from '../../api/generated-answer/generated-answer-client';
import {
GeneratedAnswerCitationsPayload,
/* GeneratedAnswerEndOfStreamPayload, */
GeneratedAnswerEndOfStreamPayload,
GeneratedAnswerMessagePayload,
GeneratedAnswerPayloadType,
GeneratedAnswerStreamEventData,
Expand All @@ -21,8 +21,7 @@ import {
SearchSection,
} from '../../state/state-sections';
import {validatePayload} from '../../utils/validate-payload';
// TODO: uncomment; this is making the build fail because this import doesn't exist
// import {logGeneratedAnswerStreamEnd} from './generated-answer-analytics-actions';
import {logGeneratedAnswerStreamEnd} from './generated-answer-analytics-actions';
import {buildStreamingRequest} from './generated-answer-request';

type StateNeededByGeneratedAnswerStream = ConfigurationSection &
Expand Down Expand Up @@ -125,16 +124,15 @@ export const streamAnswer = createAsyncThunk<
)
);
break;
// TODO: uncomment; this is making the build fail because logGeneratedAnswerStreamEnd doesn't exist
/*case 'genqa.endOfStreamType':
case 'genqa.endOfStreamType':
dispatch(setIsStreaming(false));
dispatch(
logGeneratedAnswerStreamEnd(
(JSON.parse(payload) as GeneratedAnswerEndOfStreamPayload)
.answerGenerated
)
);
break; */
break;
default:
if (state.debug) {
extra.logger.warn(`Unknown payloadType: "${payloadType}"`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,21 @@ export const logDislikeGeneratedAnswer = (): CustomAction =>
}
);

// TODO: un-uncomment; this is currently failing the build because client.makeRetryGeneratedAnswer doesn't exist.
// export const logGeneratedAnswerStreamEnd = (
// answerGenerated: boolean
// ): CustomAction =>
// makeAnalyticsAction(
// 'analytics/generatedAnswer/streamEnd',
// AnalyticsType.Custom,
// (client, state) => {
// const generativeQuestionAnsweringId =
// generativeQuestionAnsweringIdSelector(state);
// if (!generativeQuestionAnsweringId) {
// return null;
// }
// return client.makeRetryGeneratedAnswer({
// generativeQuestionAnsweringId,
// answerGenerated,
// });
// }
// );
export const logGeneratedAnswerStreamEnd = (
answerGenerated: boolean
): CustomAction =>
makeAnalyticsAction(
'analytics/generatedAnswer/streamEnd',
AnalyticsType.Custom,
(client, state) => {
const generativeQuestionAnsweringId =
generativeQuestionAnsweringIdSelector(state);
if (!generativeQuestionAnsweringId) {
return null;
}
return client.makeGeneratedAnswerStreamEnd({
generativeQuestionAnsweringId,
answerGenerated,
});
}
);

0 comments on commit ec65fd0

Please sign in to comment.