12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/ruby_llm/providers/ollama/models.rb', line 12
def parse_list_models_response(response, slug, _capabilities)
data = response.body['data'] || []
data.map do |model|
Model::Info.new(
id: model['id'],
name: model['id'],
provider: slug,
family: 'ollama',
created_at: model['created'] ? Time.at(model['created']) : nil,
modalities: {
input: %w[text image],
output: %w[text]
},
capabilities: %w[streaming function_calling structured_output vision],
pricing: {},
metadata: {
owned_by: model['owned_by']
}
)
end
end
|