From bea295d70c8dfdb434376d53aef178b102866d36 Mon Sep 17 00:00:00 2001 From: Vatsal Manot Date: Thu, 7 Mar 2024 14:12:30 -0800 Subject: [PATCH] Update package --- .../PromptLiteral.StringInterpolation.Component.swift | 2 ++ .../Prompt Literal/PromptLiteralContext.swift | 1 + .../Prompt Literal/PromptMatterRole.swift | 11 ++++++----- .../Intramodular/OpenAI+LargeLanguageModels.swift | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptLiteral.StringInterpolation.Component.swift b/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptLiteral.StringInterpolation.Component.swift index 2820c997..07f6f7e6 100644 --- a/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptLiteral.StringInterpolation.Component.swift +++ b/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptLiteral.StringInterpolation.Component.swift @@ -87,6 +87,8 @@ extension PromptLiteral.StringInterpolation.Component: Codable { self.payload = try container.decode(Payload.self, forKey: .payload) self.context = try container.decodeIfPresent(PromptLiteralContext.self, forKey: .context) ?? .init() } catch { + runtimeIssue(error) + if let payload = try? Payload(from: decoder) { self.payload = payload self.context = .init() diff --git a/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptLiteralContext.swift b/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptLiteralContext.swift index f9aafca2..0f976f01 100644 --- a/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptLiteralContext.swift +++ b/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptLiteralContext.swift @@ -9,6 +9,7 @@ public protocol PromptLiteralContextKey: HadeanIdentifiable, Heterogeneou static var defaultValue: Value { get } } +@RuntimeDiscoverable public struct PromptLiteralContext: Codable, HashEquatable, @unchecked Sendable { public enum _Error: Error { case badMerge diff --git a/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptMatterRole.swift b/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptMatterRole.swift index 0f45e7c3..f01f4664 100644 --- a/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptMatterRole.swift +++ b/Sources/LargeLanguageModels/Intramodular/Prompt Literal/PromptMatterRole.swift @@ -122,12 +122,12 @@ public enum _PromptMatterRoleConstraints: Codable, Hashable, Sendable, ThrowingM } extension PromptLiteralContext { - @RuntimeDiscoverable @HadeanIdentifier("bijoz-nipoh-rakuh-fudum") - struct PromptMatterRoleKey: PromptLiteralContextKey { - typealias Value = _PromptMatterRoleConstraints? + @RuntimeDiscoverable + public struct PromptMatterRoleKey: PromptLiteralContextKey { + public typealias Value = _PromptMatterRoleConstraints? - static let defaultValue: Value = nil + public static let defaultValue: Value = nil } public var role: _PromptMatterRoleConstraints? { @@ -140,7 +140,8 @@ extension PromptLiteralContext { } extension PromptLiteralContext { - @HadeanIdentifier("rajil-pagik-tibah-jibod") + @HadeanIdentifier("sugam-bokij-kutur-narim") + @RuntimeDiscoverable struct ModelIdentifierKey: PromptLiteralContextKey { typealias Value = _MLModelIdentifierScope? diff --git a/Sources/OpenAI/Intramodular/OpenAI+LargeLanguageModels.swift b/Sources/OpenAI/Intramodular/OpenAI+LargeLanguageModels.swift index 0dc21b85..8ed4af52 100644 --- a/Sources/OpenAI/Intramodular/OpenAI+LargeLanguageModels.swift +++ b/Sources/OpenAI/Intramodular/OpenAI+LargeLanguageModels.swift @@ -22,7 +22,7 @@ extension OpenAI.APIClient: _TaskDependenciesExporting { extension OpenAI.APIClient: LLMRequestHandling { private var _debugPrintCompletions: Bool { - false + true } public var _availableModels: [_MLModelIdentifier]? {