feat(search): search with Exa, Gemini only with a login, title-guarded Wikipedia
DuckDuckGo now serves only its bot-check page (game PC and host alike), so every search fell to Wikipedia full-text search, which picked unrelated pages (박진영 for songs for a rainy day, 대한민국 for a graphics card ranking). Live 2026-11-18 answers took 9-15 s and were wrong. - Exa's free MCP endpoint (no key) is the first provider after the live-broadcast Chrome; it returns page text, so no fetch is needed. - Gemini runs only when Exa found nothing and a CLI login (oauth) or key (apikey) is present; without a login the CLI is no longer started (about 2 s per search). - Wikipedia is used only when the page title is named in the query; otherwise the honest nothing-found envelope. - Letters of a script the user did not use are dropped from the query (the model searched '사과와 배 중哪个가 더 단가요'). - DuckDuckGo removed; spec, docs and tests follow the new order. - weather: any forecast failure (not only requests errors) tries met.no. Real model (qwen3.6-35b-a3b, game PC), real network: graphics card ranking, apples vs pears, rainy-day genres and black holes all answered correctly in 3.7-5.2 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -183,10 +183,10 @@ Every distinct LLM call in Jarvis, what feeds it, what consumes it, and how it i
|
||||
- **Weather** ([src/jarvis/tools/builtin/weather.py](src/jarvis/tools/builtin/weather.py), ~line 60) — `ollama_chat_model`, parses location/time/unit from the query.
|
||||
- **Chat delete consent** ([src/jarvis/tools/builtin/chat_channels.py](src/jarvis/tools/builtin/chat_channels.py), `_user_agrees`, v2 only) — resolution chain `tool_router_model → intent_judge_model → ollama_chat_model`, temperature 0, timeout `llm_tools_timeout_sec`. Runs only when `chatChannels delete confirm=true` arrives in the turn right after the delete was asked. Input: the pending message ID and channel name (in the system prompt) and the person's own message of this turn (fenced); a message over 600 chars is not sent and counts as no. Output: one word, YES means delete that message. Fail-closed. Eval: `evals/test_chat_delete_consent.py`.
|
||||
- **Nutrition log_meal** ([src/jarvis/tools/builtin/nutrition/log_meal.py](src/jarvis/tools/builtin/nutrition/log_meal.py), lines 48 & 136) — `ollama_chat_model`, extracts nutrients, confirms logging.
|
||||
- **Gemini real-time search** ([src/jarvis/tools/builtin/realtime_search.py](src/jarvis/tools/builtin/realtime_search.py)) — **external Gemini model**, NOT Ollama. Used on the `webSearch` route whenever the on-screen Chrome path is NOT active: either `STREAM_BROWSER=false` (broadcast disabled) or `STREAM_BROWSER=true` with the live broadcast currently off (`context.broadcasting` False). Sub-mode is `cfg.gemini_auth` (env `GEMINI_AUTH`, default `oauth`):
|
||||
- `oauth` (default) `gemini_cli_search()` — shells out to the Gemini CLI (`gemini -p <query> -o json --skip-trust`, default approval mode) authenticated by the user's Google-account login (`GEMINI_API_KEY`/`GOOGLE_API_KEY` stripped from the child env, `GOOGLE_GENAI_USE_GCA=true` set to select OAuth); model is whatever the CLI/account defaults to. Uses the CLI's built-in web-search grounding. Bounded by a 30s subprocess timeout. The login lives in `~/.gemini`; in Docker that is the project-local `docker/gemini-oauth` bind mount (override `GEMINI_OAUTH_DIR`), which the operator seeds once. `gemini_oauth_ready()` checks `~/.gemini/oauth_creds.json` and logs a one-time fallback hint (and the entrypoint warns on startup) when oauth is selected but unseeded, since the path otherwise silently degrades to DDG/Brave.
|
||||
- **Gemini real-time search** ([src/jarvis/tools/builtin/realtime_search.py](src/jarvis/tools/builtin/realtime_search.py)) — **external Gemini model**, NOT Ollama. Used on the `webSearch` route only after Exa found nothing, and only when it can work: `oauth` with a Gemini CLI login present (`gemini_oauth_ready()`), or `apikey` with a key. While the broadcast is live the on-screen Chrome path goes first ([web_search.spec.md](src/jarvis/tools/builtin/web_search.spec.md)). Sub-mode is `cfg.gemini_auth` (env `GEMINI_AUTH`, default `oauth`):
|
||||
- `oauth` (default) `gemini_cli_search()` — shells out to the Gemini CLI (`gemini -p <query> -o json --skip-trust`, default approval mode) authenticated by the user's Google-account login (`GEMINI_API_KEY`/`GOOGLE_API_KEY` stripped from the child env, `GOOGLE_GENAI_USE_GCA=true` set to select OAuth); model is whatever the CLI/account defaults to. Uses the CLI's built-in web-search grounding. Bounded by a 30s subprocess timeout. The login lives in `~/.gemini`; in Docker that is the project-local `docker/gemini-oauth` bind mount (override `GEMINI_OAUTH_DIR`), which the operator seeds once. `gemini_oauth_ready()` checks `~/.gemini/oauth_creds.json`; without it the CLI is not started (it cost about 2 s per search for nothing, live 2026-11-18).
|
||||
- `apikey` `gemini_search()` — one REST `generateContent` call (`gemini_model`, default `gemini-2.0-flash`) with the `google_search` grounding tool; keyed by `GEMINI_API_KEY`.
|
||||
Both return the fenced UNTRUSTED-WEB-EXTRACT envelope consumed by the main loop (#1). Fail-open: CLI missing / login expired / quota 429 / timeout / errors / missing key all fall through to the DDG cascade. The `STREAM_BROWSER=true` route (`browser_search()`) makes NO LLM call — it drives Chrome and scrapes Google results.
|
||||
Both return the fenced UNTRUSTED-WEB-EXTRACT envelope consumed by the main loop (#1). Fail-open: CLI missing / login expired / quota 429 / timeout / errors / missing key all fall through to Brave (opt-in) and Wikipedia. The `STREAM_BROWSER=true` route (`browser_search()`) makes NO LLM call — it drives Chrome and scrapes Google results.
|
||||
|
||||
## 15. Voice call judgements (v2 voice worker)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user