Skip to content

Commit

Permalink
Merge branch 'development' into fix/3002-playback-starters
Browse files Browse the repository at this point in the history
  • Loading branch information
Gimir authored Jan 28, 2025
2 parents c6cba0d + 5b870fa commit b318d21
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/chat-e2e/src/ui/webElements/conversationToCompare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ConversationToCompare extends BaseElement {

public async selectCompareConversation(
name: string,
{ isHttpMethodTriggered = true }: { isHttpMethodTriggered?: boolean } = {},
{ isHttpMethodTriggered = false }: { isHttpMethodTriggered?: boolean } = {},
) {
if (isHttpMethodTriggered) {
const respPromise = this.page.waitForResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class BaseSideBarConversationTree extends SideBarEntitiesTree {
public async selectConversation(
name: string,
indexOrOptions?: number | { exactMatch: boolean; index?: number },
{ isHttpMethodTriggered = true }: { isHttpMethodTriggered?: boolean } = {},
{ isHttpMethodTriggered = false }: { isHttpMethodTriggered?: boolean } = {},
) {
const conversationToSelect = this.getTreeEntity(name, indexOrOptions);
if (isApiStorageType && isHttpMethodTriggered) {
Expand Down
37 changes: 28 additions & 9 deletions apps/chat/src/store/conversations/conversations.epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3092,6 +3092,10 @@ const updateLastConversationSettingsEpic: AppEpic = (action$, state$) =>
})),
switchMap(({ lastConversation }) =>
forkJoin({
oldTemperature: of((lastConversation as Conversation)?.temperature),
wasAlreadyUploaded: of(
lastConversation?.status === UploadStatus.LOADED,
),
lastConversation:
lastConversation &&
lastConversation.status !== UploadStatus.LOADED &&
Expand All @@ -3108,15 +3112,30 @@ const updateLastConversationSettingsEpic: AppEpic = (action$, state$) =>
: of(lastConversation as Conversation),
}),
),
switchMap(({ lastConversation }) => {
// don't save for temp empty conversation to be able to reset settings by "New conversation"
return lastConversation && !isEntityIdLocal(lastConversation)
? of(
ConversationsActions.setLastConversationSettings({
temperature: lastConversation.temperature,
}),
)
: EMPTY;
switchMap(({ lastConversation, oldTemperature, wasAlreadyUploaded }) => {
if (
!lastConversation ||
// don't save for temp empty conversation to be able to reset settings by "New conversation"
isEntityIdLocal(lastConversation) ||
// don't save if already uploaded and nothing changed
(wasAlreadyUploaded && oldTemperature === lastConversation.temperature)
) {
return EMPTY;
}

return concat(
of(
ConversationsActions.setLastConversationSettings({
temperature: lastConversation.temperature,
}),
),
of(
ConversationsActions.uploadConversationsByIdsSuccess({
setIds: new Set(lastConversation.id),
conversations: [lastConversation],
}),
),
);
}),
);

Expand Down

0 comments on commit b318d21

Please sign in to comment.