Skip to content

Commit 9faeca9

Browse files
authored
Merge pull request #271 from n4ze3m/next
feat: Set system prompt from last used chat prompt
2 parents a027520 + dcd52ad commit 9faeca9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/Option/Playground/Playground.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ export const Playground = () => {
104104
const lastUsedPrompt = await getLastUsedChatSystemPrompt(
105105
recentChat.history.id
106106
)
107+
console.log("lastUsedPrompt", lastUsedPrompt)
107108
if (lastUsedPrompt) {
108109
if (lastUsedPrompt.prompt_id) {
109110
const prompt = await getPromptById(lastUsedPrompt.prompt_id)
110111
if (prompt) {
111112
setSelectedSystemPrompt(lastUsedPrompt.prompt_id)
113+
setSystemPrompt(lastUsedPrompt.prompt_content)
112114
}
113115
}
114116
setSystemPrompt(lastUsedPrompt.prompt_content)

0 commit comments

Comments
 (0)