mirror of https://github.com/buster-so/buster.git
add in type for anthropic gateway
This commit is contained in:
parent
c603ae1ebf
commit
200ea567a7
|
@ -2,7 +2,44 @@ import { createGateway } from '@ai-sdk/gateway';
|
|||
import { wrapLanguageModel } from 'ai';
|
||||
import { BraintrustMiddleware } from 'braintrust';
|
||||
|
||||
export const DEFAULT_ANTHROPIC_OPTIONS = {
|
||||
// Provider-specific option types
|
||||
export type GatewayProviderOrder = string[];
|
||||
|
||||
export type AnthropicOptions = {
|
||||
cacheControl?: { type: 'ephemeral' };
|
||||
};
|
||||
|
||||
export type BedrockOptions = {
|
||||
cachePoint?: { type: 'default' };
|
||||
additionalModelRequestFields?: {
|
||||
anthropic_beta?: string[];
|
||||
};
|
||||
};
|
||||
|
||||
export type OpenAIOptions = {
|
||||
// parallelToolCalls?: boolean;
|
||||
reasoningEffort?: 'low' | 'medium' | 'high' | 'minimal';
|
||||
verbosity?: 'low' | 'medium' | 'high';
|
||||
};
|
||||
|
||||
// Main provider options types
|
||||
export type AnthropicProviderOptions = {
|
||||
gateway: {
|
||||
order: GatewayProviderOrder;
|
||||
};
|
||||
anthropic: AnthropicOptions;
|
||||
bedrock: BedrockOptions;
|
||||
};
|
||||
|
||||
export type OpenAIProviderOptions = {
|
||||
gateway: {
|
||||
order: GatewayProviderOrder;
|
||||
};
|
||||
openai: OpenAIOptions;
|
||||
};
|
||||
|
||||
// Default options with proper typing
|
||||
export const DEFAULT_ANTHROPIC_OPTIONS: AnthropicProviderOptions = {
|
||||
gateway: {
|
||||
order: ['bedrock', 'anthropic', 'vertex'],
|
||||
},
|
||||
|
@ -17,7 +54,7 @@ export const DEFAULT_ANTHROPIC_OPTIONS = {
|
|||
},
|
||||
};
|
||||
|
||||
export const DEFAULT_OPENAI_OPTIONS = {
|
||||
export const DEFAULT_OPENAI_OPTIONS: OpenAIProviderOptions = {
|
||||
gateway: {
|
||||
order: ['openai'],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue