openclaw / apps /shared /OpenClawKit /Sources /OpenClawChatUI /ChatTranscriptCache+SettingsExpectation.swift
Download apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTranscriptCache+SettingsExpectation.swift from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 728 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTranscriptCache%2BSettingsExpectation.swift
- Command line
-
hf download hf://SaylorTwift/openclaw/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTranscriptCache+SettingsExpectation.swift
-
curl -L -o ChatTranscriptCache+SettingsExpectation.swift https://huggingface.co/SaylorTwift/openclaw/resolve/main/apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTranscriptCache%2BSettingsExpectation.swift
728 Bytes
| import Foundation | |
| extension OpenClawChatSQLiteTranscriptCache { | |
| nonisolated static func encodeSessionSettingsExpectation( | |
| _ expectation: OpenClawChatSessionSettingsExpectation?) -> String? | |
| { | |
| guard let expectation, | |
| let data = try? JSONEncoder().encode(expectation) | |
| else { return nil } | |
| return String(bytes: data, encoding: .utf8) | |
| } | |
| nonisolated static func decodeSessionSettingsExpectation( | |
| _ raw: String?) throws -> OpenClawChatSessionSettingsExpectation? | |
| { | |
| guard let raw, !raw.isEmpty else { return nil } | |
| return try JSONDecoder().decode( | |
| OpenClawChatSessionSettingsExpectation.self, | |
| from: Data(raw.utf8)) | |
| } | |
| } | |