dspy-datasets 1.0.0 → 1.0.2
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 +141 -185
- data/lib/dspy/datasets/loaders/huggingface_parquet.rb +1 -1
- data/lib/dspy/datasets/version.rb +1 -1
- metadata +9 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e49d7bb5e7ce07783f82fa07807b9249d22dc90b842ab7a79c7b3847d3e36429
|
|
4
|
+
data.tar.gz: 3588fc8011330e53327efcd06a471a0bd3400282e0ff9fa11561247f5129b46a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2186d5d95bacbebcb9044e08fafab7cbb767ebcf7a80052190261d60593f6436252f30e5aa07626258d69930ca2f3e6ce1e77b7c8cddaf69678ff22cf4d38d57
|
|
7
|
+
data.tar.gz: 722d80a9ff9a13fc859fefa19370700b8442f0063310f5a357781394e6a4ed55b366d938e82f6e5b3aff309d289448ccfa655c198ef0a2ed7ecb84e0789b7401
|
data/README.md
CHANGED
|
@@ -3,81 +3,97 @@
|
|
|
3
3
|
[](https://rubygems.org/gems/dspy)
|
|
4
4
|
[](https://rubygems.org/gems/dspy)
|
|
5
5
|
[](https://github.com/vicentereig/dspy.rb/actions/workflows/ruby.yml)
|
|
6
|
-
[](https://oss.vicente.services/dspy.rb/)
|
|
7
|
+
[](https://discord.gg/zWBhrMqn)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
> The core Prompt Engineering Framework is production-ready with
|
|
10
|
-
> comprehensive documentation. I am focusing now on educational content on systematic Prompt Optimization and Context Engineering.
|
|
11
|
-
> Your feedback is invaluable. if you encounter issues, please open an [issue](https://github.com/vicentereig/dspy.rb/issues). If you have suggestions, open a [new thread](https://github.com/vicentereig/dspy.rb/discussions).
|
|
12
|
-
>
|
|
13
|
-
> If you want to contribute, feel free to reach out to me to coordinate efforts: hey at vicente.services
|
|
14
|
-
>
|
|
15
|
-
> And, yes, this is 100% a legit project. :)
|
|
9
|
+
**Build reliable LLM applications in idiomatic Ruby using composable, type-safe modules.**
|
|
16
10
|
|
|
11
|
+
DSPy.rb is the Ruby port of Stanford's [DSPy](https://dspy.ai). Instead of wrestling with brittle prompt strings, you define typed signatures and let the framework handle the rest. Prompts become functions. LLM calls become predictable.
|
|
17
12
|
|
|
18
|
-
|
|
13
|
+
```ruby
|
|
14
|
+
require 'dspy'
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
DSPy.configure do |c|
|
|
17
|
+
c.lm = DSPy::LM.new('openai/gpt-4o-mini', api_key: ENV['OPENAI_API_KEY'])
|
|
18
|
+
end
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
the
|
|
25
|
-
signatures and let the framework handle the messy details.
|
|
20
|
+
class Summarize < DSPy::Signature
|
|
21
|
+
description "Summarize the given text in one sentence."
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
input do
|
|
24
|
+
const :text, String
|
|
25
|
+
end
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
output do
|
|
28
|
+
const :summary, String
|
|
29
|
+
end
|
|
30
|
+
end
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
summarizer = DSPy::Predict.new(Summarize)
|
|
33
|
+
result = summarizer.call(text: "DSPy.rb brings structured LLM programming to Ruby...")
|
|
34
|
+
puts result.summary
|
|
35
|
+
```
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
### Installation
|
|
37
|
+
That's it. No prompt templates. No JSON parsing. No prayer-based error handling.
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
## Installation
|
|
39
40
|
|
|
40
41
|
```ruby
|
|
42
|
+
# Gemfile
|
|
41
43
|
gem 'dspy'
|
|
44
|
+
gem 'dspy-openai' # For OpenAI, OpenRouter, or Ollama
|
|
45
|
+
# gem 'dspy-anthropic' # For Claude
|
|
46
|
+
# gem 'dspy-gemini' # For Gemini
|
|
47
|
+
# gem 'dspy-ruby_llm' # For 12+ providers via RubyLLM
|
|
42
48
|
```
|
|
43
49
|
|
|
44
|
-
and
|
|
45
|
-
|
|
46
50
|
```bash
|
|
47
51
|
bundle install
|
|
48
52
|
```
|
|
49
53
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
DSPy.rb ships multiple gems from this monorepo so you only install what you need. Add these alongside `dspy`:
|
|
54
|
+
## Quick Start
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
| --- | --- | --- |
|
|
56
|
-
| `dspy-schema` | Exposes `DSPy::TypeSystem::SorbetJsonSchema` for downstream reuse. | **Stable** (v1.0.0) |
|
|
57
|
-
| `dspy-code_act` | Think-Code-Observe agents that synthesize and execute Ruby safely. | Preview (0.x) |
|
|
58
|
-
| `dspy-datasets` | Dataset helpers plus Parquet/Polars tooling for richer evaluation corpora. | Preview (0.x) |
|
|
59
|
-
| `dspy-evals` | High-throughput evaluation harness with metrics, callbacks, and regression fixtures. | Preview (0.x) |
|
|
60
|
-
| `dspy-miprov2` | Bayesian optimization + Gaussian Process backend for the MIPROv2 teleprompter. | Preview (0.x) |
|
|
61
|
-
| `dspy-gepa` | `DSPy::Teleprompt::GEPA`, reflection loops, experiment tracking, telemetry adapters. | Preview (mirrors `dspy` version) |
|
|
62
|
-
| `gepa` | GEPA optimizer core (Pareto engine, telemetry, reflective proposer). | Preview (mirrors `dspy` version) |
|
|
63
|
-
| `dspy-o11y` | Core observability APIs: `DSPy::Observability`, async span processor, observation types. | **Stable** (v1.0.0) |
|
|
64
|
-
| `dspy-o11y-langfuse` | Auto-configures DSPy observability to stream spans to Langfuse via OTLP. | **Stable** (v1.0.0) |
|
|
65
|
-
|
|
66
|
-
Set the matching `DSPY_WITH_*` environment variables (see `Gemfile`) to include or exclude each sibling gem when running Bundler locally (for example `DSPY_WITH_GEPA=1` or `DSPY_WITH_O11Y_LANGFUSE=1`). Refer to `docs/core-concepts/dependency-tree.md` for the full dependency map and roadmap.
|
|
67
|
-
### Your First Reliable Predictor
|
|
56
|
+
### Configure Your LLM
|
|
68
57
|
|
|
69
58
|
```ruby
|
|
70
|
-
|
|
71
|
-
# Configure DSPy globablly to use your fave LLM - you can override this on an instance levle.
|
|
59
|
+
# OpenAI
|
|
72
60
|
DSPy.configure do |c|
|
|
73
61
|
c.lm = DSPy::LM.new('openai/gpt-4o-mini',
|
|
74
62
|
api_key: ENV['OPENAI_API_KEY'],
|
|
75
|
-
structured_outputs: true)
|
|
63
|
+
structured_outputs: true)
|
|
76
64
|
end
|
|
77
65
|
|
|
78
|
-
#
|
|
66
|
+
# Anthropic Claude
|
|
67
|
+
DSPy.configure do |c|
|
|
68
|
+
c.lm = DSPy::LM.new('anthropic/claude-sonnet-4-20250514',
|
|
69
|
+
api_key: ENV['ANTHROPIC_API_KEY'])
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Google Gemini
|
|
73
|
+
DSPy.configure do |c|
|
|
74
|
+
c.lm = DSPy::LM.new('gemini/gemini-2.5-flash',
|
|
75
|
+
api_key: ENV['GEMINI_API_KEY'])
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Ollama (local, free)
|
|
79
|
+
DSPy.configure do |c|
|
|
80
|
+
c.lm = DSPy::LM.new('ollama/llama3.2')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# OpenRouter (200+ models)
|
|
84
|
+
DSPy.configure do |c|
|
|
85
|
+
c.lm = DSPy::LM.new('openrouter/deepseek/deepseek-chat-v3.1:free',
|
|
86
|
+
api_key: ENV['OPENROUTER_API_KEY'])
|
|
87
|
+
end
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Define a Signature
|
|
91
|
+
|
|
92
|
+
Signatures are typed contracts for LLM operations. Define inputs, outputs, and let DSPy handle the prompt:
|
|
93
|
+
|
|
94
|
+
```ruby
|
|
79
95
|
class Classify < DSPy::Signature
|
|
80
|
-
description "Classify sentiment of a given sentence."
|
|
96
|
+
description "Classify sentiment of a given sentence."
|
|
81
97
|
|
|
82
98
|
class Sentiment < T::Enum
|
|
83
99
|
enums do
|
|
@@ -86,182 +102,122 @@ class Classify < DSPy::Signature
|
|
|
86
102
|
Neutral = new('neutral')
|
|
87
103
|
end
|
|
88
104
|
end
|
|
89
|
-
|
|
90
|
-
# Structured Inputs: makes sure you are sending only valid prompt inputs to your model
|
|
105
|
+
|
|
91
106
|
input do
|
|
92
107
|
const :sentence, String, description: 'The sentence to analyze'
|
|
93
108
|
end
|
|
94
109
|
|
|
95
|
-
# Structured Outputs: your predictor will validate the output of the model too.
|
|
96
110
|
output do
|
|
97
|
-
const :sentiment, Sentiment
|
|
98
|
-
const :confidence, Float
|
|
111
|
+
const :sentiment, Sentiment
|
|
112
|
+
const :confidence, Float
|
|
99
113
|
end
|
|
100
114
|
end
|
|
101
115
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
# it may raise an error if you mess the inputs or your LLM messes the outputs.
|
|
105
|
-
result = classify.call(sentence: "This book was super fun to read!")
|
|
116
|
+
classifier = DSPy::Predict.new(Classify)
|
|
117
|
+
result = classifier.call(sentence: "This book was super fun to read!")
|
|
106
118
|
|
|
107
|
-
|
|
108
|
-
|
|
119
|
+
result.sentiment # => #<Sentiment::Positive>
|
|
120
|
+
result.confidence # => 0.92
|
|
109
121
|
```
|
|
110
122
|
|
|
111
|
-
###
|
|
123
|
+
### Chain of Thought
|
|
112
124
|
|
|
113
|
-
|
|
125
|
+
For complex reasoning, use `ChainOfThought` to get step-by-step explanations:
|
|
114
126
|
|
|
115
127
|
```ruby
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
c.lm = DSPy::LM.new('openai/gpt-4o-mini',
|
|
119
|
-
api_key: ENV['OPENAI_API_KEY'],
|
|
120
|
-
structured_outputs: true) # Native JSON mode
|
|
121
|
-
end
|
|
128
|
+
solver = DSPy::ChainOfThought.new(MathProblem)
|
|
129
|
+
result = solver.call(problem: "If a train travels 120km in 2 hours, what's its speed?")
|
|
122
130
|
|
|
123
|
-
#
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
api_key: ENV['GEMINI_API_KEY'],
|
|
127
|
-
structured_outputs: true) # Native structured outputs
|
|
128
|
-
end
|
|
131
|
+
result.reasoning # => "Speed = Distance / Time = 120km / 2h = 60km/h"
|
|
132
|
+
result.answer # => "60 km/h"
|
|
133
|
+
```
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
DSPy.configure do |c|
|
|
132
|
-
c.lm = DSPy::LM.new('anthropic/claude-sonnet-4-5-20250929',
|
|
133
|
-
api_key: ENV['ANTHROPIC_API_KEY'],
|
|
134
|
-
structured_outputs: true) # Tool-based extraction (default)
|
|
135
|
-
end
|
|
135
|
+
### ReAct Agents
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
DSPy.configure do |c|
|
|
139
|
-
c.lm = DSPy::LM.new('ollama/llama3.2') # Free, runs locally, no API key needed
|
|
140
|
-
end
|
|
137
|
+
Build agents that use tools to accomplish tasks:
|
|
141
138
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
```ruby
|
|
140
|
+
class SearchTool < DSPy::Tools::Base
|
|
141
|
+
tool_name "search"
|
|
142
|
+
tool_description "Search for information"
|
|
143
|
+
|
|
144
|
+
sig { params(query: String).returns(String) }
|
|
145
|
+
def call(query:)
|
|
146
|
+
# Your search implementation
|
|
147
|
+
"Result 1, Result 2"
|
|
148
|
+
end
|
|
146
149
|
end
|
|
150
|
+
|
|
151
|
+
agent = DSPy::ReAct.new(ResearchTask, tools: [SearchTool.new], max_iterations: 5)
|
|
152
|
+
result = agent.call(question: "What's the latest on Ruby 3.4?")
|
|
147
153
|
```
|
|
148
154
|
|
|
149
|
-
## What
|
|
150
|
-
|
|
151
|
-
**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
- Runtime type checking with [Sorbet](https://sorbet.org/) including T::Enum and union types
|
|
159
|
-
- Type-safe tool definitions for ReAct agents
|
|
160
|
-
- Comprehensive instrumentation and observability
|
|
161
|
-
|
|
162
|
-
**Core Building Blocks:**
|
|
163
|
-
- **Signatures** - Define input/output schemas using Sorbet types with T::Enum and union type support
|
|
164
|
-
- **Predict** - LLM completion with structured data extraction and multimodal support
|
|
165
|
-
- **Chain of Thought** - Step-by-step reasoning for complex problems with automatic prompt optimization
|
|
166
|
-
- **ReAct** - Tool-using agents with type-safe tool definitions and error recovery
|
|
167
|
-
- **Module Composition** - Combine multiple LLM calls into production-ready workflows
|
|
168
|
-
|
|
169
|
-
**Optimization & Evaluation:**
|
|
170
|
-
- **Prompt Objects** - Manipulate prompts as first-class objects instead of strings
|
|
171
|
-
- **Typed Examples** - Type-safe training data with automatic validation
|
|
172
|
-
- **Evaluation Framework** - Advanced metrics beyond simple accuracy with error-resilient pipelines
|
|
173
|
-
- **MIPROv2 Optimization** - Advanced Bayesian optimization with Gaussian Processes, multiple optimization strategies, auto-config presets, and storage persistence
|
|
174
|
-
|
|
175
|
-
**Production Features:**
|
|
176
|
-
- **Reliable JSON Extraction** - Native structured outputs for OpenAI and Gemini, Anthropic tool-based extraction, and automatic strategy selection with fallback
|
|
177
|
-
- **Type-Safe Configuration** - Strategy enums with automatic provider optimization (Strict/Compatible modes)
|
|
178
|
-
- **Smart Retry Logic** - Progressive fallback with exponential backoff for handling transient failures
|
|
179
|
-
- **Zero-Config Langfuse Integration** - Set env vars and get automatic OpenTelemetry traces in Langfuse
|
|
180
|
-
- **Performance Caching** - Schema and capability caching for faster repeated operations
|
|
181
|
-
- **File-based Storage** - Optimization result persistence with versioning
|
|
182
|
-
- **Structured Logging** - JSON and key=value formats with span tracking
|
|
183
|
-
|
|
184
|
-
## Recent Achievements
|
|
185
|
-
|
|
186
|
-
DSPy.rb has rapidly evolved from experimental to production-ready:
|
|
187
|
-
|
|
188
|
-
### Foundation
|
|
189
|
-
- ✅ **JSON Parsing Reliability** - Native OpenAI structured outputs with adaptive retry logic and schema-aware fallbacks
|
|
190
|
-
- ✅ **Type-Safe Strategy Configuration** - Provider-optimized strategy selection and enum-backed optimizer presets
|
|
191
|
-
- ✅ **Core Module System** - Predict, ChainOfThought, ReAct with type safety (add `dspy-code_act` for Think-Code-Observe agents)
|
|
192
|
-
- ✅ **Production Observability** - OpenTelemetry, New Relic, and Langfuse integration
|
|
193
|
-
- ✅ **Advanced Optimization** - MIPROv2 with Bayesian optimization, Gaussian Processes, and multi-mode search
|
|
194
|
-
|
|
195
|
-
### Recent Advances
|
|
196
|
-
- ✅ **MIPROv2 ADE Integrity (v0.29.1)** - Stratified train/val/test splits, honest precision accounting, and enum-driven `--auto` presets with integration coverage
|
|
197
|
-
- ✅ **Instruction Deduplication (v0.29.1)** - Candidate generation now filters repeated programs so optimization logs highlight unique strategies
|
|
198
|
-
- ✅ **GEPA Teleprompter (v0.29.0)** - Genetic-Pareto reflective prompt evolution with merge proposer scheduling, reflective mutation, and ADE demo parity
|
|
199
|
-
- ✅ **Optimizer Utilities Parity (v0.29.0)** - Bootstrap strategies, dataset summaries, and Layer 3 utilities unlock multi-predictor programs on Ruby
|
|
200
|
-
- ✅ **Observability Hardening (v0.29.0)** - OTLP exporter runs on a single-thread executor preventing frozen SSL contexts without blocking spans
|
|
201
|
-
- ✅ **Documentation Refresh (v0.29.x)** - New GEPA guide plus ADE optimization docs covering presets, stratified splits, and error-handling defaults
|
|
202
|
-
|
|
203
|
-
**Current Focus Areas:**
|
|
204
|
-
|
|
205
|
-
### Production Readiness
|
|
206
|
-
- 🚧 **Production Patterns** - Real-world usage validation and performance optimization
|
|
207
|
-
- 🚧 **Ruby Ecosystem Integration** - Rails integration, Sidekiq compatibility, deployment patterns
|
|
208
|
-
|
|
209
|
-
### Community & Adoption
|
|
210
|
-
- 🚧 **Community Examples** - Real-world applications and case studies
|
|
211
|
-
- 🚧 **Contributor Experience** - Making it easier to contribute and extend
|
|
212
|
-
- 🚧 **Performance Benchmarks** - Comparative analysis vs other frameworks
|
|
213
|
-
|
|
214
|
-
**v1.0 Philosophy:**
|
|
215
|
-
v1.0 will be released after extensive production battle-testing, not after checking off features.
|
|
216
|
-
The API is already stable - v1.0 represents confidence in production reliability backed by real-world validation.
|
|
155
|
+
## What's Included
|
|
156
|
+
|
|
157
|
+
**Core Modules**: Predict, ChainOfThought, ReAct agents, and composable pipelines.
|
|
158
|
+
|
|
159
|
+
**Type Safety**: Sorbet-based runtime validation. Enums, unions, nested structs—all work.
|
|
160
|
+
|
|
161
|
+
**Multimodal**: Image analysis with `DSPy::Image` for vision-capable models.
|
|
162
|
+
|
|
163
|
+
**Observability**: Zero-config Langfuse integration via OpenTelemetry. Non-blocking, production-ready.
|
|
217
164
|
|
|
165
|
+
**Optimization**: MIPROv2 (Bayesian optimization) and GEPA (genetic evolution) for prompt tuning.
|
|
166
|
+
|
|
167
|
+
**Provider Support**: OpenAI, Anthropic, Gemini, Ollama, and OpenRouter via official SDKs.
|
|
218
168
|
|
|
219
169
|
## Documentation
|
|
220
170
|
|
|
221
|
-
|
|
171
|
+
**[Full Documentation](https://oss.vicente.services/dspy.rb/)** — Getting started, core concepts, advanced patterns.
|
|
172
|
+
|
|
173
|
+
**[llms.txt](https://oss.vicente.services/dspy.rb/llms.txt)** — LLM-friendly reference for AI assistants.
|
|
222
174
|
|
|
223
|
-
###
|
|
175
|
+
### Claude Skill
|
|
224
176
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
177
|
+
A [Claude Skill](https://github.com/vicentereig/dspy-rb-skill) is available to help you build DSPy.rb applications:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Claude Code — install from the vicentereig/engineering marketplace
|
|
181
|
+
claude install-skill vicentereig/engineering --skill dspy-rb
|
|
182
|
+
```
|
|
228
183
|
|
|
229
|
-
|
|
230
|
-
- **[Installation & Setup](docs/src/getting-started/installation.md)** - Detailed installation and configuration
|
|
231
|
-
- **[Quick Start Guide](docs/src/getting-started/quick-start.md)** - Your first DSPy programs
|
|
232
|
-
- **[Core Concepts](docs/src/getting-started/core-concepts.md)** - Understanding signatures, predictors, and modules
|
|
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.
|
|
233
185
|
|
|
234
|
-
|
|
235
|
-
- **[Signatures & Types](docs/src/core-concepts/signatures.md)** - Define typed interfaces for LLM operations
|
|
236
|
-
- **[Predictors](docs/src/core-concepts/predictors.md)** - Predict, ChainOfThought, ReAct, and more
|
|
237
|
-
- **[Modules & Pipelines](docs/src/core-concepts/modules.md)** - Compose complex multi-stage workflows
|
|
238
|
-
- **[Multimodal Support](docs/src/core-concepts/multimodal.md)** - Image analysis with vision-capable models
|
|
239
|
-
- **[Examples & Validation](docs/src/core-concepts/examples.md)** - Type-safe training data
|
|
240
|
-
- **[Rich Types](docs/src/advanced/complex-types.md)** - Sorbet type integration with automatic coercion for structs, enums, and arrays
|
|
241
|
-
- **[Composable Pipelines](docs/src/advanced/pipelines.md)** - Manual module composition patterns
|
|
186
|
+
## Examples
|
|
242
187
|
|
|
243
|
-
|
|
244
|
-
- **[Evaluation Framework](docs/src/optimization/evaluation.md)** - Advanced metrics beyond simple accuracy
|
|
245
|
-
- **[Prompt Optimization](docs/src/optimization/prompt-optimization.md)** - Manipulate prompts as objects
|
|
246
|
-
- **[MIPROv2 Optimizer](docs/src/optimization/miprov2.md)** - Advanced Bayesian optimization with Gaussian Processes
|
|
247
|
-
- **[GEPA Optimizer](docs/src/optimization/gepa.md)** *(beta)* - Reflective mutation with optional reflection LMs
|
|
188
|
+
The [examples/](examples/) directory has runnable code for common patterns:
|
|
248
189
|
|
|
249
|
-
|
|
250
|
-
-
|
|
251
|
-
-
|
|
252
|
-
-
|
|
190
|
+
- Sentiment classification
|
|
191
|
+
- ReAct agents with tools
|
|
192
|
+
- Image analysis
|
|
193
|
+
- Prompt optimization
|
|
253
194
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
- **[Custom Metrics](docs/src/advanced/custom-metrics.md)** - Proc-based evaluation logic
|
|
195
|
+
```bash
|
|
196
|
+
bundle exec ruby examples/basic_search_agent.rb
|
|
197
|
+
```
|
|
258
198
|
|
|
199
|
+
## Optional Gems
|
|
259
200
|
|
|
201
|
+
DSPy.rb ships sibling gems for features with heavier dependencies. Add them as needed:
|
|
260
202
|
|
|
203
|
+
| Gem | What it does |
|
|
204
|
+
| --- | --- |
|
|
205
|
+
| `dspy-datasets` | Dataset helpers, Parquet/Polars tooling |
|
|
206
|
+
| `dspy-evals` | Evaluation harness with metrics and callbacks |
|
|
207
|
+
| `dspy-miprov2` | Bayesian optimization for prompt tuning |
|
|
208
|
+
| `dspy-gepa` | Genetic-Pareto prompt evolution |
|
|
209
|
+
| `dspy-o11y-langfuse` | Auto-configure Langfuse tracing |
|
|
210
|
+
| `dspy-code_act` | Think-Code-Observe agents |
|
|
211
|
+
| `dspy-deep_search` | Production DeepSearch with Exa |
|
|
261
212
|
|
|
213
|
+
See [the full list](https://oss.vicente.services/dspy.rb/getting-started/installation/) in the docs.
|
|
262
214
|
|
|
215
|
+
## Contributing
|
|
263
216
|
|
|
217
|
+
Feedback is invaluable. If you encounter issues, [open an issue](https://github.com/vicentereig/dspy.rb/issues). For suggestions, [start a discussion](https://github.com/vicentereig/dspy.rb/discussions).
|
|
264
218
|
|
|
219
|
+
Want to contribute code? Reach out: hey at vicente.services
|
|
265
220
|
|
|
266
221
|
## License
|
|
267
|
-
|
|
222
|
+
|
|
223
|
+
MIT License.
|
metadata
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dspy-datasets
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vicente Reig Rincón de Arellano
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: dspy
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- -
|
|
16
|
+
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.30
|
|
18
|
+
version: '0.30'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
|
-
- -
|
|
23
|
+
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.30
|
|
25
|
+
version: '0.30'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
27
|
name: red-parquet
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
|
-
- - "
|
|
30
|
+
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
32
|
version: '21.0'
|
|
34
33
|
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
|
-
- - "
|
|
37
|
+
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '21.0'
|
|
41
40
|
description: DSPy datasets provide prebuilt loaders, caching, and schema metadata
|
|
@@ -64,7 +63,6 @@ licenses:
|
|
|
64
63
|
- MIT
|
|
65
64
|
metadata:
|
|
66
65
|
github_repo: git@github.com:vicentereig/dspy.rb
|
|
67
|
-
post_install_message:
|
|
68
66
|
rdoc_options: []
|
|
69
67
|
require_paths:
|
|
70
68
|
- lib
|
|
@@ -79,8 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
79
77
|
- !ruby/object:Gem::Version
|
|
80
78
|
version: '0'
|
|
81
79
|
requirements: []
|
|
82
|
-
rubygems_version: 3.
|
|
83
|
-
signing_key:
|
|
80
|
+
rubygems_version: 3.6.9
|
|
84
81
|
specification_version: 4
|
|
85
82
|
summary: Curated datasets and loaders for DSPy.rb.
|
|
86
83
|
test_files: []
|