Skip to content

Commit

Permalink
Merge pull request #271 from n4ze3m/next
Browse files Browse the repository at this point in the history
feat: Set system prompt from last used chat prompt
  • Loading branch information
n4ze3m authored Dec 8, 2024
2 parents a027520 + dcd52ad commit 9faeca9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Option/Playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ export const Playground = () => {
const lastUsedPrompt = await getLastUsedChatSystemPrompt(
recentChat.history.id
)
console.log("lastUsedPrompt", lastUsedPrompt)
if (lastUsedPrompt) {
if (lastUsedPrompt.prompt_id) {
const prompt = await getPromptById(lastUsedPrompt.prompt_id)
if (prompt) {
setSelectedSystemPrompt(lastUsedPrompt.prompt_id)
setSystemPrompt(lastUsedPrompt.prompt_content)
}
}
setSystemPrompt(lastUsedPrompt.prompt_content)
Expand Down

0 comments on commit 9faeca9

Please sign in to comment.