feat: Adaptervertrag mit Dienststeuerung und Version (Studio, Ollama, llama.cpp, Attrappe; #1198)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -478,6 +478,23 @@ impl Engine for OllamaEngine {
|
||||
}
|
||||
}
|
||||
|
||||
async fn version(&self) -> Option<String> {
|
||||
// Nur beim angeschlossenen Server: Der verwaltete läuft nur, solange ein Modell geladen ist.
|
||||
if self.managed() {
|
||||
return None;
|
||||
}
|
||||
let antwort = self
|
||||
.http
|
||||
.get(format!("{}/api/version", self.base_url(None)))
|
||||
.timeout(Duration::from_secs(3))
|
||||
.send()
|
||||
.await
|
||||
.ok()?;
|
||||
let text = antwort.text().await.ok()?;
|
||||
let json: serde_json::Value = serde_json::from_str(&text).ok()?;
|
||||
json["version"].as_str().map(str::to_string)
|
||||
}
|
||||
|
||||
fn describe(&self) -> EngineInfo {
|
||||
EngineInfo {
|
||||
name: "ollama".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user