ruby_llm 0.1.0.pre36 → 0.1.0.pre38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/docs.yml +53 -0
- data/.rspec_status +36 -33
- data/.rubocop.yml +7 -2
- data/.yardopts +12 -0
- data/Gemfile +27 -0
- data/bin/console +4 -4
- data/docs/.gitignore +7 -0
- data/docs/Gemfile +11 -0
- data/docs/_config.yml +43 -0
- data/docs/_data/navigation.yml +25 -0
- data/docs/guides/chat.md +206 -0
- data/docs/guides/embeddings.md +325 -0
- data/docs/guides/error-handling.md +301 -0
- data/docs/guides/getting-started.md +164 -0
- data/docs/guides/image-generation.md +274 -0
- data/docs/guides/index.md +45 -0
- data/docs/guides/rails.md +401 -0
- data/docs/guides/streaming.md +242 -0
- data/docs/guides/tools.md +247 -0
- data/docs/index.md +73 -0
- data/docs/installation.md +98 -0
- data/lib/ruby_llm/active_record/acts_as.rb +2 -2
- data/lib/ruby_llm/chat.rb +7 -7
- data/lib/ruby_llm/models.json +11 -125
- data/lib/ruby_llm/providers/anthropic/capabilities.rb +1 -2
- data/lib/ruby_llm/providers/anthropic/chat.rb +2 -3
- data/lib/ruby_llm/providers/deepseek/capabilities.rb +2 -3
- data/lib/ruby_llm/providers/gemini/capabilities.rb +1 -1
- data/lib/ruby_llm/providers/openai/capabilities.rb +8 -14
- data/lib/ruby_llm/providers/openai/embeddings.rb +1 -1
- data/lib/ruby_llm/version.rb +1 -1
- data/lib/tasks/models.rake +2 -2
- data/ruby_llm.gemspec +10 -32
- metadata +22 -296
@@ -0,0 +1,247 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
title: Tools
|
4
|
+
parent: Guides
|
5
|
+
nav_order: 3
|
6
|
+
permalink: /guides/tools
|
7
|
+
---
|
8
|
+
|
9
|
+
# Using Tools with RubyLLM
|
10
|
+
|
11
|
+
Tools allow AI models to call your Ruby code to perform actions or retrieve information. This guide explains how to create and use tools with RubyLLM.
|
12
|
+
|
13
|
+
## What Are Tools?
|
14
|
+
|
15
|
+
Tools (also known as "functions" or "plugins") let AI models:
|
16
|
+
|
17
|
+
1. Recognize when external functionality is needed
|
18
|
+
2. Call your Ruby code with appropriate parameters
|
19
|
+
3. Use the results to enhance their responses
|
20
|
+
|
21
|
+
Common use cases include:
|
22
|
+
- Retrieving real-time data
|
23
|
+
- Performing calculations
|
24
|
+
- Accessing databases
|
25
|
+
- Controlling external systems
|
26
|
+
|
27
|
+
## Creating a Tool
|
28
|
+
|
29
|
+
Tools are defined as Ruby classes that inherit from `RubyLLM::Tool`:
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
class Calculator < RubyLLM::Tool
|
33
|
+
description "Performs arithmetic calculations"
|
34
|
+
|
35
|
+
param :expression,
|
36
|
+
type: :string,
|
37
|
+
desc: "A mathematical expression to evaluate (e.g. '2 + 2')"
|
38
|
+
|
39
|
+
def execute(expression:)
|
40
|
+
eval(expression).to_s
|
41
|
+
rescue StandardError => e
|
42
|
+
"Error: #{e.message}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
### Tool Components
|
48
|
+
|
49
|
+
Each tool has these key elements:
|
50
|
+
|
51
|
+
1. **Description** - Explains what the tool does, helping the AI decide when to use it
|
52
|
+
2. **Parameters** - Define the inputs the tool expects
|
53
|
+
3. **Execute Method** - The code that runs when the tool is called
|
54
|
+
|
55
|
+
### Parameter Definition
|
56
|
+
|
57
|
+
Parameters accept several options:
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
param :parameter_name,
|
61
|
+
type: :string, # Data type (:string, :integer, :boolean, :array, :object)
|
62
|
+
desc: "Description", # Description of what the parameter does
|
63
|
+
required: true # Whether the parameter is required (default: true)
|
64
|
+
```
|
65
|
+
|
66
|
+
## Using Tools in Chat
|
67
|
+
|
68
|
+
To use a tool, attach it to a chat:
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
# Create the chat
|
72
|
+
chat = RubyLLM.chat
|
73
|
+
|
74
|
+
# Add a tool
|
75
|
+
chat.with_tool(Calculator)
|
76
|
+
|
77
|
+
# Now you can ask questions that might require calculation
|
78
|
+
response = chat.ask "What's 123 * 456?"
|
79
|
+
# => "Let me calculate that for you. 123 * 456 = 56088."
|
80
|
+
```
|
81
|
+
|
82
|
+
### Multiple Tools
|
83
|
+
|
84
|
+
You can provide multiple tools to a single chat:
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
class Weather < RubyLLM::Tool
|
88
|
+
description "Gets current weather for a location"
|
89
|
+
|
90
|
+
param :location,
|
91
|
+
desc: "City name or zip code"
|
92
|
+
|
93
|
+
def execute(location:)
|
94
|
+
# Simulate weather lookup
|
95
|
+
"72°F and sunny in #{location}"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Add multiple tools
|
100
|
+
chat = RubyLLM.chat
|
101
|
+
.with_tools(Calculator, Weather)
|
102
|
+
|
103
|
+
# Ask questions that might use either tool
|
104
|
+
chat.ask "What's the temperature in New York City?"
|
105
|
+
chat.ask "If it's 72°F in NYC and 54°F in Boston, what's the average?"
|
106
|
+
```
|
107
|
+
|
108
|
+
## Custom Initialization
|
109
|
+
|
110
|
+
Tools can have custom initialization:
|
111
|
+
|
112
|
+
```ruby
|
113
|
+
class DocumentSearch < RubyLLM::Tool
|
114
|
+
description "Searches documents by relevance"
|
115
|
+
|
116
|
+
param :query,
|
117
|
+
desc: "The search query"
|
118
|
+
|
119
|
+
param :limit,
|
120
|
+
type: :integer,
|
121
|
+
desc: "Maximum number of results",
|
122
|
+
required: false
|
123
|
+
|
124
|
+
def initialize(database)
|
125
|
+
@database = database
|
126
|
+
end
|
127
|
+
|
128
|
+
def execute(query:, limit: 5)
|
129
|
+
# Search in @database
|
130
|
+
@database.search(query, limit: limit)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# Initialize with dependencies
|
135
|
+
search_tool = DocumentSearch.new(MyDatabase)
|
136
|
+
chat.with_tool(search_tool)
|
137
|
+
```
|
138
|
+
|
139
|
+
## The Tool Execution Flow
|
140
|
+
|
141
|
+
Here's what happens when a tool is used:
|
142
|
+
|
143
|
+
1. You ask a question
|
144
|
+
2. The model decides a tool is needed
|
145
|
+
3. The model selects the tool and provides arguments
|
146
|
+
4. RubyLLM calls your tool's `execute` method
|
147
|
+
5. The result is sent back to the model
|
148
|
+
6. The model incorporates the result into its response
|
149
|
+
|
150
|
+
For example:
|
151
|
+
|
152
|
+
```ruby
|
153
|
+
response = chat.ask "What's 123 squared plus 456?"
|
154
|
+
|
155
|
+
# Behind the scenes:
|
156
|
+
# 1. Model decides it needs to calculate
|
157
|
+
# 2. Model calls Calculator with expression: "123 * 123 + 456"
|
158
|
+
# 3. Tool returns "15,585"
|
159
|
+
# 4. Model incorporates this in its response
|
160
|
+
```
|
161
|
+
|
162
|
+
## Debugging Tools
|
163
|
+
|
164
|
+
Enable debugging to see tool calls in action:
|
165
|
+
|
166
|
+
```ruby
|
167
|
+
# Enable debug logging
|
168
|
+
ENV['RUBY_LLM_DEBUG'] = 'true'
|
169
|
+
|
170
|
+
# Make a request
|
171
|
+
chat.ask "What's 15329 divided by 437?"
|
172
|
+
|
173
|
+
# Console output:
|
174
|
+
# D, -- RubyLLM: Tool calculator called with: {"expression"=>"15329 / 437"}
|
175
|
+
# D, -- RubyLLM: Tool calculator returned: "35.078719"
|
176
|
+
```
|
177
|
+
|
178
|
+
## Error Handling
|
179
|
+
|
180
|
+
Tools can handle errors gracefully:
|
181
|
+
|
182
|
+
```ruby
|
183
|
+
class Calculator < RubyLLM::Tool
|
184
|
+
description "Performs arithmetic calculations"
|
185
|
+
|
186
|
+
param :expression,
|
187
|
+
type: :string,
|
188
|
+
desc: "Math expression to evaluate"
|
189
|
+
|
190
|
+
def execute(expression:)
|
191
|
+
eval(expression).to_s
|
192
|
+
rescue StandardError => e
|
193
|
+
# Return error as a result
|
194
|
+
{ error: "Error calculating #{expression}: #{e.message}" }
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# When there's an error, the model will receive and explain it
|
199
|
+
chat.ask "What's 1/0?"
|
200
|
+
# => "I tried to calculate 1/0, but there was an error: divided by 0"
|
201
|
+
```
|
202
|
+
|
203
|
+
## Advanced Tool Parameters
|
204
|
+
|
205
|
+
Tools can have complex parameter types:
|
206
|
+
|
207
|
+
```ruby
|
208
|
+
class DataAnalysis < RubyLLM::Tool
|
209
|
+
description "Analyzes numerical data"
|
210
|
+
|
211
|
+
param :data,
|
212
|
+
type: :array,
|
213
|
+
desc: "Array of numbers to analyze"
|
214
|
+
|
215
|
+
param :operations,
|
216
|
+
type: :object,
|
217
|
+
desc: "Analysis operations to perform",
|
218
|
+
required: false
|
219
|
+
|
220
|
+
def execute(data:, operations: {mean: true, median: false})
|
221
|
+
result = {}
|
222
|
+
|
223
|
+
result[:mean] = data.sum.to_f / data.size if operations[:mean]
|
224
|
+
result[:median] = calculate_median(data) if operations[:median]
|
225
|
+
|
226
|
+
result
|
227
|
+
end
|
228
|
+
|
229
|
+
private
|
230
|
+
|
231
|
+
def calculate_median(data)
|
232
|
+
sorted = data.sort
|
233
|
+
mid = sorted.size / 2
|
234
|
+
sorted.size.odd? ? sorted[mid] : (sorted[mid-1] + sorted[mid]) / 2.0
|
235
|
+
end
|
236
|
+
end
|
237
|
+
```
|
238
|
+
|
239
|
+
## When to Use Tools
|
240
|
+
|
241
|
+
Tools are best for:
|
242
|
+
|
243
|
+
1. **External data retrieval** - Getting real-time information like weather, prices, or database records
|
244
|
+
2. **Computation** - When calculations are complex or involve large numbers
|
245
|
+
3. **System integration** - Connecting to external APIs or services
|
246
|
+
4. **Data processing** - Working with files, formatting data, or analyzing information
|
247
|
+
5. **Stateful operations** - When you need to maintain state between calls
|
data/docs/index.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
title: Home
|
4
|
+
nav_order: 1
|
5
|
+
description: "RubyLLM is a delightful Ruby way to work with AI."
|
6
|
+
permalink: /
|
7
|
+
---
|
8
|
+
|
9
|
+
# RubyLLM
|
10
|
+
{: .fs-9 }
|
11
|
+
|
12
|
+
A delightful Ruby way to work with AI through a unified interface to OpenAI, Anthropic, Google, and DeepSeek.
|
13
|
+
{: .fs-6 .fw-300 }
|
14
|
+
|
15
|
+
[Get started now]({% link installation.md %}){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 }
|
16
|
+
[View on GitHub](https://github.com/crmne/ruby_llm){: .btn .fs-5 .mb-4 .mb-md-0 }
|
17
|
+
|
18
|
+
---
|
19
|
+
<p align="center">
|
20
|
+
<img src="https://upload.wikimedia.org/wikipedia/commons/4/4d/OpenAI_Logo.svg" alt="OpenAI" height="40" width="120">
|
21
|
+
|
22
|
+
<img src="https://upload.wikimedia.org/wikipedia/commons/7/78/Anthropic_logo.svg" alt="Anthropic" height="40" width="120">
|
23
|
+
|
24
|
+
<img src="https://upload.wikimedia.org/wikipedia/commons/8/8a/Google_Gemini_logo.svg" alt="Google" height="40" width="120">
|
25
|
+
|
26
|
+
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ec/DeepSeek_logo.svg" alt="DeepSeek" height="40" width="120">
|
27
|
+
</p>
|
28
|
+
|
29
|
+
<p align="center">
|
30
|
+
<a href="https://badge.fury.io/rb/ruby_llm"><img src="https://badge.fury.io/rb/ruby_llm.svg" alt="Gem Version" /></a>
|
31
|
+
<a href="https://github.com/testdouble/standard"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="Ruby Style Guide" /></a>
|
32
|
+
<a href="https://rubygems.org/gems/ruby_llm"><img alt="Gem Total Downloads" src="https://img.shields.io/gem/dt/ruby_llm"></a>
|
33
|
+
<a href="https://github.com/crmne/ruby_llm/actions/workflows/cicd.yml"><img src="https://github.com/crmne/ruby_llm/actions/workflows/cicd.yml/badge.svg" alt="CI" /></a>
|
34
|
+
<a href="https://codecov.io/gh/crmne/ruby_llm"><img src="https://codecov.io/gh/crmne/ruby_llm/branch/main/graph/badge.svg" alt="codecov" /></a>
|
35
|
+
</p>
|
36
|
+
|
37
|
+
---
|
38
|
+
|
39
|
+
## Overview
|
40
|
+
|
41
|
+
RubyLLM provides a beautiful, unified interface to modern AI services, including:
|
42
|
+
|
43
|
+
- 💬 **Chat** with OpenAI GPT, Anthropic Claude, Google Gemini, and DeepSeek models
|
44
|
+
- 🎵 **Vision and Audio** understanding
|
45
|
+
- 🖼️ **Image generation** with DALL-E and other providers
|
46
|
+
- 📊 **Embeddings** for vector search and semantic analysis
|
47
|
+
- 🔧 **Tools** that let AI use your Ruby code
|
48
|
+
- 🚂 **Rails integration** to persist chats and messages with ActiveRecord
|
49
|
+
- 🌊 **Streaming** responses with proper Ruby patterns
|
50
|
+
|
51
|
+
## Quick start
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
require 'ruby_llm'
|
55
|
+
|
56
|
+
# Configure your API keys
|
57
|
+
RubyLLM.configure do |config|
|
58
|
+
config.openai_api_key = ENV['OPENAI_API_KEY']
|
59
|
+
end
|
60
|
+
|
61
|
+
# Start chatting
|
62
|
+
chat = RubyLLM.chat
|
63
|
+
response = chat.ask "What's the best way to learn Ruby?"
|
64
|
+
|
65
|
+
# Generate images
|
66
|
+
image = RubyLLM.paint "a sunset over mountains"
|
67
|
+
puts image.url
|
68
|
+
```
|
69
|
+
|
70
|
+
## Learn more
|
71
|
+
|
72
|
+
- [Installation]({% link installation.md %})
|
73
|
+
- [Guides]({% link guides/index.md %})
|
@@ -0,0 +1,98 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
title: Installation
|
4
|
+
nav_order: 2
|
5
|
+
permalink: /installation
|
6
|
+
---
|
7
|
+
|
8
|
+
# Installation
|
9
|
+
|
10
|
+
RubyLLM is packaged as a Ruby gem, making it easy to install in your projects.
|
11
|
+
|
12
|
+
## Requirements
|
13
|
+
|
14
|
+
* Ruby 3.1 or later
|
15
|
+
* An API key from at least one of the supported providers:
|
16
|
+
* OpenAI
|
17
|
+
* Anthropic
|
18
|
+
* Google (Gemini)
|
19
|
+
* DeepSeek
|
20
|
+
|
21
|
+
## Installation Methods
|
22
|
+
|
23
|
+
### Using Bundler (recommended)
|
24
|
+
|
25
|
+
Add RubyLLM to your project's Gemfile:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
gem 'ruby_llm'
|
29
|
+
```
|
30
|
+
|
31
|
+
Then install the dependencies:
|
32
|
+
|
33
|
+
```bash
|
34
|
+
bundle install
|
35
|
+
```
|
36
|
+
|
37
|
+
### Manual Installation
|
38
|
+
|
39
|
+
If you're not using Bundler, you can install RubyLLM directly:
|
40
|
+
|
41
|
+
```bash
|
42
|
+
gem install ruby_llm
|
43
|
+
```
|
44
|
+
|
45
|
+
## Configuration
|
46
|
+
|
47
|
+
After installing RubyLLM, you'll need to configure it with your API keys:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
require 'ruby_llm'
|
51
|
+
|
52
|
+
RubyLLM.configure do |config|
|
53
|
+
# Required: At least one API key
|
54
|
+
config.openai_api_key = ENV['OPENAI_API_KEY']
|
55
|
+
config.anthropic_api_key = ENV['ANTHROPIC_API_KEY']
|
56
|
+
config.gemini_api_key = ENV['GEMINI_API_KEY']
|
57
|
+
config.deepseek_api_key = ENV['DEEPSEEK_API_KEY']
|
58
|
+
|
59
|
+
# Optional: Set default models
|
60
|
+
config.default_model = 'gpt-4o-mini' # Default chat model
|
61
|
+
config.default_embedding_model = 'text-embedding-3-small' # Default embedding model
|
62
|
+
config.default_image_model = 'dall-e-3' # Default image generation model
|
63
|
+
|
64
|
+
# Optional: Configure request settings
|
65
|
+
config.request_timeout = 120 # Request timeout in seconds
|
66
|
+
config.max_retries = 3 # Number of retries on failures
|
67
|
+
end
|
68
|
+
```
|
69
|
+
|
70
|
+
We recommend storing your API keys as environment variables rather than hardcoding them in your application.
|
71
|
+
|
72
|
+
## Verifying Installation
|
73
|
+
|
74
|
+
You can verify that RubyLLM is correctly installed and configured by running a simple test:
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
require 'ruby_llm'
|
78
|
+
|
79
|
+
# Configure with at least one API key
|
80
|
+
RubyLLM.configure do |config|
|
81
|
+
config.openai_api_key = ENV['OPENAI_API_KEY']
|
82
|
+
end
|
83
|
+
|
84
|
+
# Try a simple query
|
85
|
+
chat = RubyLLM.chat
|
86
|
+
response = chat.ask "Hello, world!"
|
87
|
+
puts response.content
|
88
|
+
|
89
|
+
# Check available models
|
90
|
+
puts "Available models:"
|
91
|
+
RubyLLM.models.chat_models.each do |model|
|
92
|
+
puts "- #{model.id} (#{model.provider})"
|
93
|
+
end
|
94
|
+
```
|
95
|
+
|
96
|
+
## Next Steps
|
97
|
+
|
98
|
+
Once you've successfully installed RubyLLM, check out the [Getting Started guide]({% link guides/getting-started.md %}) to learn how to use it in your applications.
|
@@ -85,10 +85,10 @@ module RubyLLM
|
|
85
85
|
.on_end_message { |msg| persist_message_completion(msg) }
|
86
86
|
end
|
87
87
|
|
88
|
-
def ask(message, &
|
88
|
+
def ask(message, &)
|
89
89
|
message = { role: :user, content: message }
|
90
90
|
messages.create!(**message)
|
91
|
-
to_llm.complete(&
|
91
|
+
to_llm.complete(&)
|
92
92
|
end
|
93
93
|
|
94
94
|
alias say ask
|
data/lib/ruby_llm/chat.rb
CHANGED
@@ -72,18 +72,18 @@ module RubyLLM
|
|
72
72
|
self
|
73
73
|
end
|
74
74
|
|
75
|
-
def each(&
|
76
|
-
messages.each(&
|
75
|
+
def each(&)
|
76
|
+
messages.each(&)
|
77
77
|
end
|
78
78
|
|
79
|
-
def complete(&
|
79
|
+
def complete(&)
|
80
80
|
@on[:new_message]&.call
|
81
|
-
response = @provider.complete(messages, tools: @tools, temperature: @temperature, model: @model.id, &
|
81
|
+
response = @provider.complete(messages, tools: @tools, temperature: @temperature, model: @model.id, &)
|
82
82
|
@on[:end_message]&.call(response)
|
83
83
|
|
84
84
|
add_message response
|
85
85
|
if response.tool_call?
|
86
|
-
handle_tool_calls
|
86
|
+
handle_tool_calls(response, &)
|
87
87
|
else
|
88
88
|
response
|
89
89
|
end
|
@@ -97,7 +97,7 @@ module RubyLLM
|
|
97
97
|
|
98
98
|
private
|
99
99
|
|
100
|
-
def handle_tool_calls(response, &
|
100
|
+
def handle_tool_calls(response, &)
|
101
101
|
response.tool_calls.each_value do |tool_call|
|
102
102
|
@on[:new_message]&.call
|
103
103
|
result = execute_tool tool_call
|
@@ -105,7 +105,7 @@ module RubyLLM
|
|
105
105
|
@on[:end_message]&.call(message)
|
106
106
|
end
|
107
107
|
|
108
|
-
complete(&
|
108
|
+
complete(&)
|
109
109
|
end
|
110
110
|
|
111
111
|
def execute_tool(tool_call)
|
data/lib/ruby_llm/models.json
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
"created_at": "2023-08-21T18:16:55+02:00",
|
24
24
|
"display_name": "Babbage 002",
|
25
25
|
"provider": "openai",
|
26
|
-
"context_window":
|
26
|
+
"context_window": 16385,
|
27
27
|
"max_tokens": 16384,
|
28
28
|
"type": "chat",
|
29
29
|
"family": "babbage",
|
@@ -262,7 +262,7 @@
|
|
262
262
|
"created_at": "2023-08-21T18:11:41+02:00",
|
263
263
|
"display_name": "Davinci 002",
|
264
264
|
"provider": "openai",
|
265
|
-
"context_window":
|
265
|
+
"context_window": 16385,
|
266
266
|
"max_tokens": 16384,
|
267
267
|
"type": "chat",
|
268
268
|
"family": "davinci",
|
@@ -287,7 +287,7 @@
|
|
287
287
|
"family": "chat",
|
288
288
|
"supports_vision": false,
|
289
289
|
"supports_functions": true,
|
290
|
-
"supports_json_mode":
|
290
|
+
"supports_json_mode": false,
|
291
291
|
"input_price_per_million": 0.27,
|
292
292
|
"output_price_per_million": 1.1,
|
293
293
|
"metadata": {
|
@@ -371,63 +371,6 @@
|
|
371
371
|
"owned_by": "google"
|
372
372
|
}
|
373
373
|
},
|
374
|
-
{
|
375
|
-
"id": "gemini-1.0-pro",
|
376
|
-
"created_at": null,
|
377
|
-
"display_name": "Gemini 1.0 Pro",
|
378
|
-
"provider": "gemini",
|
379
|
-
"context_window": 32768,
|
380
|
-
"max_tokens": 4096,
|
381
|
-
"type": "chat",
|
382
|
-
"family": "gemini10_pro",
|
383
|
-
"supports_vision": false,
|
384
|
-
"supports_functions": false,
|
385
|
-
"supports_json_mode": false,
|
386
|
-
"input_price_per_million": 0.5,
|
387
|
-
"output_price_per_million": 1.5,
|
388
|
-
"metadata": {
|
389
|
-
"object": "model",
|
390
|
-
"owned_by": "google"
|
391
|
-
}
|
392
|
-
},
|
393
|
-
{
|
394
|
-
"id": "gemini-1.0-pro-001",
|
395
|
-
"created_at": null,
|
396
|
-
"display_name": "Gemini 1.0 Pro 001",
|
397
|
-
"provider": "gemini",
|
398
|
-
"context_window": 32768,
|
399
|
-
"max_tokens": 4096,
|
400
|
-
"type": "chat",
|
401
|
-
"family": "gemini10_pro",
|
402
|
-
"supports_vision": false,
|
403
|
-
"supports_functions": false,
|
404
|
-
"supports_json_mode": false,
|
405
|
-
"input_price_per_million": 0.5,
|
406
|
-
"output_price_per_million": 1.5,
|
407
|
-
"metadata": {
|
408
|
-
"object": "model",
|
409
|
-
"owned_by": "google"
|
410
|
-
}
|
411
|
-
},
|
412
|
-
{
|
413
|
-
"id": "gemini-1.0-pro-latest",
|
414
|
-
"created_at": null,
|
415
|
-
"display_name": "Gemini 1.0 Pro Latest",
|
416
|
-
"provider": "gemini",
|
417
|
-
"context_window": 32768,
|
418
|
-
"max_tokens": 4096,
|
419
|
-
"type": "chat",
|
420
|
-
"family": "gemini10_pro",
|
421
|
-
"supports_vision": false,
|
422
|
-
"supports_functions": false,
|
423
|
-
"supports_json_mode": false,
|
424
|
-
"input_price_per_million": 0.5,
|
425
|
-
"output_price_per_million": 1.5,
|
426
|
-
"metadata": {
|
427
|
-
"object": "model",
|
428
|
-
"owned_by": "google"
|
429
|
-
}
|
430
|
-
},
|
431
374
|
{
|
432
375
|
"id": "gemini-1.0-pro-vision-latest",
|
433
376
|
"created_at": null,
|
@@ -884,44 +827,6 @@
|
|
884
827
|
"owned_by": "google"
|
885
828
|
}
|
886
829
|
},
|
887
|
-
{
|
888
|
-
"id": "gemini-2.0-flash-lite-preview",
|
889
|
-
"created_at": null,
|
890
|
-
"display_name": "Gemini 2.0 Flash Lite Preview",
|
891
|
-
"provider": "gemini",
|
892
|
-
"context_window": 1048576,
|
893
|
-
"max_tokens": 8192,
|
894
|
-
"type": "chat",
|
895
|
-
"family": "gemini20_flash_lite",
|
896
|
-
"supports_vision": true,
|
897
|
-
"supports_functions": false,
|
898
|
-
"supports_json_mode": false,
|
899
|
-
"input_price_per_million": 0.075,
|
900
|
-
"output_price_per_million": 0.3,
|
901
|
-
"metadata": {
|
902
|
-
"object": "model",
|
903
|
-
"owned_by": "google"
|
904
|
-
}
|
905
|
-
},
|
906
|
-
{
|
907
|
-
"id": "gemini-2.0-flash-lite-preview-02-05",
|
908
|
-
"created_at": null,
|
909
|
-
"display_name": "Gemini 2.0 Flash Lite Preview 02 05",
|
910
|
-
"provider": "gemini",
|
911
|
-
"context_window": 1048576,
|
912
|
-
"max_tokens": 8192,
|
913
|
-
"type": "chat",
|
914
|
-
"family": "gemini20_flash_lite",
|
915
|
-
"supports_vision": true,
|
916
|
-
"supports_functions": false,
|
917
|
-
"supports_json_mode": false,
|
918
|
-
"input_price_per_million": 0.075,
|
919
|
-
"output_price_per_million": 0.3,
|
920
|
-
"metadata": {
|
921
|
-
"object": "model",
|
922
|
-
"owned_by": "google"
|
923
|
-
}
|
924
|
-
},
|
925
830
|
{
|
926
831
|
"id": "gemini-2.0-flash-mmgen-rev17",
|
927
832
|
"created_at": null,
|
@@ -1093,25 +998,6 @@
|
|
1093
998
|
"owned_by": "google"
|
1094
999
|
}
|
1095
1000
|
},
|
1096
|
-
{
|
1097
|
-
"id": "gemini-pro",
|
1098
|
-
"created_at": null,
|
1099
|
-
"display_name": "Gemini Pro",
|
1100
|
-
"provider": "gemini",
|
1101
|
-
"context_window": 32768,
|
1102
|
-
"max_tokens": 4096,
|
1103
|
-
"type": "chat",
|
1104
|
-
"family": "other",
|
1105
|
-
"supports_vision": false,
|
1106
|
-
"supports_functions": false,
|
1107
|
-
"supports_json_mode": false,
|
1108
|
-
"input_price_per_million": 0.075,
|
1109
|
-
"output_price_per_million": 0.3,
|
1110
|
-
"metadata": {
|
1111
|
-
"object": "model",
|
1112
|
-
"owned_by": "google"
|
1113
|
-
}
|
1114
|
-
},
|
1115
1001
|
{
|
1116
1002
|
"id": "gemini-pro-vision",
|
1117
1003
|
"created_at": null,
|
@@ -1212,7 +1098,7 @@
|
|
1212
1098
|
"created_at": "2024-01-23T23:19:18+01:00",
|
1213
1099
|
"display_name": "GPT-3.5-Turbo 0125",
|
1214
1100
|
"provider": "openai",
|
1215
|
-
"context_window":
|
1101
|
+
"context_window": 4096,
|
1216
1102
|
"max_tokens": 4096,
|
1217
1103
|
"type": "chat",
|
1218
1104
|
"family": "gpt35",
|
@@ -1231,7 +1117,7 @@
|
|
1231
1117
|
"created_at": "2023-11-02T22:15:48+01:00",
|
1232
1118
|
"display_name": "GPT-3.5-Turbo 1106",
|
1233
1119
|
"provider": "openai",
|
1234
|
-
"context_window":
|
1120
|
+
"context_window": 4096,
|
1235
1121
|
"max_tokens": 4096,
|
1236
1122
|
"type": "chat",
|
1237
1123
|
"family": "gpt35",
|
@@ -1460,7 +1346,7 @@
|
|
1460
1346
|
"display_name": "GPT-4o 20240513",
|
1461
1347
|
"provider": "openai",
|
1462
1348
|
"context_window": 128000,
|
1463
|
-
"max_tokens":
|
1349
|
+
"max_tokens": 16384,
|
1464
1350
|
"type": "chat",
|
1465
1351
|
"family": "gpt4o",
|
1466
1352
|
"supports_vision": true,
|
@@ -1650,7 +1536,7 @@
|
|
1650
1536
|
"display_name": "GPT-4o-Mini Realtime Preview",
|
1651
1537
|
"provider": "openai",
|
1652
1538
|
"context_window": 128000,
|
1653
|
-
"max_tokens":
|
1539
|
+
"max_tokens": 16384,
|
1654
1540
|
"type": "chat",
|
1655
1541
|
"family": "gpt4o_mini_realtime",
|
1656
1542
|
"supports_vision": true,
|
@@ -1669,7 +1555,7 @@
|
|
1669
1555
|
"display_name": "GPT-4o-Mini Realtime Preview 20241217",
|
1670
1556
|
"provider": "openai",
|
1671
1557
|
"context_window": 128000,
|
1672
|
-
"max_tokens":
|
1558
|
+
"max_tokens": 16384,
|
1673
1559
|
"type": "chat",
|
1674
1560
|
"family": "gpt4o_mini_realtime",
|
1675
1561
|
"supports_vision": true,
|
@@ -1688,7 +1574,7 @@
|
|
1688
1574
|
"display_name": "GPT-4o-Realtime Preview",
|
1689
1575
|
"provider": "openai",
|
1690
1576
|
"context_window": 128000,
|
1691
|
-
"max_tokens":
|
1577
|
+
"max_tokens": 16384,
|
1692
1578
|
"type": "chat",
|
1693
1579
|
"family": "gpt4o_realtime",
|
1694
1580
|
"supports_vision": true,
|
@@ -1707,7 +1593,7 @@
|
|
1707
1593
|
"display_name": "GPT-4o-Realtime Preview 20241001",
|
1708
1594
|
"provider": "openai",
|
1709
1595
|
"context_window": 128000,
|
1710
|
-
"max_tokens":
|
1596
|
+
"max_tokens": 16384,
|
1711
1597
|
"type": "chat",
|
1712
1598
|
"family": "gpt4o_realtime",
|
1713
1599
|
"supports_vision": true,
|
@@ -1726,7 +1612,7 @@
|
|
1726
1612
|
"display_name": "GPT-4o-Realtime Preview 20241217",
|
1727
1613
|
"provider": "openai",
|
1728
1614
|
"context_window": 128000,
|
1729
|
-
"max_tokens":
|
1615
|
+
"max_tokens": 16384,
|
1730
1616
|
"type": "chat",
|
1731
1617
|
"family": "gpt4o_realtime",
|
1732
1618
|
"supports_vision": true,
|