Download Sources/PromptGarageCore/Import/ImportEngine.swift from smlflg/PromtGarageMac: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/smlflg/PromtGarageMac/resolve/main/Sources/PromptGarageCore/Import/ImportEngine.swift
- Command line
-
hf download hf://smlflg/PromtGarageMac/Sources/PromptGarageCore/Import/ImportEngine.swift
-
curl -L -o ImportEngine.swift https://huggingface.co/smlflg/PromtGarageMac/resolve/main/Sources/PromptGarageCore/Import/ImportEngine.swift
1.04 kB
| import Foundation | |
| public struct ImportEngine: Sendable { | |
| public init() {} | |
| public func preview( | |
| format: ImportFormat, | |
| sourceURL: URL, | |
| dedupIndex: DedupIndex | |
| ) throws -> ImportPreview { | |
| let parser: any ImportParser = switch format { | |
| case .chatGPTAnalysisJSON: | |
| ChatGPTAnalysisParser() | |
| case .chatGPTRawConversationsJSON: | |
| ChatGPTRawConversationsParser() | |
| case .geminiMarkdown: | |
| GeminiMarkdownParser() | |
| case .geminiJSONL: | |
| GeminiJSONLParser() | |
| case .claudeJSONL: | |
| ClaudeJSONLParser() | |
| case .codexHistoryJSONL: | |
| CodexHistoryParser() | |
| case .hermesStateDatabase: | |
| HermesStateParser() | |
| } | |
| let result = try parser.parse(sourceURL: sourceURL, dedupIndex: dedupIndex) | |
| return ImportPreview( | |
| format: format, | |
| sourceURL: sourceURL, | |
| candidates: result.candidates, | |
| statistics: result.statistics | |
| ) | |
| } | |
| } | |