Skip to content

Direct beam_search / greedy field accessors on Params #18

@uqio

Description

@uqio

Tracked under #6.

Scope

Today the sampling strategy is set at Params::new(SamplingStrategy::BeamSearch { beam_size, patience }) or Greedy { best_of } time. Direct access to whisper_full_params::beam_search.beam_size / patience and greedy.best_of post-construction isn't exposed.

Symbols

  • whisper_full_params::beam_search.beam_size, beam_search.patience.
  • whisper_full_params::greedy.best_of.

Why deferred

The current API channels everything through SamplingStrategy at construction, which is the idiomatic Rust shape (an enum with associated data) and matches how the wrapper validates the values (clamps beam_size / best_of to [1, MAX_BEAM_SIZE]). Direct field setters bypass that validation channel and create a "what gets validated where" question.

If a caller needs to mutate the strategy mid-config (e.g. retry with reduced beam size on failure), the cleanest answer is to call Params::new again rather than mutate fields.

Acceptance

Open design questions:

  1. Mutable setters that re-run the same clamping logic as Params::new? (set_beam_size, set_patience, set_best_of).
  2. A single set_strategy(SamplingStrategy) that re-applies the construction-time setup? (More ergonomic, less granular.)
  3. Just leave it — recommend reconstruction.

Smallest scope. Likely a quick PR if a caller materialises with a real need.

If you're hitting this, drop a comment with the scenario.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions