Skip to content

Commit 68a7d67

Browse files
committed
publish some needed interfaces
1 parent 75370af commit 68a7d67

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Sources/AnthropicSwiftSDK/Entity/Content.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99

1010
/// Type of content block.
11-
enum ContentType: String {
11+
public enum ContentType: String {
1212
/// single string
1313
case text
1414
/// image content
@@ -33,7 +33,7 @@ public enum Content {
3333
case toolResult(ToolResultContent)
3434

3535
/// The type of content block.
36-
var contentType: ContentType {
36+
public var contentType: ContentType {
3737
switch self {
3838
case .text:
3939
return ContentType.text

Sources/AnthropicSwiftSDK/Entity/ToolResultContent.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ public struct ToolResultContent {
1616
public let content: [Content]
1717
/// Set to `true` if the tool execution resulted in an error.
1818
public let isError: Bool?
19+
20+
public init(toolUseId: String, content: [Content], isError: Bool?) {
21+
self.toolUseId = toolUseId
22+
self.content = content
23+
self.isError = isError
24+
}
1925
}
2026

2127
extension ToolResultContent: Encodable {}

Sources/AnthropicSwiftSDK/Network/Extension/StreamingResponse+Extension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
extension StreamingResponse {
99
/// True if `stop_reason` of this StreamingResponse is `tool_use`
10-
var isToolUse: Bool {
10+
public var isToolUse: Bool {
1111
switch self {
1212
case let deltaResponse as StreamingMessageDeltaResponse:
1313
return deltaResponse.isToolUse

0 commit comments

Comments
 (0)