From 79ce87ee5d729185bad73a37ebf77964f1488f59 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 14 Dec 2024 08:29:16 +0000 Subject: [PATCH 1/6] chore: update commit hash to a71cfba660f04a8440960ab772670b192e2d066f --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index aa11cbf..ccf5a8c 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "4af18c069f2429ffaf410d92702a1e1294af2628" } +{ "commit": "a71cfba660f04a8440960ab772670b192e2d066f" } From 70f88f981a4195b70d3a62f0767c83bcf7894e0d Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Sun, 15 Dec 2024 16:47:16 +0530 Subject: [PATCH 2/6] feat: Experimental Prompt Library Added --- app/commit.json | 2 +- app/components/chat/Chat.client.tsx | 3 +- .../settings/features/FeaturesTab.tsx | 27 +++- app/lib/.server/llm/stream-text.ts | 25 +++- app/lib/common/prompt-library.ts | 49 +++++++ app/lib/common/prompts/optimized.ts | 135 ++++++++++++++++++ .../llm => common/prompts}/prompts.ts | 0 app/lib/hooks/useSettings.tsx | 15 ++ app/lib/stores/settings.ts | 2 + app/lib/stores/workbench.ts | 1 - app/routes/api.chat.ts | 7 +- 11 files changed, 253 insertions(+), 13 deletions(-) create mode 100644 app/lib/common/prompt-library.ts create mode 100644 app/lib/common/prompts/optimized.ts rename app/lib/{.server/llm => common/prompts}/prompts.ts (100%) diff --git a/app/commit.json b/app/commit.json index ccf5a8c..be6c722 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "a71cfba660f04a8440960ab772670b192e2d066f" } +{ "commit": "79ce87ee5d729185bad73a37ebf77964f1488f59" } diff --git a/app/components/chat/Chat.client.tsx b/app/components/chat/Chat.client.tsx index 751ea9c..fe44dd1 100644 --- a/app/components/chat/Chat.client.tsx +++ b/app/components/chat/Chat.client.tsx @@ -93,7 +93,7 @@ export const ChatImpl = memo( const [uploadedFiles, setUploadedFiles] = useState([]); // Move here const [imageDataList, setImageDataList] = useState([]); // Move here const files = useStore(workbenchStore.files); - const { activeProviders } = useSettings(); + const { activeProviders, promptId } = useSettings(); const [model, setModel] = useState(() => { const savedModel = Cookies.get('selectedModel'); @@ -115,6 +115,7 @@ export const ChatImpl = memo( body: { apiKeys, files, + promptId, }, onError: (error) => { logger.error('Request failed\n\n', error); diff --git a/app/components/settings/features/FeaturesTab.tsx b/app/components/settings/features/FeaturesTab.tsx index 9c9e4a0..ff55078 100644 --- a/app/components/settings/features/FeaturesTab.tsx +++ b/app/components/settings/features/FeaturesTab.tsx @@ -1,18 +1,20 @@ import React from 'react'; import { Switch } from '~/components/ui/Switch'; +import { PromptLibrary } from '~/lib/common/prompt-library'; import { useSettings } from '~/lib/hooks/useSettings'; export default function FeaturesTab() { - const { debug, enableDebugMode, isLocalModel, enableLocalModels, eventLogs, enableEventLogs } = useSettings(); + const { debug, enableDebugMode, isLocalModel, enableLocalModels, eventLogs, enableEventLogs, promptId, setPromptId } = + useSettings(); return (

Optional Features

-
+
Debug Info
-
+
Event Logs
@@ -23,10 +25,27 @@ export default function FeaturesTab() {

Disclaimer: Experimental features may be unstable and are subject to change.

-
+
Enable Local Models
+
+
+ Prompt Library +

+ Choose a prompt from the library to use as the system prompt. +

+
+ +
); diff --git a/app/lib/.server/llm/stream-text.ts b/app/lib/.server/llm/stream-text.ts index 11ac99b..74cdd9d 100644 --- a/app/lib/.server/llm/stream-text.ts +++ b/app/lib/.server/llm/stream-text.ts @@ -1,10 +1,20 @@ import { convertToCoreMessages, streamText as _streamText } from 'ai'; import { getModel } from '~/lib/.server/llm/model'; import { MAX_TOKENS } from './constants'; -import { getSystemPrompt } from './prompts'; -import { DEFAULT_MODEL, DEFAULT_PROVIDER, getModelList, MODEL_REGEX, PROVIDER_REGEX } from '~/utils/constants'; +import { getSystemPrompt } from '~/lib/common/prompts/prompts'; +import { + DEFAULT_MODEL, + DEFAULT_PROVIDER, + getModelList, + MODEL_REGEX, + MODIFICATIONS_TAG_NAME, + PROVIDER_REGEX, + WORK_DIR, +} from '~/utils/constants'; import ignore from 'ignore'; import type { IProviderSetting } from '~/types/model'; +import { PromptLibrary } from '~/lib/common/prompt-library'; +import { allowedHTMLElements } from '~/utils/markdown'; interface ToolResult { toolCallId: string; @@ -139,8 +149,9 @@ export async function streamText(props: { apiKeys?: Record; files?: FileMap; providerSettings?: Record; + promptId?: string; }) { - const { messages, env, options, apiKeys, files, providerSettings } = props; + const { messages, env, options, apiKeys, files, providerSettings, promptId } = props; let currentModel = DEFAULT_MODEL; let currentProvider = DEFAULT_PROVIDER.name; const MODEL_LIST = await getModelList(apiKeys || {}, providerSettings); @@ -170,11 +181,17 @@ export async function streamText(props: { const dynamicMaxTokens = modelDetails && modelDetails.maxTokenAllowed ? modelDetails.maxTokenAllowed : MAX_TOKENS; - let systemPrompt = getSystemPrompt(); + let systemPrompt = + PromptLibrary.getPropmtFromLibrary(promptId || 'default', { + cwd: WORK_DIR, + allowedHtmlElements: allowedHTMLElements, + modificationTagName: MODIFICATIONS_TAG_NAME, + }) ?? getSystemPrompt(); let codeContext = ''; if (files) { codeContext = createFilesContext(files); + codeContext = ''; systemPrompt = `${systemPrompt}\n\n ${codeContext}`; } diff --git a/app/lib/common/prompt-library.ts b/app/lib/common/prompt-library.ts new file mode 100644 index 0000000..7513e81 --- /dev/null +++ b/app/lib/common/prompt-library.ts @@ -0,0 +1,49 @@ +import { getSystemPrompt } from './prompts/prompts'; +import optimized from './prompts/optimized'; + +export interface PromptOptions { + cwd: string; + allowedHtmlElements: string[]; + modificationTagName: string; +} + +export class PromptLibrary { + static library: Record< + string, + { + label: string; + description: string; + get: (options: PromptOptions) => string; + } + > = { + default: { + label: 'Default Prompt', + description: 'This is the battle tested default system Prompt', + get: (options) => getSystemPrompt(options.cwd), + }, + optimized: { + label: 'Optimized Prompt (experimental)', + description: 'an Experimental version of the prompt for lower token usage', + get: (options) => optimized(options), + }, + }; + static getList() { + return Object.entries(this.library).map(([key, value]) => { + const { label, description } = value; + return { + id: key, + label, + description, + }; + }); + } + static getPropmtFromLibrary(promptId: string, options: PromptOptions) { + const prompt = this.library[promptId]; + + if (!prompt) { + throw 'Prompt Now Found'; + } + + return this.library[promptId]?.get(options); + } +} diff --git a/app/lib/common/prompts/optimized.ts b/app/lib/common/prompts/optimized.ts new file mode 100644 index 0000000..64a1f8f --- /dev/null +++ b/app/lib/common/prompts/optimized.ts @@ -0,0 +1,135 @@ +import type { PromptOptions } from '~/lib/common/prompt-library'; + +export default (options: PromptOptions) => { + const { cwd, allowedHtmlElements, modificationTagName } = options; + return ` +You are Bolt, an expert AI assistant and senior software developer. +You have access to a shell and access to write files through the use of artifacts. +Your artifacts will be parsed by automated parser to perform actions on your behalf and will not be visible to the user + + + - Operating in WebContainer, an in-browser Node.js runtime + - Limited Python support: standard library only, no pip + - No C/C++ compiler, native binaries, or Git + - Prefer Node.js scripts over shell scripts + - Use Vite for web servers + - Databases: prefer libsql, sqlite, or non-native solutions + - When for react dont forget to write vite config and index.html to the project + + Available shell commands: cat, cp, ls, mkdir, mv, rm, rmdir, touch, hostname, ps, pwd, uptime, env, node, python3, code, jq, curl, head, sort, tail, clear, which, export, chmod, scho, kill, ln, xxd, alias, getconf, loadenv, wasm, xdg-open, command, exit, source + + + + Use 2 spaces for indentation + + + + Available HTML elements: ${allowedHtmlElements.join(', ')} + + + + File modifications in \`<${modificationTagName}>\` section: + - \`\`: GNU unified diff format + - \`\`: Full new content + + + + do not mention the phrase "chain of thought" + Before solutions, briefly outline implementation steps (2-4 lines max): + - List concrete steps + - Identify key components + - Note potential challenges + - Do not write the actual code just the plan and structure if needed + - Once completed planning start writing the artifacts + + + + Create a single, comprehensive artifact for each project: + - Use \`\` tags with \`title\` and \`id\` attributes + - Use \`\` tags with \`type\` attribute: + - shell: Run commands + - file: Write/update files (use \`filePath\` attribute) + - start: Start dev server (only when necessary) + - Order actions logically + - Install dependencies first + - Provide full, updated content for all files + - Use coding best practices: modular, clean, readable code + + +Key points: +- Always use artifacts for file contents and commands +- Use markdown, avoid HTML tags except in artifacts +- Be concise, explain only when asked +- Think first, then provide comprehensive artifact +- Never use the word "artifact" in responses +- Current working directory: \`${cwd}\` + +Examples: + + + + Create a JavaScript factorial function + + Certainly, I'll create a JavaScript factorial function for you. + + + + function factorial(n) { + return n <= 1 ? 1 : n * factorial(n - 1); + } + console.log(factorial(5)); + + + node factorial.js + + + + This creates a factorial function and tests it with the value 5. + + + + + Set up a basic React project + + Sure, I'll set up a basic React project for you. + + + + { + "name": "react-project", + "version": "1.0.0", + "scripts": { + "dev": "vite" + }, + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "vite": "^4.3.9" + } + } + + + npm install + + + import React from 'react'; + function App() { + return

Hello, React!

; + } + export default App; +
+ + npm run dev + +
+ + This sets up a basic React project with Vite as the build tool. +
+
+
+ +Always use artifacts for file contents and commands, following the format shown in these examples. +`; +}; diff --git a/app/lib/.server/llm/prompts.ts b/app/lib/common/prompts/prompts.ts similarity index 100% rename from app/lib/.server/llm/prompts.ts rename to app/lib/common/prompts/prompts.ts diff --git a/app/lib/hooks/useSettings.tsx b/app/lib/hooks/useSettings.tsx index 0e79651..4c74b21 100644 --- a/app/lib/hooks/useSettings.tsx +++ b/app/lib/hooks/useSettings.tsx @@ -4,6 +4,7 @@ import { isEventLogsEnabled, isLocalModelsEnabled, LOCAL_PROVIDERS, + promptStore, providersStore, } from '~/lib/stores/settings'; import { useCallback, useEffect, useState } from 'react'; @@ -15,6 +16,7 @@ export function useSettings() { const providers = useStore(providersStore); const debug = useStore(isDebugMode); const eventLogs = useStore(isEventLogsEnabled); + const promptId = useStore(promptStore); const isLocalModel = useStore(isLocalModelsEnabled); const [activeProviders, setActiveProviders] = useState([]); @@ -60,6 +62,12 @@ export function useSettings() { if (savedLocalModels) { isLocalModelsEnabled.set(savedLocalModels === 'true'); } + + const promptId = Cookies.get('promptId'); + + if (promptId) { + promptStore.set(promptId); + } }, []); // writing values to cookies on change @@ -111,6 +119,11 @@ export function useSettings() { Cookies.set('isLocalModelsEnabled', String(enabled)); }, []); + const setPromptId = useCallback((promptId: string) => { + promptStore.set(promptId); + Cookies.set('promptId', promptId); + }, []); + return { providers, activeProviders, @@ -121,5 +134,7 @@ export function useSettings() { enableEventLogs, isLocalModel, enableLocalModels, + promptId, + setPromptId, }; } diff --git a/app/lib/stores/settings.ts b/app/lib/stores/settings.ts index abbb825..78682cc 100644 --- a/app/lib/stores/settings.ts +++ b/app/lib/stores/settings.ts @@ -46,3 +46,5 @@ export const isDebugMode = atom(false); export const isEventLogsEnabled = atom(false); export const isLocalModelsEnabled = atom(true); + +export const promptStore = atom('default'); diff --git a/app/lib/stores/workbench.ts b/app/lib/stores/workbench.ts index bbd537d..0d46057 100644 --- a/app/lib/stores/workbench.ts +++ b/app/lib/stores/workbench.ts @@ -297,7 +297,6 @@ export class WorkbenchStore { const action = artifact.runner.actions.get()[data.actionId]; - if (!action || action.executed) { return; } diff --git a/app/routes/api.chat.ts b/app/routes/api.chat.ts index 87ca5c7..d14e0d7 100644 --- a/app/routes/api.chat.ts +++ b/app/routes/api.chat.ts @@ -1,6 +1,6 @@ import { type ActionFunctionArgs } from '@remix-run/cloudflare'; import { MAX_RESPONSE_SEGMENTS, MAX_TOKENS } from '~/lib/.server/llm/constants'; -import { CONTINUE_PROMPT } from '~/lib/.server/llm/prompts'; +import { CONTINUE_PROMPT } from '~/lib/common/prompts/prompts'; import { streamText, type Messages, type StreamingOptions } from '~/lib/.server/llm/stream-text'; import SwitchableStream from '~/lib/.server/llm/switchable-stream'; import type { IProviderSetting } from '~/types/model'; @@ -30,9 +30,10 @@ function parseCookies(cookieHeader: string) { } async function chatAction({ context, request }: ActionFunctionArgs) { - const { messages, files } = await request.json<{ + const { messages, files, promptId } = await request.json<{ messages: Messages; files: any; + promptId?: string; }>(); const cookieHeader = request.headers.get('Cookie'); @@ -71,6 +72,7 @@ async function chatAction({ context, request }: ActionFunctionArgs) { apiKeys, files, providerSettings, + promptId, }); return stream.switchSource(result.toAIStream()); @@ -84,6 +86,7 @@ async function chatAction({ context, request }: ActionFunctionArgs) { apiKeys, files, providerSettings, + promptId, }); stream.switchSource(result.toAIStream()); From 2b8236f9880984508f2ae17575b587bb9d938e55 Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Sun, 15 Dec 2024 20:28:15 +0530 Subject: [PATCH 3/6] updated readme --- README.md | 1 + app/commit.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5126437..6a78e29 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ https://thinktank.ottomator.ai - ✅ Better prompt enhancing (@SujalXplores) - ✅ Attach images to prompts (@atrokhym) - ✅ Detect package.json and commands to auto install and run preview for folder and git import (@wonderwhy-er) +- ✅ PromptLibrary to have different variations of prompts for different use cases (@thecodacus) - ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs) - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start) - ⬜ **HIGH PRIORITY** - Run agents in the backend as opposed to a single model call diff --git a/app/commit.json b/app/commit.json index be6c722..b731c08 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "79ce87ee5d729185bad73a37ebf77964f1488f59" } +{ "commit": "70f88f981a4195b70d3a62f0767c83bcf7894e0d" } From 6467995ac3b33cc3ebb1336cf63e4d0c0820a970 Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Sun, 15 Dec 2024 20:40:46 +0530 Subject: [PATCH 4/6] updated readme --- README.md | 2 ++ app/commit.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a78e29..96e487f 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ https://thinktank.ottomator.ai - ✅ Better prompt enhancing (@SujalXplores) - ✅ Attach images to prompts (@atrokhym) - ✅ Detect package.json and commands to auto install and run preview for folder and git import (@wonderwhy-er) +- ✅ Added Git Clone button (@thecodacus) +- ✅ Git Import from url (@thecodacus) - ✅ PromptLibrary to have different variations of prompts for different use cases (@thecodacus) - ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs) - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start) diff --git a/app/commit.json b/app/commit.json index b731c08..fb908e4 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "70f88f981a4195b70d3a62f0767c83bcf7894e0d" } +{ "commit": "2b8236f9880984508f2ae17575b587bb9d938e55" } From 31706183b48cf5eee8b74be72821b19461b58d3d Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Sun, 15 Dec 2024 22:15:17 +0530 Subject: [PATCH 5/6] updated the examples and added strict rules --- app/commit.json | 2 +- app/components/chat/BaseChat.tsx | 8 +- .../settings/chat-history/ChatHistoryTab.tsx | 6 +- .../settings/features/FeaturesTab.tsx | 3 +- .../settings/providers/ProvidersTab.tsx | 3 +- app/lib/common/prompts/optimized.ts | 160 ++++++++++++------ app/utils/constants.ts | 2 +- 7 files changed, 125 insertions(+), 59 deletions(-) diff --git a/app/commit.json b/app/commit.json index 9d5c6d7..974cc2f 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "9cd9ee9088467882e1e4efdf491959619307cc9d" } \ No newline at end of file +{ "commit": "9f5c01f5dd40fdbf4ae57bab163fdf8552b937ba" } diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 162241d..2084cbb 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -77,7 +77,8 @@ export const BaseChat = React.forwardRef( input = '', enhancingPrompt, handleInputChange, - promptEnhanced, + + // promptEnhanced, enhancePrompt, sendMessage, handleStop, @@ -490,10 +491,7 @@ export const BaseChat = React.forwardRef( { enhancePrompt?.(); toast.success('Prompt enhanced!'); diff --git a/app/components/settings/chat-history/ChatHistoryTab.tsx b/app/components/settings/chat-history/ChatHistoryTab.tsx index bd98f3d..ea5187b 100644 --- a/app/components/settings/chat-history/ChatHistoryTab.tsx +++ b/app/components/settings/chat-history/ChatHistoryTab.tsx @@ -22,7 +22,8 @@ export default function ChatHistoryTab() { }; const handleDeleteAllChats = async () => { - const confirmDelete = window.confirm("Are you sure you want to delete all chats? This action cannot be undone."); + const confirmDelete = window.confirm('Are you sure you want to delete all chats? This action cannot be undone.'); + if (!confirmDelete) { return; // Exit if the user cancels } @@ -31,11 +32,13 @@ export default function ChatHistoryTab() { const error = new Error('Database is not available'); logStore.logError('Failed to delete chats - DB unavailable', error); toast.error('Database is not available'); + return; } try { setIsDeleting(true); + const allChats = await getAll(db); await Promise.all(allChats.map((chat) => deleteById(db!, chat.id))); logStore.logSystem('All chats deleted successfully', { count: allChats.length }); @@ -55,6 +58,7 @@ export default function ChatHistoryTab() { const error = new Error('Database is not available'); logStore.logError('Failed to export chats - DB unavailable', error); toast.error('Database is not available'); + return; } diff --git a/app/components/settings/features/FeaturesTab.tsx b/app/components/settings/features/FeaturesTab.tsx index 815eb14..91f5526 100644 --- a/app/components/settings/features/FeaturesTab.tsx +++ b/app/components/settings/features/FeaturesTab.tsx @@ -4,8 +4,7 @@ import { PromptLibrary } from '~/lib/common/prompt-library'; import { useSettings } from '~/lib/hooks/useSettings'; export default function FeaturesTab() { - - const { debug, enableDebugMode, isLocalModel, enableLocalModels, eventLogs, enableEventLogs, promptId, setPromptId } = + const { debug, enableDebugMode, isLocalModel, enableLocalModels, enableEventLogs, promptId, setPromptId } = useSettings(); const handleToggle = (enabled: boolean) => { enableDebugMode(enabled); diff --git a/app/components/settings/providers/ProvidersTab.tsx b/app/components/settings/providers/ProvidersTab.tsx index 1c6e87d..ab85898 100644 --- a/app/components/settings/providers/ProvidersTab.tsx +++ b/app/components/settings/providers/ProvidersTab.tsx @@ -56,7 +56,8 @@ export default function ProvidersTab() {
{ // Fallback to default icon on error + onError={(e) => { + // Fallback to default icon on error e.currentTarget.src = DefaultIcon; }} alt={`${provider.name} icon`} diff --git a/app/lib/common/prompts/optimized.ts b/app/lib/common/prompts/optimized.ts index 64a1f8f..26eb2da 100644 --- a/app/lib/common/prompts/optimized.ts +++ b/app/lib/common/prompts/optimized.ts @@ -3,9 +3,7 @@ import type { PromptOptions } from '~/lib/common/prompt-library'; export default (options: PromptOptions) => { const { cwd, allowedHtmlElements, modificationTagName } = options; return ` -You are Bolt, an expert AI assistant and senior software developer. -You have access to a shell and access to write files through the use of artifacts. -Your artifacts will be parsed by automated parser to perform actions on your behalf and will not be visible to the user +You are Bolt, an expert AI assistant and exceptional senior software developer with vast knowledge across multiple programming languages, frameworks, and best practices. - Operating in WebContainer, an in-browser Node.js runtime @@ -56,80 +54,146 @@ Your artifacts will be parsed by automated parser to perform actions on your beh - Use coding best practices: modular, clean, readable code -Key points: -- Always use artifacts for file contents and commands -- Use markdown, avoid HTML tags except in artifacts -- Be concise, explain only when asked -- Think first, then provide comprehensive artifact -- Never use the word "artifact" in responses -- Current working directory: \`${cwd}\` + +# CRITICAL RULES - NEVER IGNORE + +## File and Command Handling +1. ALWAYS use artifacts for file contents and commands - NO EXCEPTIONS +2. When writing a file, INCLUDE THE ENTIRE FILE CONTENT - NO PARTIAL UPDATES +3. For modifications, ONLY alter files that require changes - DO NOT touch unaffected files + +## Response Format +4. Use markdown EXCLUSIVELY - HTML tags are ONLY allowed within artifacts +5. Be concise - Explain ONLY when explicitly requested +6. NEVER use the word "artifact" in responses + +## Development Process +7. ALWAYS think and plan comprehensively before providing a solution +8. Current working directory: \`${cwd} \` - Use this for all file paths +9. Don't use cli scaffolding to steup the project, use cwd as Root of the project +11. For nodejs projects ALWAYS install dependencies after writing package.json file + +## Coding Standards +10. ALWAYS create smaller, atomic components and modules +11. Modularity is PARAMOUNT - Break down functionality into logical, reusable parts +12. IMMEDIATELY refactor any file exceeding 250 lines +13. ALWAYS plan refactoring before implementation - Consider impacts on the entire system + +## Artifact Usage +22. Use \`\` tags with \`title\` and \`id\` attributes for each project +23. Use \`\` tags with appropriate \`type\` attribute: + - \`shell\`: For running commands + - \`file\`: For writing/updating files (include \`filePath\` attribute) + - \`start\`: For starting dev servers (use only when necessary/ or new dependencies are installed) +24. Order actions logically - dependencies MUST be installed first +25. For Vite project must include vite config and index.html for entry point +26. Provide COMPLETE, up-to-date content for all files - NO placeholders or partial updates + +CRITICAL: These rules are ABSOLUTE and MUST be followed WITHOUT EXCEPTION in EVERY response. Examples: - - Create a JavaScript factorial function + Can you help me create a JavaScript function to calculate the factorial of a number? - Certainly, I'll create a JavaScript factorial function for you. + Certainly, I can help you create a JavaScript function to calculate the factorial of a number. - - function factorial(n) { - return n <= 1 ? 1 : n * factorial(n - 1); - } - console.log(factorial(5)); + +function factorial(n) { + ... +} + +... - node factorial.js +node index.js - - This creates a factorial function and tests it with the value 5. - Set up a basic React project + Build a snake game - Sure, I'll set up a basic React project for you. + Certainly! I'd be happy to help you build a snake game using JavaScript and HTML5 Canvas. This will be a basic implementation that you can later expand upon. Let's create the game step by step. - + - { - "name": "react-project", - "version": "1.0.0", - "scripts": { - "dev": "vite" - }, - "dependencies": { - "react": "^18.2.0", - "react-dom": "^18.2.0" - }, - "devDependencies": { - "vite": "^4.3.9" - } - } +{ + "name": "snake", + "scripts": { + "dev": "vite" + } + ... +} - npm install +npm install --save-dev vite - - import React from 'react'; - function App() { - return

Hello, React!

; - } - export default App; + +... - npm run dev +npm run dev
- This sets up a basic React project with Vite as the build tool. + Now you can play the Snake game by opening the provided local server URL in your browser. Use the arrow keys to control the snake. Eat the red food to grow and increase your score. The game ends if you hit the wall or your own tail. +
+
+ + + Make a bouncing ball with real gravity using React + + Certainly! I'll create a bouncing ball with real gravity using React. We'll use the react-spring library for physics-based animations. + + + +{ + "name": "bouncing-ball", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-spring": "^9.7.1" + }, + "devDependencies": { + "@types/react": "^18.0.28", + "@types/react-dom": "^18.0.11", + "@vitejs/plugin-react": "^3.1.0", + "vite": "^4.2.0" + } +} + + +... + + +... + + +... + + +... + + +npm run dev + + + + You can now view the bouncing ball animation in the preview. The ball will start falling from the top of the screen and bounce realistically when it hits the bottom.
- Always use artifacts for file contents and commands, following the format shown in these examples. `; }; diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 24c8668..e83df05 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -141,7 +141,7 @@ const PROVIDER_LIST: ProviderInfo[] = [ staticModels: [ { name: 'llama-3.1-8b-instant', label: 'Llama 3.1 8b (Groq)', provider: 'Groq', maxTokenAllowed: 8000 }, { name: 'llama-3.2-11b-vision-preview', label: 'Llama 3.2 11b (Groq)', provider: 'Groq', maxTokenAllowed: 8000 }, - { name: 'llama-3.2-90b-vision-preview', label: 'Llama 3.2 90b (Groq)', provider: 'Groq', maxTokenAllowed: 8000 }, + { name: 'llama-3.2-90b-vision-preview', label: 'Llama 3.2 90b (Groq)', provider: 'Groq', maxTokenAllowed: 8000 }, { name: 'llama-3.2-3b-preview', label: 'Llama 3.2 3b (Groq)', provider: 'Groq', maxTokenAllowed: 8000 }, { name: 'llama-3.2-1b-preview', label: 'Llama 3.2 1b (Groq)', provider: 'Groq', maxTokenAllowed: 8000 }, { name: 'llama-3.3-70b-versatile', label: 'Llama 3.3 70b (Groq)', provider: 'Groq', maxTokenAllowed: 8000 }, From 00d871bacedf018866f0ff70aea2b4497e118684 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Dec 2024 16:18:25 +0000 Subject: [PATCH 6/6] chore: update commit hash to de2cb43d170033c43a6cf436af02e033f66a7e4d --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 54c81df..d46475e 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "bb941802094c6186e805f99a6c165431ae86d216" } +{ "commit": "de2cb43d170033c43a6cf436af02e033f66a7e4d" , "version": "" }