Skip to content

BotWire v0.2.0

Choose a tag to compare

@github-actions github-actions released this 12 Jun 21:32
64705d5

BotWire v0.2.0 — Production Hardening

The Phase 1.5 release: everything from v0.1.0 plus the guardrails, observability, and a framework-agnostic JavaScript SDK that make BotWire ready for real traffic. Still one-line integration, still bring-your-own-key.

New features

  • Five-dimension rate limiting — independently configurable, each disabled at 0:

    • MaxConcurrentSessions — queue and wait for a slot (never reject)
    • MaxMessagesPerMinute — per-session throttle that delays rather than errors
    • MaxMessagesPerSession — prompt the user to start a new conversation
    • MaxSessionsPerIpPerHour — reject new sessions over the cap
    • DailyTokenBudget — degraded response once the daily token budget is spent
    opts.RateLimiting = new RateLimitOptions { DailyTokenBudget = 500_000 };
  • Token accounting — real provider usage (TotalTokenCount, with a char-based estimate fallback) now flows through every turn, feeds the daily budget, and is recorded on message and escalated audit entries.

  • Audit log — opt-in NDJSON business/compliance trail (messages, guard blocks, escalations, rate-limit hits, errors), one file per session bucketed by UTC date. Write your own IAuditLogger to send events elsewhere.

    builder.Services.AddBotWire(opts => { /* ... */ }).AddJsonAuditLog("logs/audit");
  • Session summary compression — long conversations fold their oldest turns into a rolling LLM summary to cap token cost, while the full history is preserved for ticket generation.

  • Topic / off-topic classification — folded into the main answer JSON ({ offtopic, action, message }), no extra model call.

  • botwire-js npm package — framework-agnostic JS/TS client (chat, SSE streaming, session management, zero DOM deps). The embedded widget is now built on top of it.

  • Widget enhancements — conversation starters, a conversation-reset button, off-topic/blocked handling, and data-lang multilingual config.

  • Session self-heal — a stale session token is transparently rebuilt and the message resent once, invisible to the user.

Breaking changes

  • ILlmChatClient now reports token usage. ChatAsync returns LlmChatResult (text + tokens) instead of string, and ChatStreamingAsync takes an Action<int>? onUsage callback. Custom ILlmChatClient implementations must update their signatures. No change is needed if you use the built-in OpenAI client.

Notes

  • Rate-limit and token-budget counters are in-memory and per-process (they reset on restart). Durable, cross-instance budgeting (Redis) is planned for a later release.

Get started

dotnet add package BotWire.AspNetCore

See the README for the full quick start and configuration reference.

What's Changed

  • chore(deps): bump actions/setup-node from 4.4.0 to 6.4.0 by @dependabot[bot] in #17
  • chore(deps): bump actions/setup-dotnet from 4.3.1 to 5.3.0 by @dependabot[bot] in #16
  • chore(deps): bump actions/checkout from 4.3.1 to 6.0.3 by @dependabot[bot] in #15
  • Task 21: widget session self-healing on InvalidSession by @adamy in #22
  • Phase 1.5 — production hardening + 0.2.0 release by @adamy in #23

Full Changelog: v0.1.0...v0.2.0