Skip to content

feat: decisions(); refuse search on non-xAI models; route search to xai/*; fix Surf pointer - #115

Merged
VickyXAI merged 2 commits into
mainfrom
fix/search-routing-decisions-surf
Nov 15, 2026
Merged

VickyXAI merged 2 commits into
mainfrom
fix/search-routing-decisions-surf

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

Follow-ups from the README resync (#114).

decisions() on all four clients → POST /v1/decisions (OpenAI Decisions-compatible, gpt-6-luna), returning DecisionsResponse. Reuses _request_with_payment_raw (cost log, tx log; /v1/decisions is not in the cache allow-list, so never cached). build_decisions_body() raises ValueError on a malformed request before sending. Live on Solana exact: two questions, $0.001045. Mirrors TS @blockrun/llm #121.

Search guard. The gateway serves search on xai/* only (400 SEARCH_UNSUPPORTED otherwise), and the chat() / chat_completion() docstrings showed openai/gpt-5.2 + search=True. Now:

  • chat_completion / chat_completion_stream (sync + async, Base + Solana) raise ValueError for a search request on a non-xai/* model or fallback, before anything is sent.
  • smart_chat_completion(..., search=True) narrows the routed chain to xai/*; with none, it uses the catalog's search-tagged xAI models (cheapest first; premium: priciest first), like the TS SDK's routeWithCatalog. build_model_pricing() records them on a dict subclass, so no call site changes. Free profile + search raises.

Surf. The deprecation warning pointed at LLMClient.price (does not exist) → PriceClient, LLMClient.pm, LLMClient.defi / dex.

Docs. README Decisions section + search note, CHANGELOG, CLAUDE.md (no Pyth; tree), AGENTS.md (drops the long-retired free-model list).

Left alone on purpose: router_core/config.py's moonshot/kimi-k3 fallbacks match upstream router-core main (5 entries there too) and the gateway keeps kimi-k3 routable; the port is not hand-edited.

pytest unit 1604 passed (35 new), ruff clean, black clean, mypy unchanged from main (248 pre-existing).

1bcMax added 2 commits November 15, 2026 19:01
…ai/*; fix Surf pointer

- decisions() on LLMClient, AsyncLLMClient, SolanaLLMClient and
  AsyncSolanaLLMClient (POST /v1/decisions, OpenAI Decisions-compatible).
  Live: $0.001045 on Solana exact.
- search=True / search_parameters / x_search|web_search tools on a non-xai/*
  model (or fallback) raise ValueError before anything is sent; the gateway
  answered 400 SEARCH_UNSUPPORTED after the probe. Docstring examples fixed.
- smart_chat_completion(search=True) narrows the routed chain to xai/*, else
  the catalog's search-capable xAI models (cheapest; premium: priciest),
  mirroring the TS SDK. The free profile with search raises.
- SurfClient's warning named LLMClient.price, which does not exist.
- CLAUDE.md / AGENTS.md: no Pyth, no retired free-model list.
@VickyXAI
VickyXAI merged commit 2930cca into main Nov 15, 2026
6 checks passed
@VickyXAI
VickyXAI deleted the fix/search-routing-decisions-surf branch November 15, 2026 23:13
@VickyXAI VickyXAI mentioned this pull request Nov 16, 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