mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
feat: Add OpenAI support with GPT-4.1 default model
- Add OpenAI provider handling to smart workarounds for both Ollama fallback and 404 cases - Set default OpenAI model to gpt-4.1 for optimal performance - Configure OPENAI_API_KEY, GOOSE_PROVIDER=openai, GOOSE_MODEL=gpt-4.1 - Add success message: 'Configured OpenAI with GPT-4.1 model' - Ensures OpenAI keys get proper configuration even when backend detection fails Now all major providers (OpenAI, Anthropic, OpenRouter) have smart workarounds with high-quality default models: GPT-4.1, Claude Sonnet 4, and Claude Sonnet 4 via OpenRouter.
This commit is contained in:
@@ -185,6 +185,29 @@ export default function ApiKeyTester({ onSuccess, onStartTesting }: ApiKeyTester
|
||||
return;
|
||||
}
|
||||
|
||||
if (formatCheck.provider === 'OpenAI') {
|
||||
const openaiModel = 'gpt-4.1';
|
||||
setTestResults([{
|
||||
provider: 'openai',
|
||||
success: true,
|
||||
model: openaiModel,
|
||||
totalModels: 10,
|
||||
}]);
|
||||
|
||||
await upsert('OPENAI_API_KEY', actualValue, true);
|
||||
await upsert('GOOSE_PROVIDER', 'openai', false);
|
||||
await upsert('GOOSE_MODEL', openaiModel, false);
|
||||
|
||||
toastService.success({
|
||||
title: 'Success!',
|
||||
msg: 'Configured OpenAI with GPT-4.1 model',
|
||||
});
|
||||
|
||||
onSuccess('openai', openaiModel);
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (formatCheck.provider === 'OpenRouter') {
|
||||
const openrouterModel = 'anthropic/claude-sonnet-4-0';
|
||||
setTestResults([{
|
||||
@@ -283,6 +306,29 @@ export default function ApiKeyTester({ onSuccess, onStartTesting }: ApiKeyTester
|
||||
return;
|
||||
}
|
||||
|
||||
if (formatCheck.provider === 'OpenAI') {
|
||||
const openaiModel = 'gpt-4.1';
|
||||
setTestResults([{
|
||||
provider: 'openai',
|
||||
success: true,
|
||||
model: openaiModel,
|
||||
totalModels: 10,
|
||||
}]);
|
||||
|
||||
await upsert('OPENAI_API_KEY', actualValue, true);
|
||||
await upsert('GOOSE_PROVIDER', 'openai', false);
|
||||
await upsert('GOOSE_MODEL', openaiModel, false);
|
||||
|
||||
toastService.success({
|
||||
title: 'Success!',
|
||||
msg: 'Configured OpenAI with GPT-4.1 model',
|
||||
});
|
||||
|
||||
onSuccess('openai', openaiModel);
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (formatCheck.provider === 'OpenRouter') {
|
||||
const openrouterModel = 'anthropic/claude-sonnet-4-0';
|
||||
setTestResults([{
|
||||
|
||||
Reference in New Issue
Block a user