Skip to content

Commit 6740b80

Browse files
committed
fix: chat user instructions
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
1 parent cf19b7b commit 6740b80

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Controller/ChattyLLMController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ public function newSession(int $timestamp, ?string $title = null): JSONResponse
133133
'chat_user_instructions',
134134
Application::CHAT_USER_INSTRUCTIONS,
135135
);
136+
if ($userInstructions === '') {
137+
$userInstructions = Application::CHAT_USER_INSTRUCTIONS;
138+
}
136139
$userInstructions = str_replace('{user}', $user->getDisplayName(), $userInstructions);
137140

138141
try {
@@ -737,6 +740,9 @@ public function checkTitleGenerationTask(int $taskId, int $sessionId): JSONRespo
737740
'chat_user_instructions_title',
738741
Application::CHAT_USER_INSTRUCTIONS_TITLE,
739742
);
743+
if ($userInstructions === '') {
744+
$userInstructions = Application::CHAT_USER_INSTRUCTIONS_TITLE;
745+
}
740746
$userInstructions = str_replace('{user}', $user->getDisplayName(), $userInstructions);
741747
$title = str_replace($userInstructions, '', $taskOutput);
742748
$title = str_replace('"', '', $title);

0 commit comments

Comments
 (0)