@@ -317,6 +317,7 @@ func (p *pipeline) handleInjectAction(ctx context.Context, recorder recording.Re
|
||||
RemoveFillerWords: llmCfg.RemoveFillerWords,
|
||||
CustomPrompt: llmCfg.CustomPrompt,
|
||||
Keywords: llmCfg.Keywords,
|
||||
BaseURL: llmCfg.BaseURL,
|
||||
})
|
||||
if err != nil {
|
||||
log.Printf("Pipeline: Failed to create LLM adapter: %v, using raw transcription", err)
|
||||
@@ -343,7 +344,10 @@ func (p *pipeline) handleInjectAction(ctx context.Context, recorder recording.Re
|
||||
}
|
||||
return r
|
||||
}, textToInject)
|
||||
|
||||
// Speech APIs occasionally include leading or trailing whitespace (for
|
||||
// example Whisper commonly returns a leading space). It is transport
|
||||
// formatting rather than dictated content, so never inject it.
|
||||
textToInject = strings.TrimSpace(textToInject)
|
||||
injector := p.injectorFactory(p.config.ToInjectionConfig())
|
||||
|
||||
if err := injector.Inject(ctx, textToInject); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user