Skip to content

Commit 00d6214

Browse files
authored
Merge pull request #6676 from bakaphp/hotfix/release-164
Merge pull request #6661 from bakaphp/hotfix/stop-clock-issue
2 parents 1a6fd7a + efb5da8 commit 00d6214

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Domains/Connectors/PromptMine/Workflows/Activities/LLMMessageResponseActivity.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ private function generateImageResponse(Message $message): array
353353
$channel = $message->channels?->first();
354354
$previousChatResponse = $channel !== null ? $channel->getPreviousMessage($message) : null;
355355

356-
if ($previousChatResponse instanceof Message && $previousChatResponse->isRoot()) {
356+
//remix have a diff flow because its parent is not the main source
357+
if ($previousChatResponse instanceof Message && ($previousChatResponse->isRoot() || isset($previousChatResponse->message['remix_parent_id']))) {
357358
if (array_key_exists('is_regeneration', $message->message) && $message->message['is_regeneration'] && $message->children()->count() > 0) {
358359
$previousChatResponseMessage = $message->message['prompt'];
359360
$previousChatImage = $this->getLastAssistantResponse($chatHistory);
@@ -554,6 +555,7 @@ protected function getLastAssistantResponse(array $chatHistory): array
554555
});
555556
array_pop($assistantMessages);
556557
$assistantMessages[key($assistantMessages)]['original_index'] = key($assistantMessages);
558+
557559
return end($assistantMessages);
558560
}
559561
}

0 commit comments

Comments
 (0)