Add endpoint policy and redirect-safe ephemeral HTTP client, error mapping, catalog cache and version checks, streaming chat with phase timeouts/cancellation, provisional Hy-MT3 prompt/language/request factory, warm-up policy, and sprachmittler-cli models/show/translate. Recapture the 7B fixtures; defer the 1.8B VERIFY items; document ADR-016. Also fix the signature checker's pipefail SIGPIPE issue.
26 lines
729 B
Swift
26 lines
729 B
Swift
import Foundation
|
|
import SprachmittlerEngines
|
|
import SprachmittlerOllama
|
|
|
|
/// The CLI composition root. Concrete clients are created only here (CODING_STANDARDS).
|
|
struct CLIEnvironment: Sendable {
|
|
let baseURL: URL
|
|
let allowRemote: Bool
|
|
|
|
func makeHTTPClient() throws -> OllamaHTTPClient {
|
|
try OllamaHTTPClient(baseURL: baseURL, allowRemote: allowRemote)
|
|
}
|
|
|
|
func makeCatalog() throws -> any OllamaCatalog {
|
|
try OllamaCatalogClient(http: makeHTTPClient())
|
|
}
|
|
|
|
func makeChatClient() throws -> OllamaChatClient {
|
|
try OllamaChatClient(http: makeHTTPClient())
|
|
}
|
|
|
|
func makeRequestFactory(model: String) -> HyMT3RequestFactory {
|
|
HyMT3RequestFactory(model: model)
|
|
}
|
|
}
|