Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: Update simple_programmatic_example to work with current API

LearningCircuitf208b40189b4
diff --git a/examples/api_usage/programmatic/simple_programmatic_example.py b/examples/api_usage/programmatic/simple_programmatic_example.py
index bf1f8131b9..9df2751a17 100755
--- a/examples/api_usage/programmatic/simple_programmatic_example.py
+++ b/examples/api_usage/programmatic/simple_programmatic_example.py
@@ -7,9 +7,33 @@ Quick example showing how to use the LDR Python API directly.
from local_deep_research.api import detailed_research, quick_summary
+# Create a minimal settings snapshot for programmatic mode
+# You need to specify at least the LLM settings for programmatic mode
+settings_snapshot = {
+ "programmatic_mode": True,
+ # LLM settings
+ "llm.provider": "ollama", # or "openai_endpoint", "openai", etc.
+ "llm.model": "gemma3:12b", # or your preferred model
+ "llm.temperature": 0.7,
+ "llm.local_context_window_size": 8192,
+ "llm.max_tokens": 4096,
+ "llm.supports_max_tokens": True,
+ # Search settings
+ "search.tool": "wikipedia", # default search tool
+ "search.max_results": 10,
+ "search.region": "wt-wt",
+ "search.time_period": "all",
+ "search.safe_search": True,
+ "search.snippets_only": True,
+ "search.search_language": "English",
+ "search.max_filtered_results": 5,
+}
+
# Example 1: Quick Summary
print("=== Quick Summary ===")
-result = quick_summary("What is machine learning?")
+result = quick_summary(
+ "What is machine learning?", settings_snapshot=settings_snapshot
+)
print(f"Summary: {result['summary'][:300]}...")
print(f"Found {len(result.get('findings', []))} findings")
@@ -20,6 +44,7 @@ result = detailed_research(
iterations=2,
search_tool="wikipedia",
search_strategy="source_based",
+ settings_snapshot=settings_snapshot,
)
print(f"Research ID: {result['research_id']}")
print(f"Summary length: {len(result['summary'])} characters")
@@ -35,6 +60,7 @@ result = quick_summary(
temperature=0.5, # Lower temperature for focused results
provider="openai_endpoint", # Specify LLM provider
model_name="llama-3.3-70b-instruct", # Specify model
+ settings_snapshot=settings_snapshot,
)
print(f"Completed {result['iterations']} iterations")
print(