LLMRouter: gemmaAllowsCellular-Parameter im Init
Apps reichen User-Setting durch (WiFi-only vs cellular OK) statt über globale GemmaBackend-Properties. LLMRouter instanziiert GemmaE2B + GemmaE4B mit dem allowsCellular-Wert. Default false (WiFi-only). Bei Toggle-Change muss App den Router neu instanziieren — memoro-native SettingsView macht das bereits über die makeRouter()-Factory. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
fd376bbdce
commit
18e7b16cc1
1 changed files with 15 additions and 5 deletions
|
|
@ -22,18 +22,28 @@ public actor LLMRouter {
|
|||
/// Apps mit weniger Backends überschreiben das.
|
||||
public static let shared = LLMRouter()
|
||||
|
||||
private let appleFM = AppleFMBackend()
|
||||
private let noOp = NoOpBackend()
|
||||
private let gemmaE2B = GemmaBackend(variant: .e2b)
|
||||
private let gemmaE4B = GemmaBackend(variant: .e4b)
|
||||
private let appleFM: AppleFMBackend
|
||||
private let noOp: NoOpBackend
|
||||
private let gemmaE2B: GemmaBackend
|
||||
private let gemmaE4B: GemmaBackend
|
||||
|
||||
/// Priority-Reihenfolge der Backends. Apps können das je nach
|
||||
/// Use-Case justieren — z.B. moodlit will Gemma E2B bevor es FM
|
||||
/// (Creative-Mapping), pageta will FM zuerst (Summary).
|
||||
private var preferred: [LLMBackendID]
|
||||
|
||||
public init(preferred: [LLMBackendID] = [.appleFM, .gemmaE2B, .gemmaE4B, .noOp]) {
|
||||
/// `gemmaAllowsCellular` reicht die App-Einstellung an die
|
||||
/// Gemma-Backends durch — Default `false` (WiFi-only). Bei
|
||||
/// Toggle-Change muss App den Router neu instanziieren.
|
||||
public init(
|
||||
preferred: [LLMBackendID] = [.appleFM, .gemmaE2B, .gemmaE4B, .noOp],
|
||||
gemmaAllowsCellular: Bool = false
|
||||
) {
|
||||
self.preferred = preferred
|
||||
self.appleFM = AppleFMBackend()
|
||||
self.noOp = NoOpBackend()
|
||||
self.gemmaE2B = GemmaBackend(variant: .e2b, allowsCellular: gemmaAllowsCellular)
|
||||
self.gemmaE4B = GemmaBackend(variant: .e4b, allowsCellular: gemmaAllowsCellular)
|
||||
}
|
||||
|
||||
public func setPreferred(_ ids: [LLMBackendID]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue