refactor(server): adopt per-domain SDK clients (depends on aibroker#131) #128

Merged
timur merged 2 commits from development_sdk_127_per_domain into development 2026-05-13 08:59:40 +00:00
Owner

Summary

Adopts the per-domain SDK shape introduced in hero_aibroker#131. Replaces hero_books_server's AIBrokerAdminAPIClient::connect_default() calls (which would fail at runtime against the Phase-9 broker — the legacy unified rpc.sock is gone) with the new typed per-domain clients.

What changed

Surface Before After
Ask the Librarian (mcp.rs) AIBrokerAdminAPIClient::connect_default()client.ai_chat(AiChatInput {...}) chat::Client::connect_default()client.prompt(model).user(p).execute_content()
GET /api/ai-summary (axum_server.rs) same chat::Client
POST /api/ai-summary (axum_server.rs) same chat::Client
POST /api/transcribe (axum_server.rs) client.ai_transcribe(...) → same client for cleanup chat speech::Client for transcribe + separate chat::Client for cleanup

broker_chat() is now a thin wrapper around client.prompt(...).user(p).execute_content().await.

Model alias

Default model reverts from "llama-3.3-70b" (PR #125's naming) to "groq-strong" — the actual alias on the running broker's modelsconfig.yml. The SDK's model_aliases::LLAMA_3_3_70B = "llama-3.3-70b" constant reflects an updated catalog naming that isn't yet on the running broker; switching to it requires the catalog update first.

Dep pin (temporary)

hero_aibroker_sdk is pinned to branch development_sdk_127_per_domain until #131 merges to development. Once #131 lands, I'll push a follow-up commit here that switches the branch back to "development".

Test plan

  • cargo build --workspace — clean
  • Live test against rebuilt broker once #131 + this PR are deployed (depends on per-domain socket layout being live)

🤖 Generated with Claude Code

## Summary Adopts the per-domain SDK shape introduced in [hero_aibroker#131](https://forge.ourworld.tf/lhumina_code/hero_aibroker/pulls/131). Replaces hero_books_server's `AIBrokerAdminAPIClient::connect_default()` calls (which would fail at runtime against the Phase-9 broker — the legacy unified `rpc.sock` is gone) with the new typed per-domain clients. ### What changed | Surface | Before | After | |---|---|---| | Ask the Librarian (`mcp.rs`) | `AIBrokerAdminAPIClient::connect_default()` → `client.ai_chat(AiChatInput {...})` | `chat::Client::connect_default()` → `client.prompt(model).user(p).execute_content()` | | `GET /api/ai-summary` (`axum_server.rs`) | same | `chat::Client` | | `POST /api/ai-summary` (`axum_server.rs`) | same | `chat::Client` | | `POST /api/transcribe` (`axum_server.rs`) | `client.ai_transcribe(...)` → same client for cleanup chat | `speech::Client` for transcribe + separate `chat::Client` for cleanup | `broker_chat()` is now a thin wrapper around `client.prompt(...).user(p).execute_content().await`. ### Model alias Default model reverts from `"llama-3.3-70b"` (PR #125's naming) to `"groq-strong"` — the actual alias on the running broker's `modelsconfig.yml`. The SDK's `model_aliases::LLAMA_3_3_70B = "llama-3.3-70b"` constant reflects an updated catalog naming that isn't yet on the running broker; switching to it requires the catalog update first. ### Dep pin (temporary) `hero_aibroker_sdk` is pinned to branch `development_sdk_127_per_domain` until [#131](https://forge.ourworld.tf/lhumina_code/hero_aibroker/pulls/131) merges to development. Once #131 lands, I'll push a follow-up commit here that switches the branch back to `"development"`. ## Test plan - [x] `cargo build --workspace` — clean - [ ] Live test against rebuilt broker once #131 + this PR are deployed (depends on per-domain socket layout being live) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
refactor(server): adopt per-domain SDK clients (#127)
All checks were successful
Test / test (pull_request) Successful in 7m30s
Test / integration (pull_request) Successful in 4m32s
48d36876ef
Updates hero_books_server's broker calls to match the new per-domain
SDK shape introduced in hero_aibroker#131:

- Chat (Ask the Librarian + /api/ai-summary GET/POST + transcribe
  cleanup) now goes through hero_aibroker_sdk::chat::Client, bound to
  $HERO_SOCKET_DIR/hero_aibroker/chat/rpc.sock.
- Transcription goes through hero_aibroker_sdk::speech::Client on
  speech/rpc.sock.
- broker_chat() switches to client.prompt(model).user(p).execute_content()
  now that PromptBuilder is wired against chat::Client.
- Default chat model alias reverts to "groq-strong" (Llama 3.3 70B on
  Groq) — the broker's actual modelsconfig.yml uses that name. The
  "llama-3.3-70b" naming on the SDK constant module reflects an updated
  catalog that isn't yet on the running broker.

The SDK dep is temporarily pinned to development_sdk_127_per_domain
until hero_aibroker#131 merges to development. A follow-up commit will
repoint back to branch = "development".

cargo build --workspace clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore: repoint hero_aibroker_sdk dep to development branch
All checks were successful
Test / test (pull_request) Successful in 7m27s
Test / integration (pull_request) Successful in 5m6s
cf0cd7b55d
aibroker#131 has merged; switching back from the temporary
development_sdk_127_per_domain pin to the canonical branch = "development".

cargo build --workspace clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
timur merged commit 67e9083adf into development 2026-05-13 08:59:40 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_books!128
No description provided.