Skip to content

Initial_prompt easily accessible#283

Closed
Spudra wants to merge 3 commits into
collabora:mainfrom
Spudra:main
Closed

Initial_prompt easily accessible#283
Spudra wants to merge 3 commits into
collabora:mainfrom
Spudra:main

Conversation

@Spudra

@Spudra Spudra commented Oct 9, 2024

Copy link
Copy Markdown

Made initial_prompt more easily accessible to be able to give context.
Fixed how the options.get is used.
Client now contains a parameter, which is now also described in the readme.
Only tested with faster_whisper, not TensorRT.

Made initial_prompt more easily accessible to be able to give context
@Spudra

Spudra commented Oct 9, 2024

Copy link
Copy Markdown
Author

I do notice that the initial_context does not always work well. In my testing the first word was not really used, but that can be fixed by just putting another word at the front when using it.

@makaveli10

Copy link
Copy Markdown
Collaborator

@Spudra can we fix the tests according to the new param options?

@Spudra

Spudra commented Nov 5, 2024

Copy link
Copy Markdown
Author

@Spudra can we fix the tests according to the new param options?

Sure you can! (:
I also just fixed the conflict that appeared recently.

@makaveli10

Copy link
Copy Markdown
Collaborator

@Spudra I see the tests are still failing, would you mind updating the tests?

@boxerab

boxerab commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this @Spudra — the goal of exposing initial_prompt is a good one. I opened #518 as an alternative that achieves the same thing with a couple of fixes:

  • The options dict has a default-path crash. The client defaults options=None, so the handshake sends "options": None, and the server's options["options"].get("initial_prompt") becomes None.get(...)AttributeError. This breaks the faster_whisper backend unless a caller explicitly passes an options dict.
  • Consistency. Every other client setting (hotwords, send_last_n_segments, target_language, …) is a flat named parameter rather than a nested bag.

#518 instead adds initial_prompt / vad_parameters as flat client params and reads them server-side with null-safe options.get(...). Suggest closing this in favor of #518 — happy to fold in any feedback.

boxerab pushed a commit to boxerab/WhisperLive that referenced this pull request Jun 26, 2026
Expose initial_prompt and vad_parameters as flat client parameters
(consistent with hotwords, send_last_n_segments, etc.), send them as
flat handshake keys, and read them server-side with null-safe
options.get(...). Supersedes collabora#283; avoids the options-bag None.get crash.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
boxerab pushed a commit that referenced this pull request Jun 26, 2026
Expose initial_prompt and vad_parameters as flat client parameters
(consistent with hotwords, send_last_n_segments, etc.), send them as
flat handshake keys, and read them server-side with null-safe
options.get(...). Supersedes #283; avoids the options-bag None.get crash.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@boxerab

boxerab commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Thank again for the PR. It has been superseded by #518 - closing.

@boxerab boxerab closed this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants