-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3509566
commit 9a49864
Showing
8 changed files
with
104 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "engineHash": "7874ac3", "specHash": "1fdcbef", "version": "0.6.0" } | ||
{ "engineHash": "a88aabb", "specHash": "59747aa", "version": "0.6.0" } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Foundation | ||
|
||
/// The item to be processed by the LLM for ask requests. | ||
public class AiItemAsk: Codable { | ||
private enum CodingKeys: String, CodingKey { | ||
case id | ||
case type | ||
case content | ||
} | ||
|
||
/// The ID of the file. | ||
public let id: String | ||
|
||
/// The type of the item. A `hubs` item must be used as a single item. | ||
public let type: AiItemAskTypeField | ||
|
||
/// The content of the item, often the text representation. | ||
public let content: String? | ||
|
||
/// Initializer for a AiItemAsk. | ||
/// | ||
/// - Parameters: | ||
/// - id: The ID of the file. | ||
/// - type: The type of the item. A `hubs` item must be used as a single item. | ||
/// - content: The content of the item, often the text representation. | ||
public init(id: String, type: AiItemAskTypeField, content: String? = nil) { | ||
self.id = id | ||
self.type = type | ||
self.content = content | ||
} | ||
|
||
required public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
id = try container.decode(String.self, forKey: .id) | ||
type = try container.decode(AiItemAskTypeField.self, forKey: .type) | ||
content = try container.decodeIfPresent(String.self, forKey: .content) | ||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encode(id, forKey: .id) | ||
try container.encode(type, forKey: .type) | ||
try container.encodeIfPresent(content, forKey: .content) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Foundation | ||
|
||
public enum AiItemAskTypeField: String, CodableStringEnum { | ||
case file | ||
case hubs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters