diff --git a/Sources/SLlama/Client.swift b/Sources/SLlama/Client.swift index 3008ba9..be30dd9 100644 --- a/Sources/SLlama/Client.swift +++ b/Sources/SLlama/Client.swift @@ -78,7 +78,7 @@ public struct Client { do { return try Model.decode(data: taskData) } catch { - throw SLlamaClientError.invalidModel(error: error) + throw SLlamaClientError.invalidModel(error: error, content: taskData) } } } diff --git a/Sources/SLlama/ClientError.swift b/Sources/SLlama/ClientError.swift index b632c64..e5ae5bb 100644 --- a/Sources/SLlama/ClientError.swift +++ b/Sources/SLlama/ClientError.swift @@ -10,6 +10,6 @@ import Foundation public enum SLlamaClientError: LocalizedError { case invalidBaseURL case invalidURLResponse - case invalidModel(error: Error) + case invalidModel(error: Error, content: Data) } diff --git a/Tests/SLlamaTests/SLlamaTests.swift b/Tests/SLlamaTests/SLlamaTests.swift index b269fc0..2ad7d81 100644 --- a/Tests/SLlamaTests/SLlamaTests.swift +++ b/Tests/SLlamaTests/SLlamaTests.swift @@ -75,17 +75,17 @@ final class SLlamaTests: XCTestCase { // } } -extension SLlamaTests: ClientStreamDelegate { - func didReceiveModel(model: Model) where Model : Codable { - guard let model = model as? CompletionResult else { return } - print(model.content, terminator: "") - } - - func didFinish(error: Error?) { - if let error { - print("Finished with error: \(error)") - } else { - print("Finished with no error") - } - } -} +//extension SLlamaTests: ClientStreamDelegate { +// func didReceiveModel(model: Model) where Model : Codable { +// guard let model = model as? CompletionResult else { return } +// print(model.content, terminator: "") +// } +// +// func didFinish(error: Error?) { +// if let error { +// print("Finished with error: \(error)") +// } else { +// print("Finished with no error") +// } +// } +//}