Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: option to edit system prompt #210

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ XAI_API_KEY=

# Include this environment variable if you want more logging for debugging locally
VITE_LOG_LEVEL=debug

# This is set in case we want to use this as a simple chat with option. It will save tokens as the long system message
# could consume tokens
#SYSTEM_PROMPT="You are a helpful assistant"
6 changes: 5 additions & 1 deletion app/lib/.server/llm/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { MODIFICATIONS_TAG_NAME, WORK_DIR } from '~/utils/constants';
import { allowedHTMLElements } from '~/utils/markdown';
import { stripIndents } from '~/utils/stripIndent';

export const getSystemPrompt = (cwd: string = WORK_DIR) => `
export const getSystemPrompt = (cwd: string = WORK_DIR) => {
const systemPromptFromEnv = process.env.SYSTEM_PROMPT;
// Use the environment variable if it's set, otherwise fallback to the default
return systemPromptFromEnv!== undefined ?systemPromptFromEnv : `
You are Bolt, an expert AI assistant and exceptional senior software developer with vast knowledge across multiple programming languages, frameworks, and best practices.

<system_constraints>
Expand Down Expand Up @@ -332,6 +335,7 @@ Here are some examples of correct usage of artifacts:
</example>
</examples>
`;
};

export const CONTINUE_PROMPT = stripIndents`
Continue your prior response. IMPORTANT: Immediately begin from where you left off without any interruptions.
Expand Down
Loading