dspy-gemini 1.0.2 → 1.0.3
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/README.md +8 -16
- data/lib/dspy/gemini/lm/schema_converter.rb +4 -2
- data/lib/dspy/gemini/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0d8c3a914bf14371393cd8666e8fe6dde619beba003ad16513e3ecb077239b06
|
|
4
|
+
data.tar.gz: fdd2ee0fd8710a95653626ccf32a529fe491efefcb5bbe3f7c4422586a056733
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: efedc61fd10498ee0efff8f03d1b55c8f9e2407fe7afaad7b99e2489fb184ebbec468a3ffc85054ece684bcaaa8cd8e112ce4a4a64a9ec32e39ad823d8d1256d
|
|
7
|
+
data.tar.gz: 05203eb5b8bc7b61ec438fb65d0c289c59a2cb7a97dc5e8bd64e195f64f183879392d701da50d94af66fc62b81383b8520125a7181850001e4c3cb19b3fed4c0
|
data/README.md
CHANGED
|
@@ -137,26 +137,18 @@ result.answer # => "60 km/h"
|
|
|
137
137
|
Build agents that use tools to accomplish tasks:
|
|
138
138
|
|
|
139
139
|
```ruby
|
|
140
|
-
class SearchTool < DSPy::Tools::
|
|
140
|
+
class SearchTool < DSPy::Tools::Base
|
|
141
141
|
tool_name "search"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
input do
|
|
145
|
-
const :query, String
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
output do
|
|
149
|
-
const :results, T::Array[String]
|
|
150
|
-
end
|
|
142
|
+
tool_description "Search for information"
|
|
151
143
|
|
|
144
|
+
sig { params(query: String).returns(String) }
|
|
152
145
|
def call(query:)
|
|
153
146
|
# Your search implementation
|
|
154
|
-
|
|
147
|
+
"Result 1, Result 2"
|
|
155
148
|
end
|
|
156
149
|
end
|
|
157
150
|
|
|
158
|
-
|
|
159
|
-
agent = DSPy::ReAct.new(signature: ResearchTask, tools: toolset, max_iterations: 5)
|
|
151
|
+
agent = DSPy::ReAct.new(ResearchTask, tools: [SearchTool.new], max_iterations: 5)
|
|
160
152
|
result = agent.call(question: "What's the latest on Ruby 3.4?")
|
|
161
153
|
```
|
|
162
154
|
|
|
@@ -185,8 +177,8 @@ result = agent.call(question: "What's the latest on Ruby 3.4?")
|
|
|
185
177
|
A [Claude Skill](https://github.com/vicentereig/dspy-rb-skill) is available to help you build DSPy.rb applications:
|
|
186
178
|
|
|
187
179
|
```bash
|
|
188
|
-
# Claude Code
|
|
189
|
-
|
|
180
|
+
# Claude Code — install from the vicentereig/engineering marketplace
|
|
181
|
+
claude install-skill vicentereig/engineering --skill dspy-rb
|
|
190
182
|
```
|
|
191
183
|
|
|
192
184
|
For Claude.ai Pro/Max, download the [skill ZIP](https://github.com/vicentereig/dspy-rb-skill/archive/refs/heads/main.zip) and upload via Settings > Skills.
|
|
@@ -201,7 +193,7 @@ The [examples/](examples/) directory has runnable code for common patterns:
|
|
|
201
193
|
- Prompt optimization
|
|
202
194
|
|
|
203
195
|
```bash
|
|
204
|
-
bundle exec ruby examples/
|
|
196
|
+
bundle exec ruby examples/basic_search_agent.rb
|
|
205
197
|
```
|
|
206
198
|
|
|
207
199
|
## Optional Gems
|
|
@@ -11,7 +11,7 @@ module DSPy
|
|
|
11
11
|
|
|
12
12
|
# Models that support structured outputs (JSON + Schema)
|
|
13
13
|
# Based on official Google documentation: https://ai.google.dev/gemini-api/docs/models/gemini
|
|
14
|
-
# Last updated:
|
|
14
|
+
# Last updated: Feb 2026
|
|
15
15
|
# Note: Gemini 1.5 series deprecated Oct 2025
|
|
16
16
|
STRUCTURED_OUTPUT_MODELS = T.let([
|
|
17
17
|
# Gemini 2.0 series
|
|
@@ -21,7 +21,9 @@ module DSPy
|
|
|
21
21
|
"gemini-2.5-pro",
|
|
22
22
|
"gemini-2.5-flash",
|
|
23
23
|
"gemini-2.5-flash-lite",
|
|
24
|
-
"gemini-2.5-flash-image"
|
|
24
|
+
"gemini-2.5-flash-image",
|
|
25
|
+
# Gemini 3.0 series
|
|
26
|
+
"gemini-3-flash-preview"
|
|
25
27
|
].freeze, T::Array[String])
|
|
26
28
|
|
|
27
29
|
# Models that do not support structured outputs or are deprecated
|
data/lib/dspy/gemini/version.rb
CHANGED