Make date parse from metadata a little more consistent
This commit is contained in:
@@ -222,13 +222,14 @@ pub async fn get_available_models_handler(
|
||||
let ollama_client = &app_state.ollama;
|
||||
|
||||
// Fetch models with capabilities from primary server
|
||||
let primary_models = match OllamaClient::list_models_with_capabilities(&ollama_client.primary_url).await {
|
||||
Ok(models) => models,
|
||||
Err(e) => {
|
||||
log::warn!("Failed to fetch models from primary server: {:?}", e);
|
||||
vec![]
|
||||
}
|
||||
};
|
||||
let primary_models =
|
||||
match OllamaClient::list_models_with_capabilities(&ollama_client.primary_url).await {
|
||||
Ok(models) => models,
|
||||
Err(e) => {
|
||||
log::warn!("Failed to fetch models from primary server: {:?}", e);
|
||||
vec![]
|
||||
}
|
||||
};
|
||||
|
||||
let primary = ServerModels {
|
||||
url: ollama_client.primary_url.clone(),
|
||||
|
||||
@@ -995,7 +995,10 @@ impl InsightGenerator {
|
||||
let image_base64 = if has_vision {
|
||||
match self.load_image_as_base64(&file_path) {
|
||||
Ok(b64) => {
|
||||
log::info!("Successfully loaded image for vision-capable model '{}'", model_to_check);
|
||||
log::info!(
|
||||
"Successfully loaded image for vision-capable model '{}'",
|
||||
model_to_check
|
||||
);
|
||||
Some(b64)
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
@@ -63,7 +63,10 @@ impl OllamaClient {
|
||||
}
|
||||
|
||||
/// Check if a model has vision capabilities using the /api/show endpoint
|
||||
pub async fn check_model_capabilities(url: &str, model_name: &str) -> Result<ModelCapabilities> {
|
||||
pub async fn check_model_capabilities(
|
||||
url: &str,
|
||||
model_name: &str,
|
||||
) -> Result<ModelCapabilities> {
|
||||
let client = Client::builder()
|
||||
.connect_timeout(Duration::from_secs(5))
|
||||
.timeout(Duration::from_secs(10))
|
||||
|
||||
Reference in New Issue
Block a user