ruby_llm-agents 3.0.0 → 3.2.0
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 +1 -0
- data/app/controllers/ruby_llm/agents/agents_controller.rb +16 -14
- data/app/controllers/ruby_llm/agents/dashboard_controller.rb +20 -20
- data/app/controllers/ruby_llm/agents/executions_controller.rb +5 -7
- data/app/helpers/ruby_llm/agents/application_helper.rb +57 -58
- data/app/models/ruby_llm/agents/execution/analytics.rb +27 -27
- data/app/models/ruby_llm/agents/execution/scopes.rb +4 -6
- data/app/models/ruby_llm/agents/execution.rb +26 -26
- data/app/models/ruby_llm/agents/tenant/budgetable.rb +16 -10
- data/app/models/ruby_llm/agents/tenant/resettable.rb +12 -12
- data/app/models/ruby_llm/agents/tenant/trackable.rb +7 -7
- data/app/services/ruby_llm/agents/agent_registry.rb +6 -6
- data/app/views/layouts/ruby_llm/agents/application.html.erb +142 -11
- data/app/views/ruby_llm/agents/agents/show.html.erb +10 -10
- data/app/views/ruby_llm/agents/dashboard/index.html.erb +10 -10
- data/app/views/ruby_llm/agents/executions/show.html.erb +13 -0
- data/lib/generators/ruby_llm_agents/agent_generator.rb +4 -4
- data/lib/generators/ruby_llm_agents/background_remover_generator.rb +6 -6
- data/lib/generators/ruby_llm_agents/embedder_generator.rb +4 -4
- data/lib/generators/ruby_llm_agents/image_analyzer_generator.rb +7 -7
- data/lib/generators/ruby_llm_agents/image_editor_generator.rb +4 -4
- data/lib/generators/ruby_llm_agents/image_generator_generator.rb +6 -6
- data/lib/generators/ruby_llm_agents/image_pipeline_generator.rb +9 -9
- data/lib/generators/ruby_llm_agents/image_transformer_generator.rb +6 -6
- data/lib/generators/ruby_llm_agents/image_upscaler_generator.rb +4 -4
- data/lib/generators/ruby_llm_agents/image_variator_generator.rb +4 -4
- data/lib/generators/ruby_llm_agents/install_generator.rb +3 -3
- data/lib/generators/ruby_llm_agents/migrate_structure_generator.rb +4 -4
- data/lib/generators/ruby_llm_agents/multi_tenancy_generator.rb +2 -2
- data/lib/generators/ruby_llm_agents/restructure_generator.rb +13 -13
- data/lib/generators/ruby_llm_agents/speaker_generator.rb +6 -6
- data/lib/generators/ruby_llm_agents/templates/add_assistant_prompt_migration.rb.tt +9 -0
- data/lib/generators/ruby_llm_agents/templates/split_execution_details_migration.rb.tt +2 -1
- data/lib/generators/ruby_llm_agents/transcriber_generator.rb +4 -4
- data/lib/generators/ruby_llm_agents/upgrade_generator.rb +22 -3
- data/lib/ruby_llm/agents/audio/speaker.rb +40 -31
- data/lib/ruby_llm/agents/audio/speech_client.rb +328 -0
- data/lib/ruby_llm/agents/audio/speech_pricing.rb +273 -0
- data/lib/ruby_llm/agents/audio/transcriber.rb +33 -33
- data/lib/ruby_llm/agents/base_agent.rb +16 -15
- data/lib/ruby_llm/agents/core/base/callbacks.rb +3 -3
- data/lib/ruby_llm/agents/core/configuration.rb +86 -73
- data/lib/ruby_llm/agents/core/errors.rb +27 -2
- data/lib/ruby_llm/agents/core/instrumentation.rb +101 -65
- data/lib/ruby_llm/agents/core/llm_tenant.rb +7 -7
- data/lib/ruby_llm/agents/core/version.rb +1 -1
- data/lib/ruby_llm/agents/dsl/base.rb +3 -3
- data/lib/ruby_llm/agents/dsl/reliability.rb +9 -9
- data/lib/ruby_llm/agents/image/analyzer/dsl.rb +1 -1
- data/lib/ruby_llm/agents/image/analyzer/execution.rb +4 -4
- data/lib/ruby_llm/agents/image/background_remover/dsl.rb +1 -1
- data/lib/ruby_llm/agents/image/background_remover/execution.rb +3 -3
- data/lib/ruby_llm/agents/image/concerns/image_operation_execution.rb +8 -8
- data/lib/ruby_llm/agents/image/editor/execution.rb +1 -1
- data/lib/ruby_llm/agents/image/generator/pricing.rb +9 -10
- data/lib/ruby_llm/agents/image/generator.rb +6 -6
- data/lib/ruby_llm/agents/image/pipeline/dsl.rb +6 -6
- data/lib/ruby_llm/agents/image/pipeline/execution.rb +9 -9
- data/lib/ruby_llm/agents/image/pipeline.rb +1 -1
- data/lib/ruby_llm/agents/image/transformer/execution.rb +1 -1
- data/lib/ruby_llm/agents/image/upscaler/dsl.rb +1 -1
- data/lib/ruby_llm/agents/image/upscaler/execution.rb +3 -5
- data/lib/ruby_llm/agents/image/variator/execution.rb +1 -1
- data/lib/ruby_llm/agents/infrastructure/alert_manager.rb +4 -4
- data/lib/ruby_llm/agents/infrastructure/attempt_tracker.rb +4 -4
- data/lib/ruby_llm/agents/infrastructure/budget/budget_query.rb +9 -9
- data/lib/ruby_llm/agents/infrastructure/budget/config_resolver.rb +3 -3
- data/lib/ruby_llm/agents/infrastructure/budget/forecaster.rb +1 -1
- data/lib/ruby_llm/agents/infrastructure/budget/spend_recorder.rb +17 -17
- data/lib/ruby_llm/agents/infrastructure/circuit_breaker.rb +1 -0
- data/lib/ruby_llm/agents/infrastructure/execution_logger_job.rb +1 -1
- data/lib/ruby_llm/agents/infrastructure/reliability.rb +6 -6
- data/lib/ruby_llm/agents/pipeline/builder.rb +11 -11
- data/lib/ruby_llm/agents/pipeline/middleware/budget.rb +3 -3
- data/lib/ruby_llm/agents/pipeline/middleware/cache.rb +4 -4
- data/lib/ruby_llm/agents/pipeline/middleware/instrumentation.rb +62 -21
- data/lib/ruby_llm/agents/pipeline/middleware/reliability.rb +2 -3
- data/lib/ruby_llm/agents/pipeline/middleware/tenant.rb +82 -4
- data/lib/ruby_llm/agents/results/background_removal_result.rb +6 -6
- data/lib/ruby_llm/agents/results/embedding_result.rb +15 -15
- data/lib/ruby_llm/agents/results/image_analysis_result.rb +7 -7
- data/lib/ruby_llm/agents/results/image_edit_result.rb +4 -4
- data/lib/ruby_llm/agents/results/image_generation_result.rb +5 -5
- data/lib/ruby_llm/agents/results/image_pipeline_result.rb +4 -4
- data/lib/ruby_llm/agents/results/image_transform_result.rb +4 -4
- data/lib/ruby_llm/agents/results/image_upscale_result.rb +5 -5
- data/lib/ruby_llm/agents/results/image_variation_result.rb +4 -4
- data/lib/ruby_llm/agents/results/transcription_result.rb +1 -1
- data/lib/ruby_llm/agents/text/embedder.rb +13 -13
- metadata +4 -1
|
@@ -117,19 +117,19 @@ module RubyLLM
|
|
|
117
117
|
|
|
118
118
|
def default_embedding_model
|
|
119
119
|
RubyLLM::Agents.configuration.default_embedding_model
|
|
120
|
-
rescue
|
|
120
|
+
rescue
|
|
121
121
|
"text-embedding-3-small"
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
def default_embedding_dimensions
|
|
125
125
|
RubyLLM::Agents.configuration.default_embedding_dimensions
|
|
126
|
-
rescue
|
|
126
|
+
rescue
|
|
127
127
|
nil
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
def default_embedding_batch_size
|
|
131
131
|
RubyLLM::Agents.configuration.default_embedding_batch_size
|
|
132
|
-
rescue
|
|
132
|
+
rescue
|
|
133
133
|
100
|
|
134
134
|
end
|
|
135
135
|
end
|
|
@@ -333,7 +333,7 @@ module RubyLLM
|
|
|
333
333
|
def execute_batch(texts, context = nil)
|
|
334
334
|
preprocessed = texts.map { |t| preprocess(t) }
|
|
335
335
|
|
|
336
|
-
embed_options = {
|
|
336
|
+
embed_options = {model: context&.model || resolved_model}
|
|
337
337
|
embed_options[:dimensions] = resolved_dimensions if resolved_dimensions
|
|
338
338
|
|
|
339
339
|
response = RubyLLM.embed(preprocessed, **embed_options)
|
|
@@ -405,15 +405,15 @@ module RubyLLM
|
|
|
405
405
|
model_name = response.model.to_s
|
|
406
406
|
|
|
407
407
|
price_per_million = case model_name
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
408
|
+
when /text-embedding-3-small/
|
|
409
|
+
0.02
|
|
410
|
+
when /text-embedding-3-large/
|
|
411
|
+
0.13
|
|
412
|
+
when /text-embedding-ada/
|
|
413
|
+
0.10
|
|
414
|
+
else
|
|
415
|
+
0.02 # Default to small pricing
|
|
416
|
+
end
|
|
417
417
|
|
|
418
418
|
(tokens / 1_000_000.0) * price_per_million
|
|
419
419
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_llm-agents
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- adham90
|
|
@@ -146,6 +146,7 @@ files:
|
|
|
146
146
|
- lib/generators/ruby_llm_agents/multi_tenancy_generator.rb
|
|
147
147
|
- lib/generators/ruby_llm_agents/restructure_generator.rb
|
|
148
148
|
- lib/generators/ruby_llm_agents/speaker_generator.rb
|
|
149
|
+
- lib/generators/ruby_llm_agents/templates/add_assistant_prompt_migration.rb.tt
|
|
149
150
|
- lib/generators/ruby_llm_agents/templates/add_attempts_migration.rb.tt
|
|
150
151
|
- lib/generators/ruby_llm_agents/templates/add_caching_migration.rb.tt
|
|
151
152
|
- lib/generators/ruby_llm_agents/templates/add_execution_type_migration.rb.tt
|
|
@@ -208,6 +209,8 @@ files:
|
|
|
208
209
|
- lib/ruby_llm-agents.rb
|
|
209
210
|
- lib/ruby_llm/agents.rb
|
|
210
211
|
- lib/ruby_llm/agents/audio/speaker.rb
|
|
212
|
+
- lib/ruby_llm/agents/audio/speech_client.rb
|
|
213
|
+
- lib/ruby_llm/agents/audio/speech_pricing.rb
|
|
211
214
|
- lib/ruby_llm/agents/audio/transcriber.rb
|
|
212
215
|
- lib/ruby_llm/agents/base_agent.rb
|
|
213
216
|
- lib/ruby_llm/agents/core/base.rb
|