Skip to content

stt(): add source axis (api vs in-process package) - #12

Merged
TroyHernandez merged 1 commit into
mainfrom
source-axis
Jun 17, 2026
Merged

stt(): add source axis (api vs in-process package)#12
TroyHernandez merged 1 commit into
mainfrom
source-axis

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Mirrors tts.api's split of which engine (backend) from where it runs (source), so the pipeline can point STT at a self-hosted whisper::serve() endpoint cleanly.

  • stt() gains source = c("auto", "api", "package"). Default "auto" reproduces the previous behavior (whisper in-process, openai via the API), so existing calls are unchanged (stt.api is on CRAN).
  • backend = "whisper", source = "api" routes to .via_api (HTTP) — i.e. a whisper serve() endpoint set via set_stt_base() — instead of having to borrow backend = "openai".
  • New .resolve_route(backend, source) returns list(backend, route) where route is "package" or "api"; replaces .choose_backend. Availability checks preserved (whisper installed for package; base URL set for api).
  • Tests added for the resolution logic (6 cases). Full suite: 34 OK.

Version 0.2.1.1 -> 0.2.1.2.

stt() gains a source argument ('auto','api','package') that splits which
engine from where it runs, like tts.api. Default 'auto' reproduces the
previous behavior (whisper in-process, openai via API), so existing calls
are unchanged. backend='whisper', source='api' now reaches a self-hosted
whisper serve() endpoint (set the URL with set_stt_base()) instead of
having to borrow backend='openai'. Adds .resolve_route() and tests; bumps
to 0.2.1.2.
@TroyHernandez
TroyHernandez merged commit 6ef473d into main Jun 17, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the source-axis branch June 17, 2026 22:05
TroyHernandez added a commit that referenced this pull request Jun 19, 2026
…route

#13 added result$words but the public return docs omitted it; #12 left
result$backend ambiguous (it reports the execution route, not the engine).
Document both in stt() Rd and README; the resolved backend/source pair
lives in the call_record attribute.
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