feat: Add temporary system prompt

Adds a new setting that allows users to set a temporary system prompt for the current chat.
This prompt will override the selected system prompt if it exists.
The new setting is available in the "Current Chat Model Settings" modal.
This feature provides a way to quickly experiment with different system prompts without having to change the default setting.
This commit is contained in:
n4ze3m
2024-10-02 12:30:52 +05:30
parent 2e97f6470d
commit 0e44a7ad4b
15 changed files with 240 additions and 112 deletions

View File

@@ -63,6 +63,8 @@ type CurrentChatModelSettings = {
setX: (key: string, value: any) => void
reset: () => void
systemPrompt?: string
setSystemPrompt: (systemPrompt: string) => void
}
export const useStoreChatModelSettings = create<CurrentChatModelSettings>(
@@ -100,6 +102,8 @@ export const useStoreChatModelSettings = create<CurrentChatModelSettings>(
setVocabOnly: (vocabOnly: boolean) => set({ vocabOnly }),
seetSeed: (seed: number) => set({ seed }),
setX: (key: string, value: any) => set({ [key]: value }),
systemPrompt: undefined,
setSystemPrompt: (systemPrompt: string) => set({ systemPrompt }),
reset: () =>
set({
f16KV: undefined,
@@ -130,7 +134,8 @@ export const useStoreChatModelSettings = create<CurrentChatModelSettings>(
useMLock: undefined,
useMMap: undefined,
vocabOnly: undefined,
seed: undefined
seed: undefined,
systemPrompt: undefined
})
})
)