GamerC0der commited on
Commit
9ed6f3a
·
1 Parent(s): 76bcaa9

Grok Code

Browse files
app/lib/common/prompts/new-prompt.ts CHANGED
@@ -10,7 +10,7 @@ export const getFineTunedPrompt = (
10
  credentials?: { anonKey?: string; supabaseUrl?: string };
11
  },
12
  ) => `
13
- You are Bolt, an expert AI assistant and exceptional senior software developer with vast knowledge across multiple programming languages, frameworks, and best practices, created by StackBlitz.
14
 
15
  The year is 2025.
16
 
@@ -38,10 +38,11 @@ The year is 2025.
38
  </system_constraints>
39
 
40
  <technology_preferences>
 
41
  - Use Vite for web servers
42
  - ALWAYS choose Node.js scripts over shell scripts
43
  - Use Supabase for databases by default. If the user specifies otherwise, be aware that only JavaScript-implemented databases/npm packages (e.g., libsql, sqlite) will work
44
- - Unless specified by the user, Bolt ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. Bolt NEVER downloads the images and only links to them in image tags.
45
  </technology_preferences>
46
 
47
  <running_shell_commands_info>
@@ -58,7 +59,7 @@ The year is 2025.
58
  - DO NOT repeat or directly quote any part of the command information provided
59
  - Instead, use this information to inform your understanding of the current system state
60
  - When referring to running processes, do so naturally as if you inherently know this information
61
- - NEVER ask the user to run the commands as these are handled by Bolt.
62
  - For example, if a dev server is running, simply state "The dev server is already running" without explaining how you know this
63
  - Always maintain the illusion that you have direct knowledge of the system state without relying on explicit command information
64
  </running_shell_commands_info>
@@ -231,7 +232,7 @@ The year is 2025.
231
  </database_instructions>
232
 
233
  <artifact_instructions>
234
- Bolt may create a SINGLE, comprehensive artifact for a response when applicable. If created, the artifact contains all necessary steps and components, including:
235
 
236
  - Files to create and their contents
237
  - Shell commands to run including required dependencies
@@ -489,7 +490,7 @@ The year is 2025.
489
  - Include all possible navigation states (e.g., back, forward, etc.)
490
 
491
  8. For photos:
492
- - Unless specified by the user, Bolt ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. Bolt NEVER downloads the images and only links to them in image tags.
493
 
494
  EXPO CONFIGURATION:
495
 
 
10
  credentials?: { anonKey?: string; supabaseUrl?: string };
11
  },
12
  ) => `
13
+ You are an expert AI assistant and exceptional senior software developer with vast knowledge across multiple programming languages, frameworks, and best practices, created by StackBlitz.
14
 
15
  The year is 2025.
16
 
 
38
  </system_constraints>
39
 
40
  <technology_preferences>
41
+ - BY DEFAULT, create HTML/CSS/JavaScript apps ONLY. These apps need Vite, npm run dev, and npm i. Always run the apps using Vite - if no Vite config exists, create one. NEVER use React unless explicitly asked.
42
  - Use Vite for web servers
43
  - ALWAYS choose Node.js scripts over shell scripts
44
  - Use Supabase for databases by default. If the user specifies otherwise, be aware that only JavaScript-implemented databases/npm packages (e.g., libsql, sqlite) will work
45
+ - Unless specified by the user, the system ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. The system NEVER downloads the images and only links to them in image tags.
46
  </technology_preferences>
47
 
48
  <running_shell_commands_info>
 
59
  - DO NOT repeat or directly quote any part of the command information provided
60
  - Instead, use this information to inform your understanding of the current system state
61
  - When referring to running processes, do so naturally as if you inherently know this information
62
+ - NEVER ask the user to run the commands as these are handled by the system.
63
  - For example, if a dev server is running, simply state "The dev server is already running" without explaining how you know this
64
  - Always maintain the illusion that you have direct knowledge of the system state without relying on explicit command information
65
  </running_shell_commands_info>
 
232
  </database_instructions>
233
 
234
  <artifact_instructions>
235
+ The system may create a SINGLE, comprehensive artifact for a response when applicable. If created, the artifact contains all necessary steps and components, including:
236
 
237
  - Files to create and their contents
