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.
33 lines
908 B
Swift
33 lines
908 B
Swift
import Foundation
|
|
|
|
/// The HTTP methods the Ollama API uses in v1.
|
|
public enum OllamaHTTPMethod: String, Sendable {
|
|
case get = "GET"
|
|
case post = "POST"
|
|
}
|
|
|
|
/// A transport-independent Ollama request.
|
|
public struct OllamaHTTPRequest: Sendable, Equatable {
|
|
/// The HTTP method.
|
|
public let method: OllamaHTTPMethod
|
|
/// The path below the configured base URL, e.g. `/api/version`.
|
|
public let path: String
|
|
/// An optional JSON body.
|
|
public let body: Data?
|
|
/// The body content type; defaults to `application/json` when a body is present.
|
|
public let contentType: String?
|
|
|
|
/// Creates a request.
|
|
public init(
|
|
method: OllamaHTTPMethod = .get,
|
|
path: String,
|
|
body: Data? = nil,
|
|
contentType: String? = nil
|
|
) {
|
|
self.method = method
|
|
self.path = path
|
|
self.body = body
|
|
self.contentType = contentType
|
|
}
|
|
}
|