39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/legion/llm/inventory.rb', line 39
def offerings(filters = {})
log.debug "[llm][inventory] action=offerings.enter filters=#{filters.keys}"
normalized_filters = normalize_filter_hash(filters)
list = []
providers_config.each do |provider_family, config|
next unless enabled_config?(config)
list.concat(provider_offerings(provider_family.to_sym, config))
end
list.concat(discovery_offerings)
list.concat(native_provider_offerings)
list = dedupe_offerings(list)
result = filter_offerings(list, normalized_filters)
log.debug "[llm][inventory] action=offerings.complete total=#{result.size}"
result
rescue NameError, ArgumentError, TypeError => e
handle_exception(e, level: :error, handled: false, operation: 'llm.inventory.offerings')
raise
rescue StandardError => e
handle_exception(e, level: :warn, handled: true, operation: 'llm.inventory.offerings')
[]
end
|