Skip to content

Commit 9249a2d

Browse files
committed
bedrock client should use model passed in message methods
1 parent 4bee087 commit 9249a2d

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

Sources/AnthropicSwiftSDK-Bedrock/AnthropicBedrockClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public final class AnthropicBedrockClient {
1818
AnthropicVersion.custom("bedrock-2023-05-31").stringfy
1919
}
2020

21-
init(client: BedrockRuntimeClient, model: Model) {
22-
self.messages = .init(client: client, model: model)
21+
init(client: BedrockRuntimeClient) {
22+
self.messages = .init(client: client)
2323
}
2424
}

Sources/AnthropicSwiftSDK-Bedrock/Extensions/BedrockClient+Extension.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ public extension BedrockRuntimeClient {
1616
/// - client: Bedrock runtime client
1717
/// - model: Claude model, Bedrock supports Haiku or Sonnet instance type.
1818
/// - Returns: Client using Claude through Bedrock
19-
static func useAnthropic(_ client: BedrockRuntimeClient, model: Model) -> AnthropicBedrockClient {
20-
AnthropicBedrockClient(client: client, model: model)
19+
static func useAnthropic(_ client: BedrockRuntimeClient) -> AnthropicBedrockClient {
20+
AnthropicBedrockClient(client: client)
2121
}
2222

2323
/// Create a client using Claude through Bedrock
2424
///
2525
/// - Parameters:
2626
/// - model: Claude model, Bedrock supports Haiku or Sonnet instance type.
2727
/// - Returns: Client using Claude through Bedrock
28-
func useAnthropic(model: Model) -> AnthropicBedrockClient {
29-
AnthropicBedrockClient(client: self, model: model)
28+
func useAnthropic() -> AnthropicBedrockClient {
29+
AnthropicBedrockClient(client: self)
3030
}
3131
}

Sources/AnthropicSwiftSDK-Bedrock/Messages.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ public struct Messages {
1616
public let requestContentType = "application/json"
1717
/// Bedrock API Client
1818
public let client: BedrockRuntimeClient
19-
/// Claude model for this client
20-
public let model: Model
2119

22-
init(client: BedrockRuntimeClient, model: Model) {
20+
init(client: BedrockRuntimeClient) {
2321
self.client = client
24-
self.model = model
2522
}
2623

2724
/// Creates a message using the specified parameters and sends a request to the Anthropic API asynchronously.

0 commit comments

Comments
 (0)