mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-12 01:39:25 +02:00
Merge pull request #91 from R0m1k3/antigravity
feat: add AI service for content extraction and Browserless service f…
This commit is contained in:
2 files changed
+8
-2
No files matched your search
@@ -23,7 +23,7 @@ from app.utils.text import clean_text
|
||||
|
||||
# Default configuration (can be overridden by DB settings)
|
||||
DEFAULT_PROVIDER = "ollama"
|
||||
DEFAULT_MODEL = "gemma3:4b"
|
||||
DEFAULT_MODEL = "google/gemini-flash-1.5"
|
||||
DEFAULT_API_BASE = "http://ollama:11434"
|
||||
DEFAULT_TEMPERATURE = 0.1
|
||||
DEFAULT_MAX_TOKENS = 300
|
||||
@@ -91,6 +91,12 @@ class AIService:
|
||||
"multi_sample_threshold": float(settings_map.get("multi_sample_confidence_threshold", "0.6")),
|
||||
}
|
||||
|
||||
# Force override for known problematic model
|
||||
if config["model"] == "openai/gpt-5-nano":
|
||||
logger.warning("Overriding problematic model 'openai/gpt-5-nano' with 'google/gemini-flash-1.5'")
|
||||
config["model"] = "google/gemini-flash-1.5"
|
||||
config["provider"] = "openrouter"
|
||||
|
||||
# Update cache
|
||||
_config_cache["data"] = config # type: ignore
|
||||
_config_cache["timestamp"] = now
|
||||
|
||||
@@ -185,7 +185,7 @@ class BrowserlessService:
|
||||
filename = f"{safe_name}_{timestamp}.jpg"
|
||||
screenshot_path = f"{screenshots_dir}/{filename}"
|
||||
|
||||
await page.screenshot(path=screenshot_path, full_page=True, quality=80, type="jpeg")
|
||||
await page.screenshot(path=screenshot_path, full_page=False, quality=80, type="jpeg")
|
||||
logger.info(f"Screenshot saved to {screenshot_path}")
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to take screenshot: {e}")
|
||||
|
||||
Reference in new issue
Block a user