Download Sources/PromptGarageCore/Models/PromptQuery.swift from smlflg/PromtGarageMac: direct link, hf CLI and curl.
- Browser
- Download file 1.44 kB
-
https://huggingface.co/smlflg/PromtGarageMac/resolve/main/Sources/PromptGarageCore/Models/PromptQuery.swift
- Command line
-
hf download hf://smlflg/PromtGarageMac/Sources/PromptGarageCore/Models/PromptQuery.swift
-
curl -L -o PromptQuery.swift https://huggingface.co/smlflg/PromtGarageMac/resolve/main/Sources/PromptGarageCore/Models/PromptQuery.swift
1.44 kB
| import Foundation | |
| public struct PromptQuery: Hashable, Sendable { | |
| public enum Sort: String, CaseIterable, Sendable { | |
| case updatedDescending | |
| case titleAscending | |
| case mostUsed | |
| } | |
| public var text: String | |
| public var tag: String? | |
| public var sourceFamily: String? | |
| public var promptedDay: String? | |
| public var untaggedOnly: Bool | |
| public var starredOnly: Bool | |
| public var usedOnly: Bool | |
| public var sort: Sort | |
| public var limit: Int | |
| public var offset: Int | |
| public init( | |
| text: String = "", | |
| tag: String? = nil, | |
| sourceFamily: String? = nil, | |
| promptedDay: String? = nil, | |
| untaggedOnly: Bool = false, | |
| starredOnly: Bool = false, | |
| usedOnly: Bool = false, | |
| sort: Sort = .updatedDescending, | |
| limit: Int = 100, | |
| offset: Int = 0 | |
| ) { | |
| self.text = text | |
| self.tag = tag | |
| self.sourceFamily = sourceFamily | |
| self.promptedDay = promptedDay | |
| self.untaggedOnly = untaggedOnly | |
| self.starredOnly = starredOnly | |
| self.usedOnly = usedOnly | |
| self.sort = sort | |
| self.limit = max(1, min(limit, 500)) | |
| self.offset = max(0, offset) | |
| } | |
| } | |
| public struct PromptPage: Sendable { | |
| public let prompts: [PromptRecord] | |
| public let total: Int | |
| public init(prompts: [PromptRecord], total: Int) { | |
| self.prompts = prompts | |
| self.total = total | |
| } | |
| } | |