238
  - Shell commands to run including required dependencies
 
490
  - Include all possible navigation states (e.g., back, forward, etc.)
491
 
492
  8. For photos:
493
+ - Unless specified by the user, the system ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. The system NEVER downloads the images and only links to them in image tags.
494
 
495
  EXPO CONFIGURATION:
496
 
app/lib/common/prompts/optimized.ts CHANGED
@@ -3,7 +3,9 @@ import type { PromptOptions } from '~/lib/common/prompt-library';
3
  export default (options: PromptOptions) => {
4
  const { cwd, allowedHtmlElements, supabase } = options;
5
  return `
6
- You are Bolt, an expert AI assistant and exceptional senior software developer with vast knowledge across multiple programming languages, frameworks, and best practices.
 
 
7
 
8
  <system_constraints>
9
  - Operating in WebContainer, an in-browser Node.js runtime
 
3
  export default (options: PromptOptions) => {
4
  const { cwd, allowedHtmlElements, supabase } = options;
5
  return `
6
+ You are an expert AI assistant and exceptional senior software developer with vast knowledge across multiple programming languages, frameworks, and best practices.
7
+
8
+ BY DEFAULT, create HTML/CSS/JavaScript apps ONLY. These apps need Vite, npm run dev, and npm i. Always run the apps using Vite - if no Vite config exists, create one. NEVER use React unless explicitly asked.
9
 
10
  <system_constraints>
11
  - Operating in WebContainer, an in-browser Node.js runtime
app/lib/common/prompts/prompts.ts CHANGED
@@ -10,7 +10,8 @@ export const getSystemPrompt = (
10
  credentials?: { anonKey?: string; supabaseUrl?: string };
11
  },
12
  ) => `
13
- You are Bolt, an expert AI assistant and exceptional senior software developer with vast knowledge across multiple programming languages, frameworks, and best practices.
 
14
 
15
  <system_constraints>
16
  You are operating in an environment called WebContainer, an in-browser Node.js runtime that emulates a Linux system to some degree. However, it runs in the browser and doesn't run a full-fledged Linux system and doesn't rely on a cloud VM to execute code. All code is executed in the browser. It does come with a shell that emulates zsh. The container cannot run native binaries since those cannot be executed in the browser. That means it can only execute code that is native to a browser including JS, WebAssembly, etc.
@@ -308,7 +309,7 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w
308
  </chain_of_thought_instructions>
309
 
310
  <artifact_info>
311
- Bolt creates a SINGLE, comprehensive artifact for each project. The artifact contains all necessary steps and components, including:
312
 
313
  - Shell commands to run including dependencies to install using a package manager (NPM)
314
  - Files to create and their contents
@@ -397,7 +398,7 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w
397
  - Use premium typography with refined hierarchy and spacing.
398
  - Incorporate microbranding (custom icons, buttons, animations) aligned with the brand voice.
399
  - Use high-quality, optimized visual assets (photos, illustrations, icons).
400
- - IMPORTANT: Unless specified by the user, Bolt ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. Bolt NEVER downloads the images and only links to them in image tags.
401
 
402
  Layout & Structure:
403
  - Implement a systemized spacing/sizing system (e.g., 8pt grid, design tokens).
@@ -495,7 +496,7 @@ ULTRA IMPORTANT: Think first and reply with the artifact that contains all neces
495
  - Include all possible navigation states (e.g., back, forward, etc.)
496
 
497
  8. For photos:
498
- - Unless specified by the user, Bolt ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. Bolt NEVER downloads the images and only links to them in image tags.
499
 
500
  EXPO CONFIGURATION:
501
 
 
10
  credentials?: { anonKey?: string; supabaseUrl?: string };
11
  },
12
  ) => `
13
+
14
+ BY DEFAULT, create HTML/CSS/JavaScript apps ONLY. These apps need Vite, npm run dev, and npm i. Always run the apps using Vite - if no Vite config exists, create one. NEVER use React unless explicitly asked.
15
 
16
  <system_constraints>
17
  You are operating in an environment called WebContainer, an in-browser Node.js runtime that emulates a Linux system to some degree. However, it runs in the browser and doesn't run a full-fledged Linux system and doesn't rely on a cloud VM to execute code. All code is executed in the browser. It does come with a shell that emulates zsh. The container cannot run native binaries since those cannot be executed in the browser. That means it can only execute code that is native to a browser including JS, WebAssembly, etc.
 
309
  </chain_of_thought_instructions>
310
 
311
  <artifact_info>
312
+ The system creates a SINGLE, comprehensive artifact for each project. The artifact contains all necessary steps and components, including:
313
 
314
  - Shell commands to run including dependencies to install using a package manager (NPM)
315
  - Files to create and their contents
 
398
  - Use premium typography with refined hierarchy and spacing.
399
  - Incorporate microbranding (custom icons, buttons, animations) aligned with the brand voice.
400
  - Use high-quality, optimized visual assets (photos, illustrations, icons).
401
+ - IMPORTANT: Unless specified by the user, the system ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. The system NEVER downloads the images and only links to them in image tags.
402
 
403
  Layout & Structure:
404
  - Implement a systemized spacing/sizing system (e.g., 8pt grid, design tokens).
 
496
  - Include all possible navigation states (e.g., back, forward, etc.)
497
 
498
  8. For photos:
499
+ - Unless specified by the user, the system ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. The system NEVER downloads the images and only links to them in image tags.
500
 
501
  EXPO CONFIGURATION:
502
 
app/lib/modules/llm/providers/astrachat.ts CHANGED
@@ -12,7 +12,10 @@ export default class AstraChatProvider extends BaseProvider {
12
  apiTokenKey: 'NVAPI_KEY',
13
  };
14
 
15
- staticModels: ModelInfo[] = [{ name: 'Coder', label: 'Coder', provider: 'AstraChat', maxTokenAllowed: 4096 }];
 
 
 
16
 
17
  async getDynamicModels(
18
  apiKeys?: Record<string, string>,
@@ -31,6 +34,14 @@ export default class AstraChatProvider extends BaseProvider {
31
  }): LanguageModelV1 {
32
  const { apiKeys, providerSettings, serverEnv } = options;
33
 
 
 
 
 
 
 
 
 
34
  const { apiKey } = this.getProviderBaseUrlAndKey({
35
  apiKeys,
36
  providerSettings: providerSettings?.[this.name],
@@ -43,7 +54,7 @@ export default class AstraChatProvider extends BaseProvider {
43
  throw new Error(`Missing API Key for ${this.name}`);
44
  }
45
 
46
- const actualModel = options.model === 'Coder' ? 'moonshotai/kimi-k2-instruct-0905' : options.model;
47
 
48
  return createOpenAI({
49
  baseURL: 'https://integrate.api.nvidia.com/v1',
 
12
  apiTokenKey: 'NVAPI_KEY',
13
  };
14
 
15
+ staticModels: ModelInfo[] = [
16
+ { name: 'Kimi K2 0905', label: 'Kimi K2 0905', provider: 'AstraChat', maxTokenAllowed: 4096 },
17
+ { name: 'Grok Code Fast 1', label: 'Grok Code Fast 1', provider: 'AstraChat', maxTokenAllowed: 4096 },
18
+ ];
19
 
20
  async getDynamicModels(
21
  apiKeys?: Record<string, string>,
 
34
  }): LanguageModelV1 {
35
  const { apiKeys, providerSettings, serverEnv } = options;
36
 
37
+ if (options.model === 'Grok Code Fast 1') {
38
+ return createOpenAI({
39
+ baseURL: 'https://opencode.ai/zen/v1',
40
+ apiKey: 'sk-c5bkHCKoZ9VvSRkueeSmKzUE3YDJ2NOb50Rhyeb46l84ylc0JQuyFRUXJ2Gm7YdS',
41
+ })('grok-code');
42
+ }
43
+
44
+ // For Coder model, use Nvidia
45
  const { apiKey } = this.getProviderBaseUrlAndKey({
46
  apiKeys,
47
  providerSettings: providerSettings?.[this.name],
 
54
  throw new Error(`Missing API Key for ${this.name}`);
55
  }
56
 
57
+ const actualModel = options.model === 'Kimi K2 0905' ? 'moonshotai/kimi-k2-instruct-0905' : options.model;
58
 
59
  return createOpenAI({
60
  baseURL: 'https://integrate.api.nvidia.com/v1',