Merge branch 'main' into main
This commit is contained in:
@@ -19,8 +19,12 @@ export function getAPIKey(cloudflareEnv: Env, provider: string) {
|
||||
return env.GROQ_API_KEY || cloudflareEnv.GROQ_API_KEY;
|
||||
case 'OpenRouter':
|
||||
return env.OPEN_ROUTER_API_KEY || cloudflareEnv.OPEN_ROUTER_API_KEY;
|
||||
case "OpenAILike":
|
||||
return env.OPENAI_LIKE_API_KEY || cloudflareEnv.OPENAI_LIKE_API_KEY;
|
||||
case 'Deepseek':
|
||||
return env.DEEPSEEK_API_KEY || cloudflareEnv.DEEPSEEK_API_KEY
|
||||
case 'Mistral':
|
||||
return env.MISTRAL_API_KEY || cloudflareEnv.MISTRAL_API_KEY;
|
||||
case "OpenAILike":
|
||||
return env.OPENAI_LIKE_API_KEY || cloudflareEnv.OPENAI_LIKE_API_KEY;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// see https://docs.anthropic.com/en/docs/about-claude/models
|
||||
export const MAX_TOKENS = 8192;
|
||||
export const MAX_TOKENS = 8000;
|
||||
|
||||
// limits the number of model responses that can be returned in a single request
|
||||
export const MAX_RESPONSE_SEGMENTS = 2;
|
||||
|
||||
@@ -6,6 +6,8 @@ import { createOpenAI } from '@ai-sdk/openai';
|
||||
import { createGoogleGenerativeAI } from '@ai-sdk/google';
|
||||
import { ollama } from 'ollama-ai-provider';
|
||||
import { createOpenRouter } from "@openrouter/ai-sdk-provider";
|
||||
import { mistral } from '@ai-sdk/mistral';
|
||||
import { createMistral } from '@ai-sdk/mistral';
|
||||
|
||||
export function getAnthropicModel(apiKey: string, model: string) {
|
||||
const anthropic = createAnthropic({
|
||||
@@ -30,6 +32,14 @@ export function getOpenAIModel(apiKey: string, model: string) {
|
||||
return openai(model);
|
||||
}
|
||||
|
||||
export function getMistralModel(apiKey: string, model: string) {
|
||||
const mistral = createMistral({
|
||||
apiKey
|
||||
});
|
||||
|
||||
return mistral(model);
|
||||
}
|
||||
|
||||
export function getGoogleModel(apiKey: string, model: string) {
|
||||
const google = createGoogleGenerativeAI(
|
||||
apiKey,
|
||||
@@ -53,6 +63,15 @@ export function getOllamaModel(baseURL: string, model: string) {
|
||||
return Ollama;
|
||||
}
|
||||
|
||||
export function getDeepseekModel(apiKey: string, model: string){
|
||||
const openai = createOpenAI({
|
||||
baseURL: 'https://api.deepseek.com/beta',
|
||||
apiKey,
|
||||
});
|
||||
|
||||
return openai(model);
|
||||
}
|
||||
|
||||
export function getOpenRouterModel(apiKey: string, model: string) {
|
||||
const openRouter = createOpenRouter({
|
||||
apiKey
|
||||
@@ -78,6 +97,10 @@ export function getModel(provider: string, model: string, env: Env) {
|
||||
return getGoogleModel(apiKey, model)
|
||||
case 'OpenAILike':
|
||||
return getOpenAILikeModel(baseURL,apiKey, model);
|
||||
case 'Deepseek':
|
||||
return getDeepseekModel(apiKey, model)
|
||||
case 'Mistral':
|
||||
return getMistralModel(apiKey, model);
|
||||
default:
|
||||
return getOllamaModel(baseURL, model);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,32 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w
|
||||
|
||||
IMPORTANT: When choosing databases or npm packages, prefer options that don't rely on native binaries. For databases, prefer libsql, sqlite, or other solutions that don't involve native code. WebContainer CANNOT execute arbitrary native binaries.
|
||||
|
||||
Available shell commands: cat, chmod, cp, echo, hostname, kill, ln, ls, mkdir, mv, ps, pwd, rm, rmdir, xxd, alias, cd, clear, curl, env, false, getconf, head, sort, tail, touch, true, uptime, which, code, jq, loadenv, node, python3, wasm, xdg-open, command, exit, export, source
|
||||
Available shell commands:
|
||||
File Operations:
|
||||
- cat: Display file contents
|
||||
- cp: Copy files/directories
|
||||
- ls: List directory contents
|
||||
- mkdir: Create directory
|
||||
- mv: Move/rename files
|
||||
- rm: Remove files
|
||||
- rmdir: Remove empty directories
|
||||
- touch: Create empty file/update timestamp
|
||||
|
||||
System Information:
|
||||
- hostname: Show system name
|
||||
- ps: Display running processes
|
||||
- pwd: Print working directory
|
||||
- uptime: Show system uptime
|
||||
- env: Environment variables
|
||||
|
||||
Development Tools:
|
||||
- node: Execute Node.js code
|
||||
- python3: Run Python scripts
|
||||
- code: VSCode operations
|
||||
- jq: Process JSON
|
||||
|
||||
Other Utilities:
|
||||
- curl, head, sort, tail, clear, which, export, chmod, scho, hostname, kill, ln, xxd, alias, false, getconf, true, loadenv, wasm, xdg-open, command, exit, source
|
||||
</system_constraints>
|
||||
|
||||
<code_formatting_info>
|
||||
@@ -84,6 +109,36 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w
|
||||
</${MODIFICATIONS_TAG_NAME}>
|
||||
</diff_spec>
|
||||
|
||||
<chain_of_thought_instructions>
|
||||
Before providing a solution, BRIEFLY outline your implementation steps. This helps ensure systematic thinking and clear communication. Your planning should:
|
||||
- List concrete steps you'll take
|
||||
- Identify key components needed
|
||||
- Note potential challenges
|
||||
- Be concise (2-4 lines maximum)
|
||||
|
||||
Example responses:
|
||||
|
||||
User: "Create a todo list app with local storage"
|
||||
Assistant: "Sure. I'll start by:
|
||||
1. Set up Vite + React
|
||||
2. Create TodoList and TodoItem components
|
||||
3. Implement localStorage for persistence
|
||||
4. Add CRUD operations
|
||||
|
||||
Let's start now.
|
||||
|
||||
[Rest of response...]"
|
||||
|
||||
User: "Help debug why my API calls aren't working"
|
||||
Assistant: "Great. My first steps will be:
|
||||
1. Check network requests
|
||||
2. Verify API endpoint format
|
||||
3. Examine error handling
|
||||
|
||||
[Rest of response...]"
|
||||
|
||||
</chain_of_thought_instructions>
|
||||
|
||||
<artifact_info>
|
||||
Bolt creates a SINGLE, comprehensive artifact for each project. The artifact contains all necessary steps and components, including:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user