feat: add populate_knowledge batch binary with configurable timeout
Adds a standalone binary that walks a directory and runs the agentic insight loop over every image/video, skipping files already processed. Supports --path, --model, --max-iterations, --timeout-secs, --num-ctx, and --reprocess flags for flexible overnight/VPS batch runs. Also adds OllamaClient::with_request_timeout() builder method so slow large models are not cut off by the default 120s limit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,17 @@ impl OllamaClient {
|
||||
self.num_ctx = num_ctx;
|
||||
}
|
||||
|
||||
/// Replace the HTTP client with one using a custom request timeout.
|
||||
/// Useful for slow models where the default 120s may be insufficient.
|
||||
pub fn with_request_timeout(mut self, secs: u64) -> Self {
|
||||
self.client = Client::builder()
|
||||
.connect_timeout(Duration::from_secs(5))
|
||||
.timeout(Duration::from_secs(secs))
|
||||
.build()
|
||||
.unwrap_or_else(|_| Client::new());
|
||||
self
|
||||
}
|
||||
|
||||
/// List available models on an Ollama server (cached for 15 minutes)
|
||||
pub async fn list_models(url: &str) -> Result<Vec<String>> {
|
||||
// Check cache first
|
||||
|
||||
Reference in New Issue
Block a user