Merge pull request #53 from totargaming/main

Refined intergration to Claude AI
main
Bhaumik Maan 2 years ago committed by GitHub
commit 65a25d0417
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -77,10 +77,10 @@ export class ConfigHelper extends EventEmitter {
return model;
} else if (provider === "anthropic") {
// Only allow Claude models
const allowedModels = ['claude-3-opus-20240229', 'claude-3-sonnet-20240229', 'claude-3-haiku-20240307'];
const allowedModels = ['claude-3-7-sonnet-20250219', 'claude-3-5-sonnet-20241022', 'claude-3-opus-20240229'];
if (!allowedModels.includes(model)) {
console.warn(`Invalid Anthropic model specified: ${model}. Using default model: claude-3-opus-20240229`);
return 'claude-3-opus-20240229';
console.warn(`Invalid Anthropic model specified: ${model}. Using default model: claude-3-7-sonnet-20250219`);
return 'claude-3-7-sonnet-20250219';
}
return model;
}
@ -175,9 +175,9 @@ export class ConfigHelper extends EventEmitter {
updates.solutionModel = "gpt-4o";
updates.debuggingModel = "gpt-4o";
} else if (updates.apiProvider === "anthropic") {
updates.extractionModel = "claude-3-opus-20240229";
updates.solutionModel = "claude-3-opus-20240229";
updates.debuggingModel = "claude-3-opus-20240229";
updates.extractionModel = "claude-3-7-sonnet-20250219";
updates.solutionModel = "claude-3-7-sonnet-20250219";
updates.debuggingModel = "claude-3-7-sonnet-20250219";
} else {
updates.extractionModel = "gemini-2.0-flash";
updates.solutionModel = "gemini-2.0-flash";
@ -397,4 +397,4 @@ export class ConfigHelper extends EventEmitter {
}
// Export a singleton instance
export const configHelper = new ConfigHelper();
export const configHelper = new ConfigHelper();

@ -604,7 +604,7 @@ export class ProcessingHelper {
];
const response = await this.anthropicClient.messages.create({
model: config.extractionModel || "claude-3-opus-20240229",
model: config.extractionModel || "claude-3-7-sonnet-20250219",
max_tokens: 4000,
messages: messages,
temperature: 0.2
@ -858,7 +858,7 @@ Your solution should be efficient, well-commented, and handle edge cases.
// Send to Anthropic API
const response = await this.anthropicClient.messages.create({
model: config.solutionModel || "claude-3-opus-20240229",
model: config.solutionModel || "claude-3-7-sonnet-20250219",
max_tokens: 4000,
messages: messages,
temperature: 0.2
@ -1216,7 +1216,7 @@ If you include code examples, use proper markdown code blocks with language spec
}
const response = await this.anthropicClient.messages.create({
model: config.debuggingModel || "claude-3-opus-20240229",
model: config.debuggingModel || "claude-3-7-sonnet-20250219",
max_tokens: 4000,
messages: messages,
temperature: 0.2
@ -1314,4 +1314,4 @@ If you include code examples, use proper markdown code blocks with language spec
mainWindow.webContents.send(this.deps.PROCESSING_EVENTS.NO_SCREENSHOTS)
}
}
}
}

@ -62,19 +62,19 @@ const modelCategories: ModelCategory[] = [
],
anthropicModels: [
{
id: "claude-3-opus-20240229",
name: "Claude 3 Opus",
id: "claude-3-7-sonnet-20250219",
name: "Claude 3.7 Sonnet",
description: "Best overall performance for problem extraction"
},
{
id: "claude-3-sonnet-20240229",
name: "Claude 3 Sonnet",
id: "claude-3-5-sonnet-20241022",
name: "Claude 3.5 Sonnet",
description: "Balanced performance and speed"
},
{
id: "claude-3-haiku-20240307",
name: "Claude 3 Haiku",
description: "Fastest, most cost-effective option"
id: "claude-3-opus-20240229",
name: "Claude 3 Opus",
description: "Top-level intelligence, fluency, and understanding"
}
]
},
@ -108,19 +108,19 @@ const modelCategories: ModelCategory[] = [
],
anthropicModels: [
{
id: "claude-3-opus-20240229",
name: "Claude 3 Opus",
id: "claude-3-7-sonnet-20250219",
name: "Claude 3.7 Sonnet",
description: "Strong overall performance for coding tasks"
},
{
id: "claude-3-sonnet-20240229",
name: "Claude 3 Sonnet",
id: "claude-3-5-sonnet-20241022",
name: "Claude 3.5 Sonnet",
description: "Balanced performance and speed"
},
{
id: "claude-3-haiku-20240307",
name: "Claude 3 Haiku",
description: "Faster, more cost-effective option"
id: "claude-3-opus-20240229",
name: "Claude 3 Opus",
description: "Top-level intelligence, fluency, and understanding"
}
]
},
@ -154,19 +154,19 @@ const modelCategories: ModelCategory[] = [
],
anthropicModels: [
{
id: "claude-3-opus-20240229",
name: "Claude 3 Opus",
id: "claude-3-7-sonnet-20250219",
name: "Claude 3.7 Sonnet",
description: "Best for analyzing code and error messages"
},
{
id: "claude-3-sonnet-20240229",
name: "Claude 3 Sonnet",
id: "claude-3-5-sonnet-20241022",
name: "Claude 3.5 Sonnet",
description: "Balanced performance and speed"
},
{
id: "claude-3-haiku-20240307",
name: "Claude 3 Haiku",
description: "Faster, more cost-effective option"
id: "claude-3-opus-20240229",
name: "Claude 3 Opus",
description: "Top-level intelligence, fluency, and understanding"
}
]
}
@ -248,9 +248,9 @@ export function SettingsDialog({ open: externalOpen, onOpenChange }: SettingsDia
setSolutionModel("gemini-1.5-pro");
setDebuggingModel("gemini-1.5-pro");
} else if (provider === "anthropic") {
setExtractionModel("claude-3-opus-20240229");
setSolutionModel("claude-3-opus-20240229");
setDebuggingModel("claude-3-opus-20240229");
setExtractionModel("claude-3-7-sonnet-20250219");
setSolutionModel("claude-3-7-sonnet-20250219");
setDebuggingModel("claude-3-7-sonnet-20250219");
}
};
@ -583,4 +583,4 @@ export function SettingsDialog({ open: externalOpen, onOpenChange }: SettingsDia
</DialogContent>
</Dialog>
);
}
}

Loading…
Cancel
Save