fix(cmd): every local engine call carries its own deadline (review F4)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -108,7 +108,12 @@ func buildTranscriber(cfg config.Config) uploads.Transcriber {
|
|||||||
// No overall client timeout: a 90 minute recording takes minutes. The deadline is
|
// No overall client timeout: a 90 minute recording takes minutes. The deadline is
|
||||||
// the worker's per-job context.
|
// the worker's per-job context.
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
primary := transcribe.NewGateway(cfg.GatewayURL, cfg.GatewayKey, cfg.TranscribeModel, client)
|
// Each LOCAL engine call gets its own deadline: a wedged engine does not answer, and
|
||||||
|
// without one it used the whole job before the fallback could run.
|
||||||
|
local := func(model string) transcribe.Backend {
|
||||||
|
return transcribe.WithTimeout(transcribe.NewGateway(cfg.GatewayURL, cfg.GatewayKey, model, client), cfg.TranscribeEngineTimeout)
|
||||||
|
}
|
||||||
|
primary := local(cfg.TranscribeModel)
|
||||||
var fallback transcribe.Backend
|
var fallback transcribe.Backend
|
||||||
if cfg.TranscribeFallbackModel != "" && cfg.TranscribeFallbackModel != cfg.TranscribeModel {
|
if cfg.TranscribeFallbackModel != "" && cfg.TranscribeFallbackModel != cfg.TranscribeModel {
|
||||||
fallback = transcribe.NewGateway(cfg.GatewayURL, cfg.GatewayKey, cfg.TranscribeFallbackModel, client)
|
fallback = transcribe.NewGateway(cfg.GatewayURL, cfg.GatewayKey, cfg.TranscribeFallbackModel, client)
|
||||||
@@ -117,7 +122,7 @@ func buildTranscriber(cfg config.Config) uploads.Transcriber {
|
|||||||
return transcribe.NewChain(primary, fallback)
|
return transcribe.NewChain(primary, fallback)
|
||||||
}
|
}
|
||||||
|
|
||||||
base := transcribe.NewGateway(cfg.GatewayURL, cfg.GatewayKey, cfg.ReconcileBaseModel, client)
|
base := local(cfg.ReconcileBaseModel)
|
||||||
// Temperature 0 and a short reply: the adjudicator's accuracy was measured that way.
|
// Temperature 0 and a short reply: the adjudicator's accuracy was measured that way.
|
||||||
chat := llm.New(cfg.GatewayURL, cfg.GatewayKey, cfg.ReconcileModel, adjudicatorTimeout,
|
chat := llm.New(cfg.GatewayURL, cfg.GatewayKey, cfg.ReconcileModel, adjudicatorTimeout,
|
||||||
llm.WithTemperature(0), llm.WithMaxTokens(200))
|
llm.WithTemperature(0), llm.WithMaxTokens(200))
|
||||||
|
|||||||
Reference in New Issue
Block a user