feat(m1): Ollama client, catalog, streaming chat and CLI (T1.1-T1.6)
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.
This commit is contained in:
1 parent
7ca5c710ec
commit
26b493e7e5
93 files changed
+3732
-218
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import Foundation
|
||||
import SprachmittlerOllama
|
||||
import Testing
|
||||
@testable import SprachmittlerCore
|
||||
|
||||
@Suite("Ollama error mapping")
|
||||
struct ErrorMappingTests {
|
||||
@Test func mapsEveryOllamaCaseToTheDomainTaxonomy() throws {
|
||||
let url = try #require(URL(string: "http://127.0.0.1:11434"))
|
||||
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .endpointRejected(.redirect))
|
||||
== .endpointRejected(reason: .redirect)
|
||||
)
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .unreachable(url))
|
||||
== .ollamaUnreachable(url: url)
|
||||
)
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .modelNotInstalled("missing"))
|
||||
== .modelNotInstalled(model: "missing")
|
||||
)
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .badRequest("bad input"))
|
||||
== .badRequest(message: "bad input")
|
||||
)
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .server(status: 500, message: "out of memory"))
|
||||
== .server(status: 500, message: "out of memory")
|
||||
)
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .timeout(.firstToken))
|
||||
== .timeout(phase: .firstToken)
|
||||
)
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .cancelled)
|
||||
== .cancelled
|
||||
)
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .decoding("Invalid JSON response"))
|
||||
== .server(status: 0, message: "Invalid JSON response")
|
||||
)
|
||||
#expect(
|
||||
SprachmittlerError(ollama: .unsupportedVersion(found: "0.39.9", required: "0.40.0"))
|
||||
== .ollamaTooOld(found: "0.39.9", required: "0.40.0")
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user