@@ -132,7 +132,7 @@ export class SpeechService extends Context.Service<
132132 SpeechService ,
133133 {
134134 readonly status : Effect . Effect < EnvironmentSpeechStatus , SpeechError > ;
135- readonly models : Effect . Effect < SpeechModels , SpeechError > ;
135+ readonly models : ( includeBenchmarks : boolean ) => Effect . Effect < SpeechModels , SpeechError > ;
136136 readonly downloadModel : ( modelId : string ) => Effect . Effect < SpeechModels , SpeechError > ;
137137 readonly selectModel : ( modelId : string ) => Effect . Effect < SpeechModels , SpeechError > ;
138138 readonly cancelDownload : ( modelId : string ) => Effect . Effect < SpeechModels , SpeechError > ;
@@ -469,6 +469,7 @@ const make = Effect.gen(function* () {
469469
470470 const listModels = Effect . fn ( "SpeechService.listModels" ) ( function * (
471471 settings : SettingsSnapshot ,
472+ includeBenchmarks : boolean ,
472473 ) : Effect . fn . Return < SpeechModels > {
473474 const selected = selectedModel ( settings ) ;
474475 const models = yield * Effect . forEach (
@@ -485,6 +486,7 @@ const make = Effect.gen(function* () {
485486 languages : definition . languages ,
486487 accuracy : definition . accuracy ,
487488 speed : definition . speed ,
489+ ...( includeBenchmarks ? { benchmark : definition . benchmark } : { } ) ,
488490 recommended : definition . recommended ,
489491 supportsStreaming : definition . supportsStreaming ,
490492 supportsLanguageDetection : definition . supportsLanguageDetection ,
@@ -508,7 +510,11 @@ const make = Effect.gen(function* () {
508510
509511 const freshStatus = ( operation : string ) =>
510512 readSettings ( operation ) . pipe ( Effect . flatMap ( currentStatus ) ) ;
511- const modelsEffect = readSettings ( "model listing" ) . pipe ( Effect . flatMap ( listModels ) ) ;
513+ const readModels = ( includeBenchmarks : boolean ) =>
514+ readSettings ( "model listing" ) . pipe (
515+ Effect . flatMap ( ( settings ) => listModels ( settings , includeBenchmarks ) ) ,
516+ ) ;
517+ const modelsEffect = readModels ( false ) ;
512518
513519 const requireSupported = Effect . suspend ( ( ) =>
514520 unsupportedReason
@@ -857,7 +863,7 @@ const make = Effect.gen(function* () {
857863
858864 return SpeechService . of ( {
859865 status : freshStatus ( "status" ) ,
860- models : modelsEffect ,
866+ models : readModels ,
861867 prepareModel,
862868 transcribe,
863869 startStream : Effect . fn ( "SpeechService.startStream" ) ( function * ( options ) {
0 commit comments