Skip to content

Make web search and weather provider-agnostic (drop hard Bing/OpenWeather dependency)#8

Closed
Averroeskw wants to merge 2 commits into
MaxMaeder:masterfrom
Averroeskw:feat/provider-abstraction
Closed

Make web search and weather provider-agnostic (drop hard Bing/OpenWeather dependency)#8
Averroeskw wants to merge 2 commits into
MaxMaeder:masterfrom
Averroeskw:feat/provider-abstraction

Conversation

@Averroeskw

Copy link
Copy Markdown

Why

Two built-in tools currently hard-fail on defaults that are no longer freely available:

A stale/absent third-party key silently bricks the corresponding assistant tool.

What

Both services are now provider-selectable, with keyless / self-hostable options as defaults so the Pin keeps working with zero paid keys.

Search (server/src/services/search.ts)

  • SEARCH_PROVIDER = searxng | brave | bing
  • Auto-detects the first configured provider if unset (SearXNG → Brave → Bing)
  • searxng needs only a self-hosted URL (no key); brave uses BRAVE_KEY; bing unchanged
  • Return shape { title, snippet }[] is unchanged — no handler changes needed

Weather (server/src/services/weather.ts)

  • WEATHER_PROVIDER = open-meteo (keyless, new default) | openweather (legacy)
  • WMO weather codes are mapped onto the existing ConditionName set
  • Return shape is unchanged

server/.env.template documents the new variables.

Compatibility

  • Existing Bing/OpenWeather deployments keep working — set SEARCH_PROVIDER=bing / WEATHER_PROVIDER=openweather (or just keep the keys; auto-detect prefers them where relevant).
  • No changes to tool definitions, sockets, or the client.
  • tsc --noEmit passes for the changed files (pre-existing keys/firebaseKey template errors are unrelated).

Implements the intent of #5, and directly addresses #2 and #6.

Bing Web Search is retired (new Azure keys can't be created) and OpenWeather
One Call 3.0 now requires a paid key, so both services hard-fail on the
provider defaults. This makes each pluggable and adds keyless/self-hostable
options so a dead third-party key never bricks a tool.

Search (services/search.ts): SEARCH_PROVIDER selects searxng | brave | bing.
Auto-detects the first configured provider (SearXNG > Brave > Bing). Return
shape ({title, snippet}[]) is unchanged. Implements the intent of MaxMaeder#5 and MaxMaeder#2.

Weather (services/weather.ts): WEATHER_PROVIDER selects open-meteo (keyless,
new default) | openweather (legacy). WMO codes are mapped onto the existing
ConditionName set; return shape is unchanged. Addresses MaxMaeder#6.

.env.template documents the new variables. No behavior change for existing
Bing/OpenWeather deployments that set the provider explicitly.
… unknown values, add request timeouts, guard empty OWM conditions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Averroeskw

Copy link
Copy Markdown
Author

Closing for now — pulling this back until I've verified the full stack end-to-end on the physical device (interposer inbound). Will reopen once it's hardware-verified. The branch lives on in my fork history if anyone needs the diff in the meantime.

@Averroeskw Averroeskw closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant