mirror of https://github.com/buster-so/buster.git
Merge pull request #730 from buster-so/hotfix-add-gpt5-to-fallback-chain
add gpt5 to fallback chain on sonnet 4
This commit is contained in:
commit
df5291be15
|
@ -60,6 +60,7 @@ const outputSchema = z.object({
|
|||
|
||||
const DEFAULT_CACHE_OPTIONS = {
|
||||
anthropic: { cacheControl: { type: 'ephemeral', ttl: '1h' } },
|
||||
openai: { parallelToolCalls: false, reasoningEffort: 'minimal' },
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -82,6 +82,7 @@ const outputSchema = ThinkAndPrepOutputSchema;
|
|||
|
||||
const DEFAULT_CACHE_OPTIONS = {
|
||||
anthropic: { cacheControl: { type: 'ephemeral', ttl: '1h' } },
|
||||
openai: { parallelToolCalls: false, reasoningEffort: 'minimal' },
|
||||
};
|
||||
|
||||
// Helper function to create the result object
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import type { LanguageModelV1 } from '@ai-sdk/provider';
|
||||
import { createFallback } from './ai-fallback';
|
||||
import { anthropicModel } from './providers/anthropic';
|
||||
import { openaiModel } from './providers/openai';
|
||||
import { vertexModel } from './providers/vertex';
|
||||
|
||||
// Lazy initialization to allow mocking in tests
|
||||
|
@ -24,13 +25,13 @@ function initializeSonnet4() {
|
|||
}
|
||||
}
|
||||
|
||||
// Only include Vertex if credentials are available
|
||||
if (process.env.VERTEX_CLIENT_EMAIL && process.env.VERTEX_PRIVATE_KEY) {
|
||||
if (process.env.OPENAI_API_KEY) {
|
||||
try {
|
||||
models.push(vertexModel('claude-sonnet-4@20250514'));
|
||||
console.info('Sonnet4: Vertex AI model added to fallback chain');
|
||||
models.push(openaiModel('gpt-5'));
|
||||
|
||||
console.info('Sonnet4: OpenAI model added to fallback chain');
|
||||
} catch (error) {
|
||||
console.warn('Sonnet4: Failed to initialize Vertex AI model:', error);
|
||||
console.warn('Sonnet4: Failed to initialize OpenAI model:', error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue