Skip to content

Commit 1301338

Browse files
committed
Add CustomStringConvertible conformance
1 parent 69aef8e commit 1301338

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

FirebaseAI/Sources/Types/Public/Part.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,14 @@ public struct FunctionResponsePart: Part {
207207
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
208208
public struct ExecutableCodePart: Part {
209209
/// The language of the code in an ``ExecutableCodePart``.
210-
public struct Language: Sendable, Equatable {
210+
public struct Language: Sendable, Equatable, CustomStringConvertible {
211211
let internalLanguage: ExecutableCode.Language
212212

213213
/// The Python programming language.
214214
public static let python = ExecutableCodePart.Language(ExecutableCode.Language(kind: .python))
215215

216+
public var description: String { internalLanguage.rawValue }
217+
216218
init(_ language: ExecutableCode.Language) {
217219
internalLanguage = language
218220
}
@@ -258,7 +260,7 @@ public struct ExecutableCodePart: Part {
258260
@available(iOS 15.0, macOS 12.0, macCatalyst 15.0, tvOS 15.0, watchOS 8.0, *)
259261
public struct CodeExecutionResultPart: Part {
260262
/// The outcome of a code execution.
261-
public struct Outcome: Sendable, Equatable {
263+
public struct Outcome: Sendable, Equatable, CustomStringConvertible {
262264
let internalOutcome: CodeExecutionResult.Outcome
263265

264266
/// The code executed without errors.
@@ -272,7 +274,7 @@ public struct CodeExecutionResultPart: Part {
272274
public static let deadlineExceeded =
273275
CodeExecutionResultPart.Outcome(CodeExecutionResult.Outcome(kind: .deadlineExceeded))
274276

275-
public var rawValue: String { internalOutcome.rawValue }
277+
public var description: String { internalOutcome.rawValue }
276278

277279
init(_ outcome: CodeExecutionResult.Outcome) {
278280
internalOutcome = outcome

0 commit comments

Comments
 (0)