1515
1616@preconcurrency import AWSBedrockRuntime
1717import Foundation
18- import SwiftBedrockTypes
18+ import BedrockTypes
1919
2020struct InvokeModelRequest {
2121 let model : BedrockModel
@@ -43,7 +43,7 @@ struct InvokeModelRequest {
4343 /// - maxTokens: Maximum number of tokens to generate (default: 300)
4444 /// - temperature: Temperature for text generation (default: 0.6)
4545 /// - Returns: A configured BedrockRequest for a text request
46- /// - Throws: SwiftBedrockError if the model doesn't support text output
46+ /// - Throws: BedrockServiceError if the model doesn't support text output
4747 static func createTextRequest(
4848 model: BedrockModel ,
4949 prompt: String ,
@@ -92,7 +92,7 @@ struct InvokeModelRequest {
9292 /// - prompt: The text description of the image to generate
9393 /// - nrOfImages: The number of images to generate
9494 /// - Returns: A configured BedrockRequest for image generation
95- /// - Throws: SwiftBedrockError if the model doesn't support text input or image output
95+ /// - Throws: BedrockServiceError if the model doesn't support text input or image output
9696 public static func createTextToImageRequest(
9797 model: BedrockModel ,
9898 prompt: String ,
@@ -149,7 +149,7 @@ struct InvokeModelRequest {
149149 /// - similarity: A value between 0 and 1 indicating how similar the variations should be to the source image
150150 /// - nrOfImages: The number of image variations to generate
151151 /// - Returns: A configured BedrockRequest for image variation generation
152- /// - Throws: SwiftBedrockError if the model doesn't support text and image input, or image output
152+ /// - Throws: BedrockServiceError if the model doesn't support text and image input, or image output
153153 public static func createImageVariationRequest(
154154 model: BedrockModel ,
155155 prompt: String ,
@@ -205,7 +205,7 @@ struct InvokeModelRequest {
205205
206206 /// Creates an InvokeModelInput instance for making a request to Amazon Bedrock
207207 /// - Returns: A configured InvokeModelInput containing the model ID, content type, and encoded request body
208- /// - Throws: SwiftBedrockError .encodingError if the request body cannot be encoded to JSON
208+ /// - Throws: BedrockServiceError .encodingError if the request body cannot be encoded to JSON
209209 public func getInvokeModelInput( ) throws -> InvokeModelInput {
210210 do {
211211 let jsonData : Data = try JSONEncoder ( ) . encode ( self . body)
@@ -216,7 +216,7 @@ struct InvokeModelRequest {
216216 modelId: model. id
217217 )
218218 } catch {
219- throw SwiftBedrockError . encodingError (
219+ throw BedrockServiceError . encodingError (
220220 " Something went wrong while encoding the request body to JSON for InvokeModelInput: \( error) "
221221 )
222222 }
0 commit comments