ruby_llm-agents 1.3.4 → 2.1.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 +112 -336
- data/app/controllers/concerns/ruby_llm/agents/sortable.rb +0 -1
- data/app/controllers/ruby_llm/agents/agents_controller.rb +5 -56
- data/app/controllers/ruby_llm/agents/dashboard_controller.rb +22 -106
- data/app/controllers/ruby_llm/agents/executions_controller.rb +4 -114
- data/app/controllers/ruby_llm/agents/tenants_controller.rb +30 -2
- data/app/helpers/ruby_llm/agents/application_helper.rb +19 -53
- data/app/models/ruby_llm/agents/execution/analytics.rb +13 -54
- data/app/models/ruby_llm/agents/execution/scopes.rb +61 -14
- data/app/models/ruby_llm/agents/execution.rb +52 -12
- data/app/models/ruby_llm/agents/execution_detail.rb +18 -0
- data/app/models/ruby_llm/agents/tenant/budgetable.rb +132 -24
- data/app/models/ruby_llm/agents/tenant/incrementable.rb +117 -0
- data/app/models/ruby_llm/agents/tenant/resettable.rb +128 -0
- data/app/models/ruby_llm/agents/tenant/trackable.rb +46 -12
- data/app/models/ruby_llm/agents/tenant.rb +2 -3
- data/app/models/ruby_llm/agents/tenant_budget.rb +6 -3
- data/app/services/ruby_llm/agents/agent_registry.rb +6 -112
- data/app/views/layouts/ruby_llm/agents/application.html.erb +89 -252
- data/app/views/ruby_llm/agents/agents/_config_agent.html.erb +71 -218
- data/app/views/ruby_llm/agents/agents/_config_embedder.html.erb +20 -63
- data/app/views/ruby_llm/agents/agents/_config_image_generator.html.erb +44 -131
- data/app/views/ruby_llm/agents/agents/_config_moderator.html.erb +16 -57
- data/app/views/ruby_llm/agents/agents/_config_speaker.html.erb +39 -104
- data/app/views/ruby_llm/agents/agents/_config_transcriber.html.erb +29 -82
- data/app/views/ruby_llm/agents/agents/_empty_state.html.erb +4 -14
- data/app/views/ruby_llm/agents/agents/index.html.erb +105 -274
- data/app/views/ruby_llm/agents/agents/show.html.erb +248 -378
- data/app/views/ruby_llm/agents/dashboard/_action_center.html.erb +29 -52
- data/app/views/ruby_llm/agents/dashboard/_tenant_budget.html.erb +73 -99
- data/app/views/ruby_llm/agents/dashboard/index.html.erb +228 -433
- data/app/views/ruby_llm/agents/executions/_execution.html.erb +1 -1
- data/app/views/ruby_llm/agents/executions/_filters.html.erb +4 -25
- data/app/views/ruby_llm/agents/executions/_list.html.erb +111 -152
- data/app/views/ruby_llm/agents/executions/index.html.erb +5 -7
- data/app/views/ruby_llm/agents/executions/show.html.erb +526 -1037
- data/app/views/ruby_llm/agents/shared/_agent_type_badge.html.erb +5 -21
- data/app/views/ruby_llm/agents/shared/_executions_table.html.erb +70 -191
- data/app/views/ruby_llm/agents/shared/_filter_dropdown.html.erb +16 -44
- data/app/views/ruby_llm/agents/shared/_select_dropdown.html.erb +12 -41
- data/app/views/ruby_llm/agents/shared/_status_badge.html.erb +11 -65
- data/app/views/ruby_llm/agents/shared/_tenant_filter.html.erb +6 -5
- data/app/views/ruby_llm/agents/system_config/show.html.erb +240 -351
- data/app/views/ruby_llm/agents/tenants/_form.html.erb +67 -77
- data/app/views/ruby_llm/agents/tenants/edit.html.erb +7 -9
- data/app/views/ruby_llm/agents/tenants/index.html.erb +100 -122
- data/app/views/ruby_llm/agents/tenants/show.html.erb +146 -336
- data/config/routes.rb +0 -13
- data/lib/generators/ruby_llm_agents/install_generator.rb +13 -17
- data/lib/generators/ruby_llm_agents/migrate_structure_generator.rb +2 -12
- data/lib/generators/ruby_llm_agents/restructure_generator.rb +0 -2
- data/lib/generators/ruby_llm_agents/templates/add_usage_counters_to_tenants_migration.rb.tt +37 -0
- data/lib/generators/ruby_llm_agents/templates/agent.rb.tt +1 -2
- data/lib/generators/ruby_llm_agents/templates/application_agent.rb.tt +1 -1
- data/lib/generators/ruby_llm_agents/templates/application_image_pipeline.rb.tt +0 -1
- data/lib/generators/ruby_llm_agents/templates/create_execution_details_migration.rb.tt +27 -0
- data/lib/generators/ruby_llm_agents/templates/create_tenants_migration.rb.tt +25 -0
- data/lib/generators/ruby_llm_agents/templates/image_pipeline.rb.tt +0 -1
- data/lib/generators/ruby_llm_agents/templates/initializer.rb.tt +33 -12
- data/lib/generators/ruby_llm_agents/templates/migration.rb.tt +40 -71
- data/lib/generators/ruby_llm_agents/templates/remove_agent_version_migration.rb.tt +13 -0
- data/lib/generators/ruby_llm_agents/templates/remove_workflow_columns_migration.rb.tt +19 -0
- data/lib/generators/ruby_llm_agents/templates/skills/AGENTS.md.tt +2 -4
- data/lib/generators/ruby_llm_agents/templates/skills/IMAGE_PIPELINES.md.tt +0 -1
- data/lib/generators/ruby_llm_agents/templates/split_execution_details_migration.rb.tt +232 -0
- data/lib/generators/ruby_llm_agents/upgrade_generator.rb +77 -259
- data/lib/ruby_llm/agents/audio/speaker.rb +0 -1
- data/lib/ruby_llm/agents/audio/transcriber.rb +0 -1
- data/lib/ruby_llm/agents/base_agent.rb +54 -23
- data/lib/ruby_llm/agents/core/base/callbacks.rb +142 -0
- data/lib/ruby_llm/agents/core/base.rb +23 -55
- data/lib/ruby_llm/agents/core/configuration.rb +97 -117
- data/lib/ruby_llm/agents/core/errors.rb +0 -58
- data/lib/ruby_llm/agents/core/instrumentation.rb +157 -110
- data/lib/ruby_llm/agents/core/llm_tenant.rb +8 -7
- data/lib/ruby_llm/agents/core/version.rb +1 -1
- data/lib/ruby_llm/agents/dsl/base.rb +157 -17
- data/lib/ruby_llm/agents/dsl/caching.rb +33 -2
- data/lib/ruby_llm/agents/dsl/reliability.rb +148 -0
- data/lib/ruby_llm/agents/dsl.rb +1 -2
- data/lib/ruby_llm/agents/image/analyzer/execution.rb +1 -2
- data/lib/ruby_llm/agents/image/background_remover/execution.rb +1 -2
- data/lib/ruby_llm/agents/image/concerns/image_operation_dsl.rb +1 -13
- data/lib/ruby_llm/agents/image/concerns/image_operation_execution.rb +2 -2
- data/lib/ruby_llm/agents/image/editor/dsl.rb +0 -14
- data/lib/ruby_llm/agents/image/editor/execution.rb +1 -10
- data/lib/ruby_llm/agents/image/editor.rb +0 -1
- data/lib/ruby_llm/agents/image/generator.rb +0 -21
- data/lib/ruby_llm/agents/image/pipeline/dsl.rb +0 -13
- data/lib/ruby_llm/agents/image/pipeline/execution.rb +0 -1
- data/lib/ruby_llm/agents/image/transformer/dsl.rb +0 -13
- data/lib/ruby_llm/agents/image/transformer/execution.rb +1 -10
- data/lib/ruby_llm/agents/image/transformer.rb +0 -1
- data/lib/ruby_llm/agents/image/upscaler/execution.rb +1 -2
- data/lib/ruby_llm/agents/image/variator/execution.rb +1 -2
- data/lib/ruby_llm/agents/infrastructure/alert_manager.rb +78 -173
- data/lib/ruby_llm/agents/infrastructure/budget/budget_query.rb +66 -2
- data/lib/ruby_llm/agents/infrastructure/budget/spend_recorder.rb +0 -12
- data/lib/ruby_llm/agents/infrastructure/circuit_breaker.rb +10 -13
- data/lib/ruby_llm/agents/infrastructure/execution_logger_job.rb +8 -0
- data/lib/ruby_llm/agents/pipeline/context.rb +0 -1
- data/lib/ruby_llm/agents/pipeline/middleware/budget.rb +28 -4
- data/lib/ruby_llm/agents/pipeline/middleware/cache.rb +3 -10
- data/lib/ruby_llm/agents/pipeline/middleware/instrumentation.rb +88 -55
- data/lib/ruby_llm/agents/pipeline/middleware/tenant.rb +5 -41
- data/lib/ruby_llm/agents/rails/engine.rb +6 -6
- data/lib/ruby_llm/agents/results/base.rb +1 -49
- data/lib/ruby_llm/agents/text/embedder.rb +0 -1
- data/lib/ruby_llm/agents.rb +1 -9
- data/lib/tasks/ruby_llm_agents.rake +34 -0
- metadata +14 -83
- data/app/controllers/ruby_llm/agents/api_configurations_controller.rb +0 -214
- data/app/controllers/ruby_llm/agents/workflows_controller.rb +0 -544
- data/app/mailers/ruby_llm/agents/alert_mailer.rb +0 -84
- data/app/mailers/ruby_llm/agents/application_mailer.rb +0 -28
- data/app/models/ruby_llm/agents/api_configuration.rb +0 -386
- data/app/models/ruby_llm/agents/execution/workflow.rb +0 -170
- data/app/models/ruby_llm/agents/tenant/configurable.rb +0 -135
- data/app/views/ruby_llm/agents/agents/_agent.html.erb +0 -98
- data/app/views/ruby_llm/agents/agents/_version_comparison.html.erb +0 -186
- data/app/views/ruby_llm/agents/agents/_workflow.html.erb +0 -126
- data/app/views/ruby_llm/agents/alert_mailer/alert_notification.html.erb +0 -107
- data/app/views/ruby_llm/agents/alert_mailer/alert_notification.text.erb +0 -18
- data/app/views/ruby_llm/agents/api_configurations/_api_key_field.html.erb +0 -34
- data/app/views/ruby_llm/agents/api_configurations/_form.html.erb +0 -288
- data/app/views/ruby_llm/agents/api_configurations/edit.html.erb +0 -95
- data/app/views/ruby_llm/agents/api_configurations/edit_tenant.html.erb +0 -97
- data/app/views/ruby_llm/agents/api_configurations/show.html.erb +0 -214
- data/app/views/ruby_llm/agents/api_configurations/tenant.html.erb +0 -179
- data/app/views/ruby_llm/agents/dashboard/_agent_comparison.html.erb +0 -73
- data/app/views/ruby_llm/agents/dashboard/_alerts_feed.html.erb +0 -62
- data/app/views/ruby_llm/agents/dashboard/_breaker_strip.html.erb +0 -47
- data/app/views/ruby_llm/agents/dashboard/_budgets_bar.html.erb +0 -75
- data/app/views/ruby_llm/agents/dashboard/_model_comparison.html.erb +0 -56
- data/app/views/ruby_llm/agents/dashboard/_model_cost_breakdown.html.erb +0 -115
- data/app/views/ruby_llm/agents/dashboard/_now_strip.html.erb +0 -59
- data/app/views/ruby_llm/agents/dashboard/_top_errors.html.erb +0 -60
- data/app/views/ruby_llm/agents/executions/_workflow_summary.html.erb +0 -86
- data/app/views/ruby_llm/agents/executions/dry_run.html.erb +0 -149
- data/app/views/ruby_llm/agents/shared/_breadcrumbs.html.erb +0 -48
- data/app/views/ruby_llm/agents/shared/_nav_link.html.erb +0 -27
- data/app/views/ruby_llm/agents/shared/_stat_card.html.erb +0 -14
- data/app/views/ruby_llm/agents/shared/_workflow_type_badge.html.erb +0 -35
- data/app/views/ruby_llm/agents/workflows/_empty_state.html.erb +0 -22
- data/app/views/ruby_llm/agents/workflows/_step_performance.html.erb +0 -228
- data/app/views/ruby_llm/agents/workflows/_structure_dsl.html.erb +0 -539
- data/app/views/ruby_llm/agents/workflows/_structure_parallel.html.erb +0 -76
- data/app/views/ruby_llm/agents/workflows/_structure_pipeline.html.erb +0 -74
- data/app/views/ruby_llm/agents/workflows/_structure_router.html.erb +0 -108
- data/app/views/ruby_llm/agents/workflows/_workflow_diagram.html.erb +0 -920
- data/app/views/ruby_llm/agents/workflows/index.html.erb +0 -179
- data/app/views/ruby_llm/agents/workflows/show.html.erb +0 -467
- data/lib/generators/ruby_llm_agents/api_configuration_generator.rb +0 -100
- data/lib/generators/ruby_llm_agents/templates/add_workflow_migration.rb.tt +0 -38
- data/lib/generators/ruby_llm_agents/templates/application_workflow.rb.tt +0 -48
- data/lib/generators/ruby_llm_agents/templates/create_api_configurations_migration.rb.tt +0 -90
- data/lib/generators/ruby_llm_agents/templates/skills/WORKFLOWS.md.tt +0 -551
- data/lib/ruby_llm/agents/core/base/moderation_dsl.rb +0 -181
- data/lib/ruby_llm/agents/core/base/moderation_execution.rb +0 -274
- data/lib/ruby_llm/agents/core/resolved_config.rb +0 -348
- data/lib/ruby_llm/agents/image/generator/content_policy.rb +0 -95
- data/lib/ruby_llm/agents/infrastructure/redactor.rb +0 -130
- data/lib/ruby_llm/agents/results/moderation_result.rb +0 -158
- data/lib/ruby_llm/agents/text/moderator.rb +0 -237
- data/lib/ruby_llm/agents/workflow/approval.rb +0 -205
- data/lib/ruby_llm/agents/workflow/approval_store.rb +0 -179
- data/lib/ruby_llm/agents/workflow/async.rb +0 -220
- data/lib/ruby_llm/agents/workflow/async_executor.rb +0 -156
- data/lib/ruby_llm/agents/workflow/dsl/executor.rb +0 -467
- data/lib/ruby_llm/agents/workflow/dsl/input_schema.rb +0 -244
- data/lib/ruby_llm/agents/workflow/dsl/iteration_executor.rb +0 -289
- data/lib/ruby_llm/agents/workflow/dsl/parallel_group.rb +0 -107
- data/lib/ruby_llm/agents/workflow/dsl/route_builder.rb +0 -150
- data/lib/ruby_llm/agents/workflow/dsl/schedule_helpers.rb +0 -187
- data/lib/ruby_llm/agents/workflow/dsl/step_config.rb +0 -352
- data/lib/ruby_llm/agents/workflow/dsl/step_executor.rb +0 -415
- data/lib/ruby_llm/agents/workflow/dsl/wait_config.rb +0 -257
- data/lib/ruby_llm/agents/workflow/dsl/wait_executor.rb +0 -317
- data/lib/ruby_llm/agents/workflow/dsl.rb +0 -576
- data/lib/ruby_llm/agents/workflow/instrumentation.rb +0 -249
- data/lib/ruby_llm/agents/workflow/notifiers/base.rb +0 -117
- data/lib/ruby_llm/agents/workflow/notifiers/email.rb +0 -117
- data/lib/ruby_llm/agents/workflow/notifiers/slack.rb +0 -180
- data/lib/ruby_llm/agents/workflow/notifiers/webhook.rb +0 -121
- data/lib/ruby_llm/agents/workflow/notifiers.rb +0 -70
- data/lib/ruby_llm/agents/workflow/orchestrator.rb +0 -416
- data/lib/ruby_llm/agents/workflow/result.rb +0 -592
- data/lib/ruby_llm/agents/workflow/thread_pool.rb +0 -185
- data/lib/ruby_llm/agents/workflow/throttle_manager.rb +0 -206
- data/lib/ruby_llm/agents/workflow/wait_result.rb +0 -213
|
@@ -1,374 +1,184 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
<!-- Back link -->
|
|
2
|
+
<nav class="font-mono text-xs mb-6">
|
|
3
|
+
<%= link_to "← tenants", ruby_llm_agents.tenants_path, class: "text-gray-400 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-300" %>
|
|
4
|
+
</nav>
|
|
5
|
+
|
|
6
|
+
<%
|
|
7
|
+
enforcement = @tenant.effective_enforcement.to_s
|
|
8
|
+
total_executions = @usage_stats[:total_executions]
|
|
9
|
+
total_cost = @usage_stats[:total_cost]
|
|
10
|
+
total_tokens = @usage_stats[:total_tokens]
|
|
11
|
+
success_count = @tenant.executions.where(status: "success").count
|
|
12
|
+
success_rate = total_executions > 0 ? (success_count.to_f / total_executions * 100).round : 100
|
|
13
|
+
|
|
14
|
+
has_any_limit = @tenant.effective_daily_limit || @tenant.effective_monthly_limit ||
|
|
15
|
+
@tenant.effective_daily_token_limit || @tenant.effective_monthly_token_limit
|
|
16
|
+
|
|
17
|
+
has_per_agent = @tenant.per_agent_daily.present? || @tenant.per_agent_monthly.present?
|
|
18
|
+
|
|
19
|
+
# Build config line parts
|
|
20
|
+
config_parts = [@tenant.tenant_id]
|
|
21
|
+
config_parts << enforcement if enforcement != "none"
|
|
22
|
+
config_parts << "daily $#{number_with_precision(@tenant.effective_daily_limit, precision: 2)}" if @tenant.effective_daily_limit
|
|
23
|
+
config_parts << "monthly $#{number_with_precision(@tenant.effective_monthly_limit, precision: 2)}" if @tenant.effective_monthly_limit
|
|
24
|
+
%>
|
|
25
|
+
|
|
26
|
+
<!-- ── tenant header ──────────────── -->
|
|
27
|
+
<div class="flex items-start justify-between gap-8 mb-2">
|
|
28
|
+
<!-- Left: identity -->
|
|
29
|
+
<div class="min-w-0">
|
|
30
|
+
<div class="flex items-center gap-3 mb-1.5">
|
|
31
|
+
<span class="text-[10px] font-medium text-gray-400 dark:text-gray-600 uppercase tracking-widest font-mono"><%= @tenant.display_name %></span>
|
|
32
|
+
<%= link_to edit_tenant_path(@tenant), class: "text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 transition-colors", title: "Edit tenant" do %>
|
|
33
|
+
<svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
34
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
|
|
35
|
+
</svg>
|
|
36
|
+
<% end %>
|
|
37
|
+
<%= render "ruby_llm/agents/shared/doc_link" %>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="font-mono text-xs text-gray-400 dark:text-gray-500 flex items-center gap-1.5 flex-wrap">
|
|
40
|
+
<span class="text-gray-500 dark:text-gray-400"><%= @tenant.tenant_id %></span>
|
|
41
|
+
<% if enforcement != "none" %>
|
|
42
|
+
<span class="text-gray-300 dark:text-gray-700">·</span>
|
|
25
43
|
<%
|
|
26
|
-
|
|
27
|
-
badge_class = case enforcement
|
|
28
|
-
when "hard" then "bg-red-100 dark:bg-red-900/50 text-red-800 dark:text-red-200"
|
|
29
|
-
when "soft" then "bg-yellow-100 dark:bg-yellow-900/50 text-yellow-800 dark:text-yellow-200"
|
|
30
|
-
else "bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400"
|
|
31
|
-
end
|
|
44
|
+
enforcement_badge = enforcement == "hard" ? "badge-error" : "badge-timeout"
|
|
32
45
|
%>
|
|
33
|
-
<span class="
|
|
34
|
-
<%= enforcement.capitalize %> Enforcement
|
|
35
|
-
</span>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
|
|
39
|
-
<div class="flex items-center space-x-3">
|
|
40
|
-
<%= link_to tenant_api_configuration_path(@tenant.tenant_id), class: "inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors" do %>
|
|
41
|
-
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
42
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
|
|
43
|
-
</svg>
|
|
44
|
-
API Keys
|
|
46
|
+
<span class="badge badge-sm <%= enforcement_badge %>"><%= enforcement %></span>
|
|
45
47
|
<% end %>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
<% if @tenant.effective_daily_limit %>
|
|
49
|
+
<span class="text-gray-300 dark:text-gray-700">·</span>
|
|
50
|
+
<span>daily $<%= number_with_precision(@tenant.effective_daily_limit, precision: 2) %></span>
|
|
51
|
+
<% end %>
|
|
52
|
+
<% if @tenant.effective_monthly_limit %>
|
|
53
|
+
<span class="text-gray-300 dark:text-gray-700">·</span>
|
|
54
|
+
<span>monthly $<%= number_with_precision(@tenant.effective_monthly_limit, precision: 2) %></span>
|
|
52
55
|
<% end %>
|
|
53
56
|
</div>
|
|
54
57
|
</div>
|
|
55
|
-
</div>
|
|
56
58
|
|
|
57
|
-
<!--
|
|
58
|
-
<div class="
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</svg>
|
|
67
|
-
</span>
|
|
59
|
+
<!-- Right: stats -->
|
|
60
|
+
<div class="flex-shrink-0 text-right font-mono text-xs text-gray-400 dark:text-gray-500 space-y-1">
|
|
61
|
+
<div class="flex items-center justify-end gap-x-4">
|
|
62
|
+
<span><span class="text-gray-800 dark:text-gray-200"><%= number_with_delimiter(total_executions) %></span> runs</span>
|
|
63
|
+
<span class="<%= success_rate >= 95 ? 'text-green-500' : success_rate >= 80 ? 'text-yellow-500' : 'text-red-500' %>"><%= success_rate %>% ok</span>
|
|
64
|
+
<span><span class="text-gray-800 dark:text-gray-200">$<%= number_with_precision(total_cost, precision: 4) %></span> cost</span>
|
|
65
|
+
</div>
|
|
66
|
+
<div class="flex items-center justify-end gap-x-4 text-gray-500 dark:text-gray-600">
|
|
67
|
+
<span><span class="text-gray-600 dark:text-gray-400"><%= number_with_delimiter(total_tokens) %></span> tokens</span>
|
|
68
68
|
</div>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="border-t border-gray-200 dark:border-gray-800 mb-2"></div>
|
|
72
|
+
|
|
73
|
+
<% if has_any_limit %>
|
|
74
|
+
<!-- ── budget ──────────────────────── -->
|
|
75
|
+
<div class="flex items-center gap-3 mt-6 mb-3">
|
|
76
|
+
<span class="text-[10px] font-medium text-gray-400 dark:text-gray-600 uppercase tracking-widest font-mono">budget</span>
|
|
77
|
+
<div class="flex-1 border-t border-gray-200 dark:border-gray-800"></div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="font-mono text-xs space-y-2">
|
|
72
81
|
<% if @tenant.effective_daily_limit %>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
%>
|
|
83
|
-
<div class="<%= bar_color %> h-1.5 rounded-full transition-all" style="width: <%= pct %>%"></div>
|
|
82
|
+
<%
|
|
83
|
+
pct = @usage_stats[:daily_spend_percentage]
|
|
84
|
+
bar_color = pct >= 90 ? 'bg-red-500' : pct >= 70 ? 'bg-yellow-500' : 'bg-green-500'
|
|
85
|
+
%>
|
|
86
|
+
<div class="flex items-center gap-3">
|
|
87
|
+
<span class="w-28 flex-shrink-0 text-gray-500 dark:text-gray-400">daily cost</span>
|
|
88
|
+
<span class="w-44 flex-shrink-0 text-gray-800 dark:text-gray-200">$<%= number_with_precision(@usage_stats[:daily_spend], precision: 2) %> <span class="text-gray-400 dark:text-gray-600">/ $<%= number_with_precision(@tenant.effective_daily_limit, precision: 2) %></span></span>
|
|
89
|
+
<span class="w-12 flex-shrink-0 text-right text-gray-400 dark:text-gray-600"><%= pct %>%</span>
|
|
90
|
+
<div class="flex-1 bg-gray-200 dark:bg-gray-800 rounded-full h-1">
|
|
91
|
+
<div class="<%= bar_color %> h-1 rounded-full transition-all" style="width: <%= [pct, 100].min %>%"></div>
|
|
84
92
|
</div>
|
|
85
93
|
</div>
|
|
86
|
-
<% else %>
|
|
87
|
-
<p class="text-xs text-gray-400 dark:text-gray-500 mt-1">No limit set</p>
|
|
88
94
|
<% end %>
|
|
89
|
-
</div>
|
|
90
95
|
|
|
91
|
-
<!-- Monthly Spend -->
|
|
92
|
-
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-4">
|
|
93
|
-
<div class="flex items-center justify-between mb-2">
|
|
94
|
-
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wide font-medium">Monthly Spend</p>
|
|
95
|
-
<span class="text-amber-500">
|
|
96
|
-
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
97
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
98
|
-
</svg>
|
|
99
|
-
</span>
|
|
100
|
-
</div>
|
|
101
|
-
<p class="text-xl font-semibold text-gray-900 dark:text-gray-100">
|
|
102
|
-
$<%= number_with_precision(@usage_stats[:monthly_spend], precision: 4) %>
|
|
103
|
-
</p>
|
|
104
96
|
<% if @tenant.effective_monthly_limit %>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
%>
|
|
115
|
-
<div class="<%= bar_color %> h-1.5 rounded-full transition-all" style="width: <%= pct %>%"></div>
|
|
97
|
+
<%
|
|
98
|
+
pct = @usage_stats[:monthly_spend_percentage]
|
|
99
|
+
bar_color = pct >= 90 ? 'bg-red-500' : pct >= 70 ? 'bg-yellow-500' : 'bg-green-500'
|
|
100
|
+
%>
|
|
101
|
+
<div class="flex items-center gap-3">
|
|
102
|
+
<span class="w-28 flex-shrink-0 text-gray-500 dark:text-gray-400">monthly cost</span>
|
|
103
|
+
<span class="w-44 flex-shrink-0 text-gray-800 dark:text-gray-200">$<%= number_with_precision(@usage_stats[:monthly_spend], precision: 2) %> <span class="text-gray-400 dark:text-gray-600">/ $<%= number_with_precision(@tenant.effective_monthly_limit, precision: 2) %></span></span>
|
|
104
|
+
<span class="w-12 flex-shrink-0 text-right text-gray-400 dark:text-gray-600"><%= pct %>%</span>
|
|
105
|
+
<div class="flex-1 bg-gray-200 dark:bg-gray-800 rounded-full h-1">
|
|
106
|
+
<div class="<%= bar_color %> h-1 rounded-full transition-all" style="width: <%= [pct, 100].min %>%"></div>
|
|
116
107
|
</div>
|
|
117
108
|
</div>
|
|
118
|
-
<% else %>
|
|
119
|
-
<p class="text-xs text-gray-400 dark:text-gray-500 mt-1">No limit set</p>
|
|
120
109
|
<% end %>
|
|
121
|
-
</div>
|
|
122
110
|
|
|
123
|
-
<!-- Daily Tokens -->
|
|
124
|
-
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-4">
|
|
125
|
-
<div class="flex items-center justify-between mb-2">
|
|
126
|
-
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wide font-medium">Daily Tokens</p>
|
|
127
|
-
<span class="text-indigo-500">
|
|
128
|
-
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
129
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 20l4-16m2 16l4-16M6 9h14M4 15h14"/>
|
|
130
|
-
</svg>
|
|
131
|
-
</span>
|
|
132
|
-
</div>
|
|
133
|
-
<p class="text-xl font-semibold text-gray-900 dark:text-gray-100">
|
|
134
|
-
<%= number_with_delimiter(@usage_stats[:daily_tokens]) %>
|
|
135
|
-
</p>
|
|
136
111
|
<% if @tenant.effective_daily_token_limit %>
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
%>
|
|
147
|
-
<div class="<%= bar_color %> h-1.5 rounded-full transition-all" style="width: <%= pct %>%"></div>
|
|
112
|
+
<%
|
|
113
|
+
pct = @usage_stats[:daily_token_percentage]
|
|
114
|
+
bar_color = pct >= 90 ? 'bg-red-500' : pct >= 70 ? 'bg-yellow-500' : 'bg-green-500'
|
|
115
|
+
%>
|
|
116
|
+
<div class="flex items-center gap-3">
|
|
117
|
+
<span class="w-28 flex-shrink-0 text-gray-500 dark:text-gray-400">daily tokens</span>
|
|
118
|
+
<span class="w-44 flex-shrink-0 text-gray-800 dark:text-gray-200"><%= number_with_delimiter(@usage_stats[:daily_tokens]) %> <span class="text-gray-400 dark:text-gray-600">/ <%= number_with_delimiter(@tenant.effective_daily_token_limit) %></span></span>
|
|
119
|
+
<span class="w-12 flex-shrink-0 text-right text-gray-400 dark:text-gray-600"><%= pct %>%</span>
|
|
120
|
+
<div class="flex-1 bg-gray-200 dark:bg-gray-800 rounded-full h-1">
|
|
121
|
+
<div class="<%= bar_color %> h-1 rounded-full transition-all" style="width: <%= [pct, 100].min %>%"></div>
|
|
148
122
|
</div>
|
|
149
123
|
</div>
|
|
150
|
-
<% else %>
|
|
151
|
-
<p class="text-xs text-gray-400 dark:text-gray-500 mt-1">No limit set</p>
|
|
152
124
|
<% end %>
|
|
153
|
-
</div>
|
|
154
125
|
|
|
155
|
-
<!-- Monthly Tokens -->
|
|
156
|
-
<div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-4">
|
|
157
|
-
<div class="flex items-center justify-between mb-2">
|
|
158
|
-
<p class="text-xs text-gray-500 dark:text-gray-400 uppercase tracking-wide font-medium">Monthly Tokens</p>
|
|
159
|
-
<span class="text-indigo-500">
|
|
160
|
-
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
161
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 20l4-16m2 16l4-16M6 9h14M4 15h14"/>
|
|
162
|
-
</svg>
|
|
163
|
-
</span>
|
|
164
|
-
</div>
|
|
165
|
-
<p class="text-xl font-semibold text-gray-900 dark:text-gray-100">
|
|
166
|
-
<%= number_with_delimiter(@usage_stats[:monthly_tokens]) %>
|
|
167
|
-
</p>
|
|
168
126
|
<% if @tenant.effective_monthly_token_limit %>
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
%>
|
|
179
|
-
<div class="<%= bar_color %> h-1.5 rounded-full transition-all" style="width: <%= pct %>%"></div>
|
|
127
|
+
<%
|
|
128
|
+
pct = @usage_stats[:monthly_token_percentage]
|
|
129
|
+
bar_color = pct >= 90 ? 'bg-red-500' : pct >= 70 ? 'bg-yellow-500' : 'bg-green-500'
|
|
130
|
+
%>
|
|
131
|
+
<div class="flex items-center gap-3">
|
|
132
|
+
<span class="w-28 flex-shrink-0 text-gray-500 dark:text-gray-400">monthly tokens</span>
|
|
133
|
+
<span class="w-44 flex-shrink-0 text-gray-800 dark:text-gray-200"><%= number_with_delimiter(@usage_stats[:monthly_tokens]) %> <span class="text-gray-400 dark:text-gray-600">/ <%= number_with_delimiter(@tenant.effective_monthly_token_limit) %></span></span>
|
|
134
|
+
<span class="w-12 flex-shrink-0 text-right text-gray-400 dark:text-gray-600"><%= pct %>%</span>
|
|
135
|
+
<div class="flex-1 bg-gray-200 dark:bg-gray-800 rounded-full h-1">
|
|
136
|
+
<div class="<%= bar_color %> h-1 rounded-full transition-all" style="width: <%= [pct, 100].min %>%"></div>
|
|
180
137
|
</div>
|
|
181
138
|
</div>
|
|
182
|
-
<% else %>
|
|
183
|
-
<p class="text-xs text-gray-400 dark:text-gray-500 mt-1">No limit set</p>
|
|
184
139
|
<% end %>
|
|
185
140
|
</div>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
<!-- Summary Stats -->
|
|
189
|
-
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
|
|
190
|
-
<%= render "ruby_llm/agents/shared/stat_card",
|
|
191
|
-
title: "Total Executions",
|
|
192
|
-
value: number_with_delimiter(@usage_stats[:total_executions]),
|
|
193
|
-
icon: "M13 10V3L4 14h7v7l9-11h-7z",
|
|
194
|
-
icon_color: "text-blue-500" %>
|
|
195
|
-
|
|
196
|
-
<%= render "ruby_llm/agents/shared/stat_card",
|
|
197
|
-
title: "Total Cost",
|
|
198
|
-
value: "$#{number_with_precision(@usage_stats[:total_cost], precision: 4)}",
|
|
199
|
-
icon: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
|
|
200
|
-
icon_color: "text-amber-500" %>
|
|
201
|
-
|
|
202
|
-
<%= render "ruby_llm/agents/shared/stat_card",
|
|
203
|
-
title: "Total Tokens",
|
|
204
|
-
value: number_with_delimiter(@usage_stats[:total_tokens]),
|
|
205
|
-
icon: "M7 20l4-16m2 16l4-16M6 9h14M4 15h14",
|
|
206
|
-
icon_color: "text-indigo-500" %>
|
|
207
|
-
</div>
|
|
208
|
-
|
|
209
|
-
<!-- Budget Configuration -->
|
|
210
|
-
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6 mb-6">
|
|
211
|
-
<h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4">Budget Configuration</h3>
|
|
212
|
-
|
|
213
|
-
<div class="grid grid-cols-2 md:grid-cols-4 gap-6">
|
|
214
|
-
<div>
|
|
215
|
-
<p class="text-sm text-gray-500 dark:text-gray-400">Daily Limit (USD)</p>
|
|
216
|
-
<p class="font-medium text-gray-900 dark:text-gray-100 mt-1">
|
|
217
|
-
<% if @tenant.effective_daily_limit %>
|
|
218
|
-
$<%= number_with_precision(@tenant.effective_daily_limit, precision: 2) %>
|
|
219
|
-
<% else %>
|
|
220
|
-
<span class="text-gray-400 dark:text-gray-500">Not set</span>
|
|
221
|
-
<% end %>
|
|
222
|
-
</p>
|
|
223
|
-
</div>
|
|
224
|
-
|
|
225
|
-
<div>
|
|
226
|
-
<p class="text-sm text-gray-500 dark:text-gray-400">Monthly Limit (USD)</p>
|
|
227
|
-
<p class="font-medium text-gray-900 dark:text-gray-100 mt-1">
|
|
228
|
-
<% if @tenant.effective_monthly_limit %>
|
|
229
|
-
$<%= number_with_precision(@tenant.effective_monthly_limit, precision: 2) %>
|
|
230
|
-
<% else %>
|
|
231
|
-
<span class="text-gray-400 dark:text-gray-500">Not set</span>
|
|
232
|
-
<% end %>
|
|
233
|
-
</p>
|
|
234
|
-
</div>
|
|
235
|
-
|
|
236
|
-
<div>
|
|
237
|
-
<p class="text-sm text-gray-500 dark:text-gray-400">Daily Token Limit</p>
|
|
238
|
-
<p class="font-medium text-gray-900 dark:text-gray-100 mt-1">
|
|
239
|
-
<% if @tenant.effective_daily_token_limit %>
|
|
240
|
-
<%= number_with_delimiter(@tenant.effective_daily_token_limit) %>
|
|
241
|
-
<% else %>
|
|
242
|
-
<span class="text-gray-400 dark:text-gray-500">Not set</span>
|
|
243
|
-
<% end %>
|
|
244
|
-
</p>
|
|
245
|
-
</div>
|
|
141
|
+
<% end %>
|
|
246
142
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
<% else %>
|
|
253
|
-
<span class="text-gray-400 dark:text-gray-500">Not set</span>
|
|
254
|
-
<% end %>
|
|
255
|
-
</p>
|
|
256
|
-
</div>
|
|
143
|
+
<% if has_per_agent %>
|
|
144
|
+
<!-- ── config ──────────────────────── -->
|
|
145
|
+
<div class="flex items-center gap-3 mt-6 mb-3">
|
|
146
|
+
<span class="text-[10px] font-medium text-gray-400 dark:text-gray-600 uppercase tracking-widest font-mono">config</span>
|
|
147
|
+
<div class="flex-1 border-t border-gray-200 dark:border-gray-800"></div>
|
|
257
148
|
</div>
|
|
258
149
|
|
|
259
|
-
<div class="
|
|
260
|
-
<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
<span class="text-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
</span>
|
|
275
|
-
</p>
|
|
276
|
-
</div>
|
|
277
|
-
|
|
278
|
-
<div>
|
|
279
|
-
<p class="text-sm text-gray-500 dark:text-gray-400">Inherit Global Defaults</p>
|
|
280
|
-
<p class="font-medium text-gray-900 dark:text-gray-100 mt-1">
|
|
281
|
-
<%= @tenant.inherit_global_defaults ? "Yes" : "No" %>
|
|
282
|
-
</p>
|
|
283
|
-
</div>
|
|
150
|
+
<div class="font-mono text-xs">
|
|
151
|
+
<span class="text-gray-400 dark:text-gray-600">per-agent limits:</span>
|
|
152
|
+
<div class="mt-1 space-y-0.5 pl-2">
|
|
153
|
+
<% (@tenant.per_agent_daily || {}).each do |agent, limit| %>
|
|
154
|
+
<div class="flex items-center gap-2">
|
|
155
|
+
<span class="text-gray-900 dark:text-gray-200"><%= agent %></span>
|
|
156
|
+
<span class="text-gray-400 dark:text-gray-600">daily $<%= number_with_precision(limit, precision: 2) %></span>
|
|
157
|
+
</div>
|
|
158
|
+
<% end %>
|
|
159
|
+
<% (@tenant.per_agent_monthly || {}).each do |agent, limit| %>
|
|
160
|
+
<div class="flex items-center gap-2">
|
|
161
|
+
<span class="text-gray-900 dark:text-gray-200"><%= agent %></span>
|
|
162
|
+
<span class="text-gray-400 dark:text-gray-600">monthly $<%= number_with_precision(limit, precision: 2) %></span>
|
|
163
|
+
</div>
|
|
164
|
+
<% end %>
|
|
284
165
|
</div>
|
|
285
166
|
</div>
|
|
167
|
+
<% end %>
|
|
286
168
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
<div class="space-y-2">
|
|
292
|
-
<% (@tenant.per_agent_daily || {}).each do |agent, limit| %>
|
|
293
|
-
<div class="flex items-center text-sm">
|
|
294
|
-
<code class="bg-gray-100 dark:bg-gray-700 dark:text-gray-200 px-2 py-0.5 rounded font-mono">
|
|
295
|
-
<%= agent %>
|
|
296
|
-
</code>
|
|
297
|
-
<span class="ml-2 text-gray-600 dark:text-gray-300">
|
|
298
|
-
Daily: $<%= number_with_precision(limit, precision: 2) %>
|
|
299
|
-
</span>
|
|
300
|
-
</div>
|
|
301
|
-
<% end %>
|
|
302
|
-
|
|
303
|
-
<% (@tenant.per_agent_monthly || {}).each do |agent, limit| %>
|
|
304
|
-
<div class="flex items-center text-sm">
|
|
305
|
-
<code class="bg-gray-100 dark:bg-gray-700 dark:text-gray-200 px-2 py-0.5 rounded font-mono">
|
|
306
|
-
<%= agent %>
|
|
307
|
-
</code>
|
|
308
|
-
<span class="ml-2 text-gray-600 dark:text-gray-300">
|
|
309
|
-
Monthly: $<%= number_with_precision(limit, precision: 2) %>
|
|
310
|
-
</span>
|
|
311
|
-
</div>
|
|
312
|
-
<% end %>
|
|
313
|
-
</div>
|
|
314
|
-
</div>
|
|
315
|
-
<% end %>
|
|
169
|
+
<!-- ── recent executions ──────────────────── -->
|
|
170
|
+
<div class="flex items-center gap-3 mt-6 mb-3">
|
|
171
|
+
<span class="text-[10px] font-medium text-gray-400 dark:text-gray-600 uppercase tracking-widest font-mono">recent executions</span>
|
|
172
|
+
<div class="flex-1 border-t border-gray-200 dark:border-gray-800"></div>
|
|
316
173
|
</div>
|
|
317
174
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
<%= link_to ruby_llm_agents.executions_path(tenant_id: @tenant.tenant_id),
|
|
323
|
-
|
|
175
|
+
<%= render "ruby_llm/agents/shared/executions_table", executions: @executions, pagination: { total_pages: 0, current_page: 1, total_count: 0, per_page: 10 } %>
|
|
176
|
+
|
|
177
|
+
<% if total_executions > 0 %>
|
|
178
|
+
<div class="mt-3 font-mono text-xs">
|
|
179
|
+
<%= link_to ruby_llm_agents.executions_path(tenant_id: @tenant.tenant_id),
|
|
180
|
+
class: "text-gray-400 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-300" do %>
|
|
181
|
+
show all <%= number_with_delimiter(total_executions) %> executions →
|
|
324
182
|
<% end %>
|
|
325
183
|
</div>
|
|
326
|
-
|
|
327
|
-
<% if @executions.empty? %>
|
|
328
|
-
<p class="text-gray-500 dark:text-gray-400 text-sm">No executions found for this tenant.</p>
|
|
329
|
-
<% else %>
|
|
330
|
-
<div class="overflow-x-auto">
|
|
331
|
-
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
|
|
332
|
-
<thead>
|
|
333
|
-
<tr>
|
|
334
|
-
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Agent</th>
|
|
335
|
-
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Status</th>
|
|
336
|
-
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Cost</th>
|
|
337
|
-
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Tokens</th>
|
|
338
|
-
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">Time</th>
|
|
339
|
-
</tr>
|
|
340
|
-
</thead>
|
|
341
|
-
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
|
|
342
|
-
<% @executions.each do |execution| %>
|
|
343
|
-
<tr class="hover:bg-gray-50 dark:hover:bg-gray-700/50 cursor-pointer" data-href="<%= ruby_llm_agents.execution_path(execution) %>">
|
|
344
|
-
<td class="px-4 py-3 whitespace-nowrap">
|
|
345
|
-
<span class="text-sm font-medium text-gray-900 dark:text-gray-100"><%= execution.agent_type.gsub(/Agent$/, '') %></span>
|
|
346
|
-
</td>
|
|
347
|
-
<td class="px-4 py-3 whitespace-nowrap">
|
|
348
|
-
<%
|
|
349
|
-
status_class = case execution.status
|
|
350
|
-
when "success" then "badge-success"
|
|
351
|
-
when "error" then "badge-error"
|
|
352
|
-
when "running" then "badge-running"
|
|
353
|
-
when "timeout" then "badge-timeout"
|
|
354
|
-
else "bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400"
|
|
355
|
-
end
|
|
356
|
-
%>
|
|
357
|
-
<span class="badge <%= status_class %>"><%= execution.status %></span>
|
|
358
|
-
</td>
|
|
359
|
-
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">
|
|
360
|
-
$<%= number_with_precision(execution.total_cost || 0, precision: 6) %>
|
|
361
|
-
</td>
|
|
362
|
-
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900 dark:text-gray-100">
|
|
363
|
-
<%= number_with_delimiter(execution.total_tokens || 0) %>
|
|
364
|
-
</td>
|
|
365
|
-
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
|
|
366
|
-
<%= time_ago_in_words(execution.created_at) %> ago
|
|
367
|
-
</td>
|
|
368
|
-
</tr>
|
|
369
|
-
<% end %>
|
|
370
|
-
</tbody>
|
|
371
|
-
</table>
|
|
372
|
-
</div>
|
|
373
|
-
<% end %>
|
|
374
|
-
</div>
|
|
184
|
+
<% end %>
|
data/config/routes.rb
CHANGED
|
@@ -5,29 +5,16 @@ RubyLLM::Agents::Engine.routes.draw do
|
|
|
5
5
|
get "chart_data", to: "dashboard#chart_data"
|
|
6
6
|
|
|
7
7
|
resources :agents, only: [:index, :show]
|
|
8
|
-
resources :workflows, only: [:index, :show]
|
|
9
8
|
|
|
10
9
|
resources :executions, only: [:index, :show] do
|
|
11
10
|
collection do
|
|
12
11
|
get :search
|
|
13
12
|
get :export
|
|
14
13
|
end
|
|
15
|
-
member do
|
|
16
|
-
post :rerun
|
|
17
|
-
end
|
|
18
14
|
end
|
|
19
15
|
|
|
20
16
|
resources :tenants, only: [:index, :show, :edit, :update]
|
|
21
17
|
|
|
22
|
-
# Global API Configuration
|
|
23
|
-
resource :api_configuration, only: [:show, :edit, :update]
|
|
24
|
-
|
|
25
|
-
# Tenant API Configurations
|
|
26
|
-
get "tenants/:tenant_id/api_configuration", to: "api_configurations#tenant", as: :tenant_api_configuration
|
|
27
|
-
get "tenants/:tenant_id/api_configuration/edit", to: "api_configurations#edit_tenant", as: :edit_tenant_api_configuration
|
|
28
|
-
patch "tenants/:tenant_id/api_configuration", to: "api_configurations#update_tenant"
|
|
29
|
-
post "api_configuration/test_connection", to: "api_configurations#test_connection", as: :test_api_connection
|
|
30
|
-
|
|
31
18
|
# Redirect old analytics route to dashboard
|
|
32
19
|
get "analytics", to: redirect("/")
|
|
33
20
|
resource :system_config, only: [:show], controller: "system_config"
|