refactor(server): migrate herolib_ai → hero_aibroker_sdk #125

Merged
timur merged 1 commit from development_aibroker_sdk_migration into development 2026-05-12 15:59:55 +00:00
Owner

Summary

First consumer migration for hero_aibroker#63. Drops herolib_ai from hero_books_server in favour of hero_aibroker_sdk. Nothing in the workspace depends on herolib_ai anymore.

Call sites (4)

  • web/mcp.rs::handle_ask_librarian — Ask the Librarian summary
  • web/axum_server.rs::handler_api_ai_summary_getGET /api/ai-summary
  • web/axum_server.rs::handler_api_ai_summaryPOST /api/ai-summary
  • web/axum_server.rs::handler_api_transcribe — STT + cleanup chat

Shape

Connect via AIBrokerAdminAPIClient::connect_default(), then call client.ai_chat() / client.ai_transcribe() through a small broker_chat() helper. Once hero_aibroker#70 (PromptBuilder + models constants) merges, the helper can be replaced by client.prompt(MODEL).user(p).execute_content().await — that's a one-line follow-up.

Model mapping

Before After Notes
Model::new("groq-strong") "llama-3.3-70b" Closest broker alias — same Llama 3.3 70B on Groq
Model::new("groq/whisper-large-v3-turbo") "whisper" Broker's STT alias

Other changes

  • hero_books_server/Cargo.toml: herolib_aihero_aibroker_sdk
  • Workspace + hero_books_lib stale comments updated
  • Transcription audio is base64-encoded before sending (broker SDK takes audio_base64)

Test plan

  • cargo build --workspace — clean
  • Live test against a running broker — Ask the Librarian + /api/ai-summary + voice transcribe

🤖 Generated with Claude Code

## Summary First consumer migration for [hero_aibroker#63](https://forge.ourworld.tf/lhumina_code/hero_aibroker/issues/63). Drops `herolib_ai` from `hero_books_server` in favour of `hero_aibroker_sdk`. Nothing in the workspace depends on `herolib_ai` anymore. ### Call sites (4) - `web/mcp.rs::handle_ask_librarian` — Ask the Librarian summary - `web/axum_server.rs::handler_api_ai_summary_get` — `GET /api/ai-summary` - `web/axum_server.rs::handler_api_ai_summary` — `POST /api/ai-summary` - `web/axum_server.rs::handler_api_transcribe` — STT + cleanup chat ### Shape Connect via `AIBrokerAdminAPIClient::connect_default()`, then call `client.ai_chat()` / `client.ai_transcribe()` through a small `broker_chat()` helper. Once [hero_aibroker#70](https://forge.ourworld.tf/lhumina_code/hero_aibroker/pulls/70) (PromptBuilder + models constants) merges, the helper can be replaced by `client.prompt(MODEL).user(p).execute_content().await` — that's a one-line follow-up. ### Model mapping | Before | After | Notes | |---|---|---| | `Model::new("groq-strong")` | `"llama-3.3-70b"` | Closest broker alias — same Llama 3.3 70B on Groq | | `Model::new("groq/whisper-large-v3-turbo")` | `"whisper"` | Broker's STT alias | ### Other changes - `hero_books_server/Cargo.toml`: `herolib_ai` → `hero_aibroker_sdk` - Workspace + `hero_books_lib` stale comments updated - Transcription audio is base64-encoded before sending (broker SDK takes `audio_base64`) ## Test plan - [x] `cargo build --workspace` — clean - [ ] Live test against a running broker — Ask the Librarian + `/api/ai-summary` + voice transcribe 🤖 Generated with [Claude Code](https://claude.com/claude-code)
refactor(server): migrate herolib_ai → hero_aibroker_sdk
Some checks failed
Test / test (pull_request) Failing after 8s
Test / integration (pull_request) Has been skipped
399573b504
First consumer migration for hero_aibroker#63. Drops the herolib_ai
dependency from hero_books_server in favour of the broker SDK; nothing
in the workspace depends on herolib_ai anymore.

Call sites (4):

- web/mcp.rs::handle_ask_librarian — Ask the Librarian summary
- web/axum_server.rs::handler_api_ai_summary_get — GET /api/ai-summary
- web/axum_server.rs::handler_api_ai_summary — POST /api/ai-summary
- web/axum_server.rs::handler_api_transcribe — STT + cleanup chat

Shape: connect via AIBrokerAdminAPIClient::connect_default(), then call
client.ai_chat() / client.ai_transcribe() through a small broker_chat()
helper. Once hero_aibroker#70 (PromptBuilder + models constants) merges,
the helper can be replaced by client.prompt(MODEL).user(p).execute_content().

Other changes:

- hero_books_server/Cargo.toml: herolib_ai → hero_aibroker_sdk
- Workspace + hero_books_lib stale comments updated
- Transcription audio is now base64-encoded before sending (the SDK
  takes audio_base64; the broker decodes on the server side)
- Chat model is now "llama-3.3-70b" (the closest modelsconfig.yml alias
  to the previous "groq-strong" — Groq backend, same Llama 3.3 70B)
- STT model is "whisper" (broker's alias for groq/whisper-large-v3-turbo)

Cargo build --workspace: clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
timur merged commit 4d009e4872 into development 2026-05-12 15:59:55 +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!125
No description provided.