Module: Legion::Extensions::Llm::AzureFoundry::Capabilities

Defined in:
lib/legion/extensions/llm/azure_foundry/provider.rb

Overview

Capability predicates inferred from catalog metadata and model naming. Naming is a hint only — it never overrides explicit catalog facts.

Class Method Summary collapse

Class Method Details

.chat?(model) ⇒ Boolean

Returns:

  • (Boolean)


18
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 18

def chat?(model) = !embeddings?(model)

.critical_capabilities_for(model) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 24

def critical_capabilities_for(model)
  [
    ('streaming' if streaming?(model)),
    ('function_calling' if functions?(model)),
    ('vision' if vision?(model)),
    ('embeddings' if embeddings?(model))
  ].compact
end

.embeddings?(model) ⇒ Boolean

Returns:

  • (Boolean)


22
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 22

def embeddings?(model) = model_id(model).match?(/embed/i)

.functions?(model) ⇒ Boolean

Returns:

  • (Boolean)


20
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 20

def functions?(model) = chat?(model)

.model_id(model) ⇒ Object



33
34
35
36
37
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 33

def model_id(model)
  return model.id.to_s if model.respond_to?(:id)

  model.to_s
end

.streaming?(model) ⇒ Boolean

Returns:

  • (Boolean)


19
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 19

def streaming?(model) = chat?(model)

.vision?(model) ⇒ Boolean

Returns:

  • (Boolean)


21
# File 'lib/legion/extensions/llm/azure_foundry/provider.rb', line 21

def vision?(model) = chat?(model) && model_id(model).match?(/(gpt-4|gpt-5|llava|vision|phi-3.5)/i)