diff --git a/Sources/Converse/ContentBlocks/ToolResultBlock.swift b/Sources/Converse/ContentBlocks/ToolResultBlock.swift index 20252ce..396b1fe 100644 --- a/Sources/Converse/ContentBlocks/ToolResultBlock.swift +++ b/Sources/Converse/ContentBlocks/ToolResultBlock.swift @@ -71,7 +71,7 @@ public struct ToolResultBlock: Codable, Sendable { } /// convenience initializer for ToolResultBlock for any Codable - public init(_ object: T, id: String, status: Status? = .success) throws { + public init(_ object: T, id: String, status: Status? = .success) throws { guard let data = try? JSONEncoder().encode(object) else { throw BedrockLibraryError.encodingError("Could not encode object to JSON") } diff --git a/Sources/Converse/ConverseRequestBuilder.swift b/Sources/Converse/ConverseRequestBuilder.swift index f63de00..deac253 100644 --- a/Sources/Converse/ConverseRequestBuilder.swift +++ b/Sources/Converse/ConverseRequestBuilder.swift @@ -286,7 +286,7 @@ public struct ConverseRequestBuilder { return try self.withToolResult(toolResult) } - public func withToolResult( + public func withToolResult( _ object: C, id: String? = nil, status: ToolResultBlock.Status? = nil diff --git a/Sources/Converse/Tool.swift b/Sources/Converse/Tool.swift index 4aafc21..be977fc 100644 --- a/Sources/Converse/Tool.swift +++ b/Sources/Converse/Tool.swift @@ -22,7 +22,7 @@ import FoundationEssentials import Foundation #endif -public struct Tool: Codable, CustomStringConvertible { +public struct Tool: Codable, CustomStringConvertible, Sendable { public let name: String public let inputSchema: JSON public let toolDescription: String?