Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Converse/ContentBlocks/ToolResultBlock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public struct ToolResultBlock: Codable, Sendable {
}

/// convenience initializer for ToolResultBlock for any Codable
public init<T: Codable>(_ object: T, id: String, status: Status? = .success) throws {
public init<T: Encodable>(_ 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")
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Converse/ConverseRequestBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public struct ConverseRequestBuilder {
return try self.withToolResult(toolResult)
}

public func withToolResult<C: Codable>(
public func withToolResult<C: Encodable>(
_ object: C,
id: String? = nil,
status: ToolResultBlock.Status? = nil
Expand Down
2 changes: 1 addition & 1 deletion Sources/Converse/Tool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down