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/BedrockService+ConverseStreaming.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ extension BedrockService {
// see https://github.com/awslabs/aws-sdk-swift/blob/2697fb44f607b9c43ad0ce5ca79867d8d6c545c2/Sources/Services/AWSBedrockRuntime/Sources/AWSBedrockRuntime/Models.swift#L3478
// it will be the responsibility of the user to handle the stream and re-assemble the messages and content

let reply = try ConverseReplyStream(sdkStream)
let reply = try ConverseReplyStream(sdkStream, logger: logger)

// this time, a different stream is created from the previous one, this one has the following elements
// - messageStart: this is the start of a message, it contains the role (assistant or user)
Expand Down
11 changes: 8 additions & 3 deletions Sources/Converse/Tool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import Foundation
import Smithy

public struct Tool: Codable {
public struct Tool: Codable, CustomStringConvertible {
public let name: String
public let inputSchema: JSON
public let description: String?
public let toolDescription: String?

public init(name: String, inputSchema: JSON, description: String? = nil) throws {
guard !name.isEmpty else {
Expand All @@ -33,7 +33,7 @@ public struct Tool: Codable {
}
self.name = name
self.inputSchema = inputSchema
self.description = description
self.toolDescription = description
}

public init(from sdkToolSpecification: BedrockRuntimeClientTypes.ToolSpecification) throws {
Expand Down Expand Up @@ -67,4 +67,9 @@ public struct Tool: Codable {
name: name
)
}

// for CustomStringConvertible
public var description: String {
"Tool(name: \(name), description: \(toolDescription ?? "nil"))"
}
}