Skip to content

Commit 8412e85

Browse files
authored
Merge pull request #1488 from rocket-admin/backend_aws_bedrock
refactor: simplify AmazonBedrockAiProvider by removing unused parameters
2 parents f28d516 + fc5be75 commit 8412e85

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

backend/src/entities/ai/amazon-bedrock/amazon-bedrock.ai.provider.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@ import { IAIProvider } from './ai-provider.interface.js';
66
export class AmazonBedrockAiProvider implements IAIProvider {
77
private readonly bedrockRuntimeClient: BedrockRuntimeClient;
88
private readonly modelId: string = 'global.anthropic.claude-sonnet-4-5-20250929-v1:0';
9-
private readonly temperature: number = 0.7;
109
private readonly maxTokens: number = 1024;
11-
private readonly region: string = 'us-west-2';
12-
private readonly topP: number = 0.9;
1310

1411
constructor() {
15-
this.bedrockRuntimeClient = new BedrockRuntimeClient({
16-
region: this.region,
17-
});
12+
this.bedrockRuntimeClient = new BedrockRuntimeClient();
1813
}
1914
public async generateResponse(prompt: string): Promise<string> {
2015
const conversation = [
@@ -27,7 +22,7 @@ export class AmazonBedrockAiProvider implements IAIProvider {
2722
const command = new ConverseCommand({
2823
modelId: this.modelId,
2924
messages: conversation,
30-
inferenceConfig: { maxTokens: this.maxTokens, temperature: this.temperature, topP: this.topP },
25+
inferenceConfig: { maxTokens: this.maxTokens },
3126
});
3227
try {
3328
const response = await this.bedrockRuntimeClient.send(command);

0 commit comments

Comments
 (0)