File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -66,17 +66,16 @@ def output_price_per_million
6666 pricing . text_tokens . output
6767 end
6868
69- def type # rubocop:disable Metrics/PerceivedComplexity
70- if modalities . output . include? ( 'embeddings' ) && !modalities . output . include? ( 'text' )
71- 'embedding'
72- elsif modalities . output . include? ( 'image' ) && !modalities . output . include? ( 'text' )
73- 'image'
74- elsif modalities . output . include? ( 'audio' ) && !modalities . output . include? ( 'text' )
75- 'audio'
76- elsif modalities . output . include? ( 'moderation' )
77- 'moderation'
78- else
79- 'chat'
69+ def type
70+ outputs = modalities . output
71+
72+ return 'moderation' if outputs . include? ( 'moderation' )
73+ return 'chat' if outputs . include? ( 'text' )
74+
75+ case outputs . first
76+ when 'embeddings' then 'embedding'
77+ when 'rerank' , 'image' , 'audio' then outputs . first
78+ else 'chat'
8079 end
8180 end
8281
Original file line number Diff line number Diff line change @@ -184,6 +184,11 @@ def embedding_models
184184 self . class . new ( all . select { |m | m . type == 'embedding' } )
185185 end
186186
187+ # Filter to only rerank models
188+ def rerank_models
189+ self . class . new ( all . select { |m | m . type == 'rerank' } )
190+ end
191+
187192 # Filter to only audio models
188193 def audio_models
189194 self . class . new ( all . select { |m | m . type == 'audio' } )
You can’t perform that action at this time.
0 commit comments