We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ad0585 commit b9a1cb1Copy full SHA for b9a1cb1
1 file changed
Sources/AgentRunKit/LLM/AnthropicClientTypes.swift
@@ -106,6 +106,10 @@ enum AnthropicContentBlock: Encodable {
106
}
107
108
func encode(to encoder: any Encoder) throws {
109
+ if case let .opaque(raw) = self {
110
+ try raw.encode(to: encoder)
111
+ return
112
+ }
113
var container = encoder.container(keyedBy: CodingKeys.self)
114
switch self {
115
case let .text(text, cacheControl):
@@ -144,8 +148,8 @@ enum AnthropicContentBlock: Encodable {
144
148
try sourceContainer.encode(mediaType, forKey: .mediaType)
145
149
try sourceContainer.encode(data, forKey: .data)
146
150
try container.encodeIfPresent(cacheControl, forKey: .cacheControl)
147
- case let .opaque(raw):
- try raw.encode(to: encoder)
151
+ case .opaque:
152
+ break
153
154
155
0 commit comments