Skip to content

Commit

Permalink
fix(providers/amazon-bedrock): Remove min max from reasoning config
Browse files Browse the repository at this point in the history
fix(providers/amazon-bedrock): change check on inferenceConfig.temperature when thinking is enabled
  • Loading branch information
Und3rf10w committed Mar 6, 2025
1 parent 3bde0d1 commit 54c10c8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/amazon-bedrock/src/bedrock-chat-language-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class BedrockChatLanguageModel implements LanguageModelV1 {
}

// Remove temperature if thinking is enabled
if (isThinking && inferenceConfig.temperature !== null) {
if (isThinking && inferenceConfig.temperature != null) {
delete inferenceConfig.temperature;
warnings.push({
type: 'unsupported-setting',
Expand Down Expand Up @@ -295,7 +295,7 @@ export class BedrockChatLanguageModel implements LanguageModelV1 {
) {
return {
type: 'redacted' as const,
data: content.reasoningContent.redactedReasoning.data || '',
data: content.reasoningContent.redactedReasoning.data ?? '',
};
} else {
// Return undefined for unexpected structures
Expand Down Expand Up @@ -571,8 +571,7 @@ export class BedrockChatLanguageModel implements LanguageModelV1 {
const BedrockReasoningConfigOptionsSchema = z
.object({
type: z.union([z.literal('enabled'), z.literal('disabled')]),
// https://docs.anthropic.com/en/docs/about-claude/models/all-models#model-comparison-table
budget_tokens: z.number().min(1024).max(64000).nullish(),
budget_tokens: z.number().nullish(),
})
.nullish();

Expand Down

0 comments on commit 54c10c8

Please sign in to comment.