raif 1.2.2 → 1.4.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.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -5
  3. data/app/assets/builds/raif.css +4 -1
  4. data/app/assets/builds/raif_admin.css +13 -1
  5. data/app/assets/javascript/raif/controllers/conversations_controller.js +1 -1
  6. data/app/assets/stylesheets/raif/admin/conversation.scss +16 -0
  7. data/app/assets/stylesheets/raif/conversations.scss +3 -0
  8. data/app/assets/stylesheets/raif.scss +2 -1
  9. data/app/controllers/raif/admin/application_controller.rb +16 -0
  10. data/app/controllers/raif/admin/configs_controller.rb +94 -0
  11. data/app/controllers/raif/admin/model_completions_controller.rb +18 -1
  12. data/app/controllers/raif/admin/model_tool_invocations_controller.rb +7 -1
  13. data/app/controllers/raif/admin/stats/model_tool_invocations_controller.rb +21 -0
  14. data/app/controllers/raif/admin/stats/tasks_controller.rb +15 -6
  15. data/app/controllers/raif/admin/stats_controller.rb +32 -3
  16. data/app/controllers/raif/conversation_entries_controller.rb +1 -0
  17. data/app/controllers/raif/conversations_controller.rb +10 -2
  18. data/app/jobs/raif/conversation_entry_job.rb +8 -6
  19. data/app/models/raif/admin/task_stat.rb +7 -0
  20. data/app/models/raif/agent.rb +63 -2
  21. data/app/models/raif/agents/native_tool_calling_agent.rb +101 -56
  22. data/app/models/raif/application_record.rb +18 -0
  23. data/app/models/raif/concerns/agent_inference_stats.rb +35 -0
  24. data/app/models/raif/concerns/has_llm.rb +1 -1
  25. data/app/models/raif/concerns/json_schema_definition.rb +40 -5
  26. data/app/models/raif/concerns/llms/anthropic/message_formatting.rb +28 -0
  27. data/app/models/raif/concerns/llms/anthropic/response_tool_calls.rb +24 -0
  28. data/app/models/raif/concerns/llms/anthropic/tool_formatting.rb +4 -0
  29. data/app/models/raif/concerns/llms/bedrock/message_formatting.rb +36 -0
  30. data/app/models/raif/concerns/llms/bedrock/response_tool_calls.rb +26 -0
  31. data/app/models/raif/concerns/llms/bedrock/tool_formatting.rb +4 -0
  32. data/app/models/raif/concerns/llms/google/message_formatting.rb +109 -0
  33. data/app/models/raif/concerns/llms/google/response_tool_calls.rb +32 -0
  34. data/app/models/raif/concerns/llms/google/tool_formatting.rb +72 -0
  35. data/app/models/raif/concerns/llms/message_formatting.rb +11 -5
  36. data/app/models/raif/concerns/llms/open_ai/json_schema_validation.rb +3 -3
  37. data/app/models/raif/concerns/llms/open_ai_completions/message_formatting.rb +22 -0
  38. data/app/models/raif/concerns/llms/open_ai_completions/response_tool_calls.rb +22 -0
  39. data/app/models/raif/concerns/llms/open_ai_completions/tool_formatting.rb +4 -0
  40. data/app/models/raif/concerns/llms/open_ai_responses/message_formatting.rb +17 -0
  41. data/app/models/raif/concerns/llms/open_ai_responses/response_tool_calls.rb +26 -0
  42. data/app/models/raif/concerns/llms/open_ai_responses/tool_formatting.rb +4 -0
  43. data/app/models/raif/concerns/run_with.rb +127 -0
  44. data/app/models/raif/conversation.rb +96 -9
  45. data/app/models/raif/conversation_entry.rb +37 -8
  46. data/app/models/raif/embedding_model.rb +2 -1
  47. data/app/models/raif/embedding_models/open_ai.rb +1 -1
  48. data/app/models/raif/llm.rb +28 -3
  49. data/app/models/raif/llms/anthropic.rb +7 -19
  50. data/app/models/raif/llms/bedrock.rb +6 -20
  51. data/app/models/raif/llms/google.rb +140 -0
  52. data/app/models/raif/llms/open_ai_base.rb +19 -5
  53. data/app/models/raif/llms/open_ai_completions.rb +6 -11
  54. data/app/models/raif/llms/open_ai_responses.rb +6 -16
  55. data/app/models/raif/llms/open_router.rb +10 -14
  56. data/app/models/raif/model_completion.rb +61 -0
  57. data/app/models/raif/model_tool.rb +10 -2
  58. data/app/models/raif/model_tool_invocation.rb +38 -6
  59. data/app/models/raif/model_tools/agent_final_answer.rb +2 -7
  60. data/app/models/raif/model_tools/provider_managed/code_execution.rb +4 -0
  61. data/app/models/raif/model_tools/provider_managed/image_generation.rb +4 -0
  62. data/app/models/raif/model_tools/provider_managed/web_search.rb +4 -0
  63. data/app/models/raif/streaming_responses/google.rb +71 -0
  64. data/app/models/raif/task.rb +74 -18
  65. data/app/models/raif/user_tool_invocation.rb +19 -0
  66. data/app/views/layouts/raif/admin.html.erb +12 -1
  67. data/app/views/raif/admin/agents/_agent.html.erb +8 -0
  68. data/app/views/raif/admin/agents/_conversation_message.html.erb +28 -6
  69. data/app/views/raif/admin/agents/index.html.erb +2 -0
  70. data/app/views/raif/admin/agents/show.html.erb +46 -1
  71. data/app/views/raif/admin/configs/show.html.erb +117 -0
  72. data/app/views/raif/admin/conversations/_conversation_entry.html.erb +29 -34
  73. data/app/views/raif/admin/conversations/show.html.erb +2 -0
  74. data/app/views/raif/admin/model_completions/_model_completion.html.erb +9 -0
  75. data/app/views/raif/admin/model_completions/index.html.erb +26 -0
  76. data/app/views/raif/admin/model_completions/show.html.erb +124 -61
  77. data/app/views/raif/admin/model_tool_invocations/index.html.erb +22 -1
  78. data/app/views/raif/admin/model_tools/_list.html.erb +16 -0
  79. data/app/views/raif/admin/model_tools/_model_tool.html.erb +36 -0
  80. data/app/views/raif/admin/stats/_stats_tile.html.erb +34 -0
  81. data/app/views/raif/admin/stats/index.html.erb +71 -88
  82. data/app/views/raif/admin/stats/model_tool_invocations/index.html.erb +43 -0
  83. data/app/views/raif/admin/stats/tasks/index.html.erb +20 -6
  84. data/app/views/raif/admin/tasks/index.html.erb +6 -1
  85. data/app/views/raif/admin/tasks/show.html.erb +36 -3
  86. data/app/views/raif/conversation_entries/_form.html.erb +4 -1
  87. data/app/views/raif/conversations/_conversation.html.erb +10 -0
  88. data/app/views/raif/conversations/_entry_processed.turbo_stream.erb +12 -0
  89. data/app/views/raif/conversations/_full_conversation.html.erb +3 -6
  90. data/app/views/raif/conversations/_initial_chat_message.html.erb +5 -0
  91. data/app/views/raif/conversations/index.html.erb +23 -0
  92. data/config/locales/admin.en.yml +33 -1
  93. data/config/locales/en.yml +41 -4
  94. data/config/routes.rb +2 -0
  95. data/db/migrate/20250804013843_add_task_run_args_to_raif_tasks.rb +13 -0
  96. data/db/migrate/20250811171150_make_raif_task_creator_optional.rb +8 -0
  97. data/db/migrate/20250904194456_add_generating_entry_response_to_raif_conversations.rb +7 -0
  98. data/db/migrate/20250911125234_add_source_to_raif_tasks.rb +7 -0
  99. data/db/migrate/20251020005853_add_source_to_raif_agents.rb +7 -0
  100. data/db/migrate/20251020011346_rename_task_run_args_to_run_with.rb +7 -0
  101. data/db/migrate/20251020011405_add_run_with_to_raif_agents.rb +13 -0
  102. data/db/migrate/20251024160119_add_llm_messages_max_length_to_raif_conversations.rb +14 -0
  103. data/db/migrate/20251124185033_add_provider_tool_call_id_to_raif_model_tool_invocations.rb +7 -0
  104. data/db/migrate/20251128202941_add_tool_choice_to_raif_model_completions.rb +7 -0
  105. data/db/migrate/20260118144846_add_source_to_raif_conversations.rb +7 -0
  106. data/db/migrate/20260119000000_add_failure_tracking_to_raif_model_completions.rb +10 -0
  107. data/db/migrate/20260119000001_add_completed_at_to_raif_model_completions.rb +8 -0
  108. data/db/migrate/20260119000002_add_started_at_to_raif_model_completions.rb +8 -0
  109. data/exe/raif +7 -0
  110. data/lib/generators/raif/agent/agent_generator.rb +22 -7
  111. data/lib/generators/raif/agent/templates/agent.rb.tt +20 -24
  112. data/lib/generators/raif/agent/templates/agent_eval_set.rb.tt +48 -0
  113. data/lib/generators/raif/agent/templates/application_agent.rb.tt +1 -3
  114. data/lib/generators/raif/base_generator.rb +19 -0
  115. data/lib/generators/raif/conversation/conversation_generator.rb +21 -2
  116. data/lib/generators/raif/conversation/templates/application_conversation.rb.tt +0 -2
  117. data/lib/generators/raif/conversation/templates/conversation.rb.tt +34 -32
  118. data/lib/generators/raif/conversation/templates/conversation_eval_set.rb.tt +70 -0
  119. data/lib/generators/raif/eval_set/eval_set_generator.rb +28 -0
  120. data/lib/generators/raif/eval_set/templates/eval_set.rb.tt +21 -0
  121. data/lib/generators/raif/evals/setup/setup_generator.rb +47 -0
  122. data/lib/generators/raif/install/install_generator.rb +15 -0
  123. data/lib/generators/raif/install/templates/initializer.rb +89 -10
  124. data/lib/generators/raif/model_tool/model_tool_generator.rb +5 -5
  125. data/lib/generators/raif/model_tool/templates/model_tool.rb.tt +78 -78
  126. data/lib/generators/raif/model_tool/templates/model_tool_invocation_partial.html.erb.tt +1 -1
  127. data/lib/generators/raif/task/task_generator.rb +22 -3
  128. data/lib/generators/raif/task/templates/application_task.rb.tt +0 -2
  129. data/lib/generators/raif/task/templates/task.rb.tt +55 -59
  130. data/lib/generators/raif/task/templates/task_eval_set.rb.tt +54 -0
  131. data/lib/raif/cli/base.rb +39 -0
  132. data/lib/raif/cli/evals.rb +47 -0
  133. data/lib/raif/cli/evals_setup.rb +27 -0
  134. data/lib/raif/cli.rb +67 -0
  135. data/lib/raif/configuration.rb +57 -8
  136. data/lib/raif/engine.rb +8 -0
  137. data/lib/raif/errors/instance_dependent_schema_error.rb +8 -0
  138. data/lib/raif/errors/streaming_error.rb +6 -3
  139. data/lib/raif/errors.rb +1 -0
  140. data/lib/raif/evals/eval.rb +30 -0
  141. data/lib/raif/evals/eval_set.rb +111 -0
  142. data/lib/raif/evals/eval_sets/expectations.rb +53 -0
  143. data/lib/raif/evals/eval_sets/llm_judge_expectations.rb +255 -0
  144. data/lib/raif/evals/expectation_result.rb +39 -0
  145. data/lib/raif/evals/llm_judge.rb +32 -0
  146. data/lib/raif/evals/llm_judges/binary.rb +94 -0
  147. data/lib/raif/evals/llm_judges/comparative.rb +89 -0
  148. data/lib/raif/evals/llm_judges/scored.rb +63 -0
  149. data/lib/raif/evals/llm_judges/summarization.rb +166 -0
  150. data/lib/raif/evals/run.rb +202 -0
  151. data/lib/raif/evals/scoring_rubric.rb +174 -0
  152. data/lib/raif/evals.rb +26 -0
  153. data/lib/raif/json_schema_builder.rb +14 -0
  154. data/lib/raif/llm_registry.rb +218 -15
  155. data/lib/raif/messages.rb +180 -0
  156. data/lib/raif/migration_checker.rb +3 -3
  157. data/lib/raif/utils/colors.rb +23 -0
  158. data/lib/raif/utils.rb +1 -0
  159. data/lib/raif/version.rb +1 -1
  160. data/lib/raif.rb +13 -0
  161. data/lib/tasks/annotate_rb.rake +10 -0
  162. data/spec/support/current_temperature_test_tool.rb +34 -0
  163. data/spec/support/rspec_helpers.rb +8 -8
  164. data/spec/support/test_conversation.rb +1 -1
  165. metadata +77 -10
  166. data/app/models/raif/agents/re_act_agent.rb +0 -127
  167. data/app/models/raif/agents/re_act_step.rb +0 -33
@@ -25,102 +25,85 @@
25
25
  <div class="card-body">
26
26
  <div class="row g-4">
27
27
  <!-- Model Completions -->
28
- <div class="col-md-4 col-lg-4">
29
- <div class="stats-card p-3 border rounded shadow-sm h-100">
30
- <div class="d-flex align-items-center mb-2">
31
- <span class="stats-icon bg-primary-subtle text-primary rounded p-2 me-3">
32
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-robot" viewBox="0 0 16 16">
33
- <path d="M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5ZM3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.58 26.58 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.933.933 0 0 1-.765.935c-.845.147-2.34.346-4.235.346-1.895 0-3.39-.2-4.235-.346A.933.933 0 0 1 3 9.219V8.062Zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a24.767 24.767 0 0 1-1.871-.183.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25.286 25.286 0 0 0 1.922-.188.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785-.842-1.7a.25.25 0 0 0-.182-.135Z" />
34
- <path d="M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2V1.866ZM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5Z" />
35
- </svg>
36
- </span>
37
- <div>
38
- <h6 class="mb-0 text-muted"><%= t("raif.admin.common.model_completions") %></h6>
39
- </div>
40
- </div>
41
- <div class="d-flex justify-content-between align-items-center">
42
- <h3 class="fw-bold mb-0"><%= number_with_delimiter(@model_completion_count) %></h3>
43
- <p class="text-muted mt-2 mb-0"><small><%= t("raif.admin.common.est_cost") %>: <%= number_to_currency(@model_completion_total_cost, precision: 6) %></small></p>
44
- </div>
45
- </div>
46
- </div>
28
+ <%= render "stats_tile",
29
+ icon_color: "primary",
30
+ title: t("raif.admin.common.model_completions"),
31
+ count: @model_completion_count,
32
+ show_costs: true,
33
+ input_cost: @model_completion_input_token_cost,
34
+ output_cost: @model_completion_output_token_cost,
35
+ total_cost: @model_completion_total_cost do %>
36
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-robot" viewBox="0 0 16 16">
37
+ <path d="M6 12.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5ZM3 8.062C3 6.76 4.235 5.765 5.53 5.886a26.58 26.58 0 0 0 4.94 0C11.765 5.765 13 6.76 13 8.062v1.157a.933.933 0 0 1-.765.935c-.845.147-2.34.346-4.235.346-1.895 0-3.39-.2-4.235-.346A.933.933 0 0 1 3 9.219V8.062Zm4.542-.827a.25.25 0 0 0-.217.068l-.92.9a24.767 24.767 0 0 1-1.871-.183.25.25 0 0 0-.068.495c.55.076 1.232.149 2.02.193a.25.25 0 0 0 .189-.071l.754-.736.847 1.71a.25.25 0 0 0 .404.062l.932-.97a25.286 25.286 0 0 0 1.922-.188.25.25 0 0 0-.068-.495c-.538.074-1.207.145-1.98.189a.25.25 0 0 0-.166.076l-.754.785-.842-1.7a.25.25 0 0 0-.182-.135Z" />
38
+ <path d="M8.5 1.866a1 1 0 1 0-1 0V3h-2A4.5 4.5 0 0 0 1 7.5V8a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v1a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-1a1 1 0 0 0 1-1V9a1 1 0 0 0-1-1v-.5A4.5 4.5 0 0 0 10.5 3h-2V1.866ZM14 7.5V13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7.5A3.5 3.5 0 0 1 5.5 4h5A3.5 3.5 0 0 1 14 7.5Z" />
39
+ </svg>
40
+ <% end %>
47
41
 
48
42
  <!-- Tasks -->
49
- <div class="col-md-4 col-lg-4">
50
- <div class="stats-card p-3 border rounded shadow-sm h-100">
51
- <div class="d-flex align-items-center mb-2">
52
- <span class="stats-icon bg-success-subtle text-success rounded p-2 me-3">
53
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-list-check" viewBox="0 0 16 16">
54
- <path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z" />
55
- </svg>
56
- </span>
57
- <div>
58
- <h6 class="mb-0 text-muted"><%= t("raif.admin.common.tasks") %></h6>
59
- </div>
60
- </div>
61
- <div class="d-flex justify-content-between align-items-center">
62
- <h3 class="fw-bold mb-0"><%= number_with_delimiter(@task_count) %></h3>
63
- <div class="mt-2">
64
- <%= link_to raif.admin_stats_tasks_path(period: @selected_period) do %>
65
- <%= t("raif.admin.common.details") %> &raquo;
66
- <% end %>
67
- </div>
68
- </div>
69
- </div>
70
- </div>
43
+ <%= render "stats_tile",
44
+ icon_color: "success",
45
+ title: t("raif.admin.common.tasks"),
46
+ count: @task_count,
47
+ details_link: raif.admin_stats_tasks_path(period: @selected_period),
48
+ show_costs: true,
49
+ input_cost: @task_input_token_cost,
50
+ output_cost: @task_output_token_cost,
51
+ total_cost: @task_total_cost do %>
52
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-list-check" viewBox="0 0 16 16">
53
+ <path fill-rule="evenodd" d="M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3.854 2.146a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 3.293l1.146-1.147a.5.5 0 0 1 .708 0zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708L2 7.293l1.146-1.147a.5.5 0 0 1 .708 0zm0 4a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z" />
54
+ </svg>
55
+ <% end %>
71
56
 
72
57
  <!-- Agents -->
73
- <div class="col-md-4 col-lg-4">
74
- <div class="stats-card p-3 border rounded shadow-sm h-100">
75
- <div class="d-flex align-items-center mb-2">
76
- <span class="stats-icon bg-danger-subtle text-danger rounded p-2 me-3">
77
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-cpu" viewBox="0 0 16 16">
78
- <path d="M5 0a.5.5 0 0 1 .5.5V2h1V.5a.5.5 0 0 1 1 0V2h1V.5a.5.5 0 0 1 1 0V2h1V.5a.5.5 0 0 1 1 0V2A2.5 2.5 0 0 1 14 4.5h1.5a.5.5 0 0 1 0 1H14v1h1.5a.5.5 0 0 1 0 1H14v1h1.5a.5.5 0 0 1 0 1H14v1h1.5a.5.5 0 0 1 0 1H14a2.5 2.5 0 0 1-2.5 2.5v1.5a.5.5 0 0 1-1 0V14h-1v1.5a.5.5 0 0 1-1 0V14h-1v1.5a.5.5 0 0 1-1 0V14h-1v1.5a.5.5 0 0 1-1 0V14A2.5 2.5 0 0 1 2 11.5H.5a.5.5 0 0 1 0-1H2v-1H.5a.5.5 0 0 1 0-1H2v-1H.5a.5.5 0 0 1 0-1H2v-1H.5a.5.5 0 0 1 0-1H2A2.5 2.5 0 0 1 4.5 2V.5A.5.5 0 0 1 5 0zm-.5 3A1.5 1.5 0 0 0 3 4.5v7A1.5 1.5 0 0 0 4.5 13h7a1.5 1.5 0 0 0 1.5-1.5v-7A1.5 1.5 0 0 0 11.5 3h-7zM5 6.5A1.5 1.5 0 0 1 6.5 5h3A1.5 1.5 0 0 1 11 6.5v3A1.5 1.5 0 0 1 9.5 11h-3A1.5 1.5 0 0 1 5 9.5v-3zM6.5 6a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z" />
79
- </svg>
80
- </span>
81
- <div>
82
- <h6 class="mb-0 text-muted"><%= t("raif.admin.common.agents") %></h6>
83
- </div>
84
- </div>
85
- <h3 class="fw-bold mb-0"><%= number_with_delimiter(@agent_count) %></h3>
86
- </div>
87
- </div>
58
+ <%= render "stats_tile",
59
+ icon_color: "danger",
60
+ title: t("raif.admin.common.agents"),
61
+ count: @agent_count,
62
+ show_costs: true,
63
+ input_cost: @agent_input_token_cost,
64
+ output_cost: @agent_output_token_cost,
65
+ total_cost: @agent_total_cost do %>
66
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-cpu" viewBox="0 0 16 16">
67
+ <path d="M5 0a.5.5 0 0 1 .5.5V2h1V.5a.5.5 0 0 1 1 0V2h1V.5a.5.5 0 0 1 1 0V2h1V.5a.5.5 0 0 1 1 0V2A2.5 2.5 0 0 1 14 4.5h1.5a.5.5 0 0 1 0 1H14v1h1.5a.5.5 0 0 1 0 1H14v1h1.5a.5.5 0 0 1 0 1H14v1h1.5a.5.5 0 0 1 0 1H14a2.5 2.5 0 0 1-2.5 2.5v1.5a.5.5 0 0 1-1 0V14h-1v1.5a.5.5 0 0 1-1 0V14h-1v1.5a.5.5 0 0 1-1 0V14h-1v1.5a.5.5 0 0 1-1 0V14A2.5 2.5 0 0 1 2 11.5H.5a.5.5 0 0 1 0-1H2v-1H.5a.5.5 0 0 1 0-1H2v-1H.5a.5.5 0 0 1 0-1H2v-1H.5a.5.5 0 0 1 0-1H2A2.5 2.5 0 0 1 4.5 2V.5A.5.5 0 0 1 5 0zm-.5 3A1.5 1.5 0 0 0 3 4.5v7A1.5 1.5 0 0 0 4.5 13h7a1.5 1.5 0 0 0 1.5-1.5v-7A1.5 1.5 0 0 0 11.5 3h-7zM5 6.5A1.5 1.5 0 0 1 6.5 5h3A1.5 1.5 0 0 1 11 6.5v3A1.5 1.5 0 0 1 9.5 11h-3A1.5 1.5 0 0 1 5 9.5v-3zM6.5 6a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z" />
68
+ </svg>
69
+ <% end %>
88
70
 
89
71
  <!-- Conversations -->
90
- <div class="col-md-4 col-lg-4">
91
- <div class="stats-card p-3 border rounded shadow-sm h-100">
92
- <div class="d-flex align-items-center mb-2">
93
- <span class="stats-icon bg-info-subtle text-info rounded p-2 me-3">
94
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-chat-dots" viewBox="0 0 16 16">
95
- <path d="M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
96
- <path d="m2.165 15.803.02-.004c1.83-.363 2.948-.842 3.468-1.105A9.06 9.06 0 0 0 8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6a10.437 10.437 0 0 1-.524 2.318l-.003.011a10.722 10.722 0 0 1-.244.637c-.079.186.074.394.273.362a21.673 21.673 0 0 0 .693-.125zm.8-3.108a1 1 0 0 0-.287-.801C1.618 10.83 1 9.468 1 8c0-3.192 3.004-6 7-6s7 2.808 7 6c0 3.193-3.004 6-7 6a8.06 8.06 0 0 1-2.088-.272a1 1 0 0 0-.711.074c-.387.196-1.24.57-2.634.893a10.97 10.97 0 0 0 .398-2z" />
97
- </svg>
98
- </span>
99
- <div>
100
- <h6 class="mb-0 text-muted"><%= t("raif.admin.common.conversations") %></h6>
101
- </div>
102
- </div>
103
- <h3 class="fw-bold mb-0"><%= number_with_delimiter(@conversation_count) %></h3>
104
- </div>
105
- </div>
72
+ <%= render "stats_tile",
73
+ icon_color: "info",
74
+ title: t("raif.admin.common.conversations"),
75
+ count: @conversation_count do %>
76
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-chat-dots" viewBox="0 0 16 16">
77
+ <path d="M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
78
+ <path d="m2.165 15.803.02-.004c1.83-.363 2.948-.842 3.468-1.105A9.06 9.06 0 0 0 8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6a10.437 10.437 0 0 1-.524 2.318l-.003.011a10.722 10.722 0 0 1-.244.637c-.079.186.074.394.273.362a21.673 21.673 0 0 0 .693-.125zm.8-3.108a1 1 0 0 0-.287-.801C1.618 10.83 1 9.468 1 8c0-3.192 3.004-6 7-6s7 2.808 7 6c0 3.193-3.004 6-7 6a8.06 8.06 0 0 1-2.088-.272a1 1 0 0 0-.711.074c-.387.196-1.24.57-2.634.893a10.97 10.97 0 0 0 .398-2z" />
79
+ </svg>
80
+ <% end %>
106
81
 
107
82
  <!-- Conversation Entries -->
108
- <div class="col-md-4 col-lg-4">
109
- <div class="stats-card p-3 border rounded shadow-sm h-100">
110
- <div class="d-flex align-items-center mb-2">
111
- <span class="stats-icon bg-warning-subtle text-warning rounded p-2 me-3">
112
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-chat-text" viewBox="0 0 16 16">
113
- <path d="M2.678 11.894a1 1 0 0 1 .287.801 10.97 10.97 0 0 1-.398 2c1.395-.323 2.247-.697 2.634-.893a1 1 0 0 1 .71-.074A8.06 8.06 0 0 0 8 14c3.996 0 7-2.807 7-6 0-3.192-3.004-6-7-6S1 4.808 1 8c0 1.468.617 2.83 1.678 3.894zm-.493 3.905a21.682 21.682 0 0 1-.713.129c-.2.032-.352-.176-.273-.362a9.68 9.68 0 0 0 .244-.637l.003-.01c.248-.72.45-1.548.524-2.319C.743 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7-3.582 7-8 7a9.06 9.06 0 0 1-2.347-.306c-.52.263-1.639.742-3.468 1.105z" />
114
- <path d="M4 5.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zM4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8zm0 2.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5z" />
115
- </svg>
116
- </span>
117
- <div>
118
- <h6 class="mb-0 text-muted"><%= t("raif.admin.common.conversation_entries") %></h6>
119
- </div>
120
- </div>
121
- <h3 class="fw-bold mb-0"><%= number_with_delimiter(@conversation_entry_count) %></h3>
122
- </div>
123
- </div>
83
+ <%= render "stats_tile",
84
+ icon_color: "warning",
85
+ title: t("raif.admin.common.conversation_entries"),
86
+ count: @conversation_entry_count,
87
+ show_costs: true,
88
+ input_cost: @conversation_entry_input_token_cost,
89
+ output_cost: @conversation_entry_output_token_cost,
90
+ total_cost: @conversation_entry_total_cost do %>
91
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-chat-text" viewBox="0 0 16 16">
92
+ <path d="M2.678 11.894a1 1 0 0 1 .287.801 10.97 10.97 0 0 1-.398 2c1.395-.323 2.247-.697 2.634-.893a1 1 0 0 1 .71-.074A8.06 8.06 0 0 0 8 14c3.996 0 7-2.807 7-6 0-3.192-3.004-6-7-6S1 4.808 1 8c0 1.468.617 2.83 1.678 3.894zm-.493 3.905a21.682 21.682 0 0 1-.713.129c-.2.032-.352-.176-.273-.362a9.68 9.68 0 0 0 .244-.637l.003-.01c.248-.72.45-1.548.524-2.319C.743 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7-3.582 7-8 7a9.06 9.06 0 0 1-2.347-.306c-.52.263-1.639.742-3.468 1.105z" />
93
+ <path d="M4 5.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zM4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8zm0 2.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5z" />
94
+ </svg>
95
+ <% end %>
96
+
97
+ <!-- Model Tool Invocations -->
98
+ <%= render "stats_tile",
99
+ icon_color: "secondary",
100
+ title: t("raif.admin.common.model_tool_invocations"),
101
+ count: @model_tool_invocation_count,
102
+ details_link: raif.admin_stats_model_tool_invocations_path(period: @selected_period) do %>
103
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-tools" viewBox="0 0 16 16">
104
+ <path d="M1 0 0 1l2.2 3.081a1 1 0 0 0 .815.419h.07a1 1 0 0 1 .708.293l2.675 2.675-2.617 2.654A3.003 3.003 0 0 0 0 13a3 3 0 1 0 5.878-.851l2.654-2.617.968.968-.305.914a1 1 0 0 0 .242 1.023l3.27 3.27a.997.997 0 0 0 1.414 0l1.586-1.586a.997.997 0 0 0 0-1.414l-3.27-3.27a1 1 0 0 0-1.023-.242L10.5 9.5l-.96-.96 2.68-2.643A3.005 3.005 0 0 0 16 3c0-.269-.035-.53-.102-.777l-2.14 2.141L12 4l-.364-1.757L13.777.102a3 3 0 0 0-3.675 3.68L7.462 6.46 4.793 3.793a1 1 0 0 1-.293-.707v-.071a1 1 0 0 0-.419-.814L1 0Zm9.646 10.646a.5.5 0 0 1 .708 0l2.914 2.915a.5.5 0 0 1-.707.707l-2.915-2.914a.5.5 0 0 1 0-.708ZM3 11l.471.242.529.026.287.445.445.287.026.529L5 13l-.242.471-.026.529-.445.287-.287.445-.529.026L3 15l-.471-.242L2 14.732l-.287-.445L1.268 14l-.026-.529L1 13l.242-.471.026-.529.445-.287.287-.445.529-.026L3 11Z" />
105
+ </svg>
106
+ <% end %>
124
107
  </div>
125
108
  </div>
126
109
  </div>
@@ -0,0 +1,43 @@
1
+ <%= link_to raif.admin_stats_path do %>
2
+ &laquo; <%= t("raif.admin.stats.model_tool_invocations.back_to_stats") %>
3
+ <% end %>
4
+
5
+ <div class="d-flex justify-content-between align-items-center my-4">
6
+ <h1 class="mb-0"><%= t("raif.admin.stats.model_tool_invocations.title") %></h1>
7
+
8
+ <div class="period-filter">
9
+ <%= form_tag raif.admin_stats_model_tool_invocations_path, method: :get, id: "period_filter_form", class: "d-flex align-items-center" do %>
10
+ <%= select_tag :period,
11
+ options_for_select(
12
+ [
13
+ [t("raif.admin.common.period_day"), "day"],
14
+ [t("raif.admin.common.period_week"), "week"],
15
+ [t("raif.admin.common.period_month"), "month"],
16
+ [t("raif.admin.common.period_all"), "all"]
17
+ ],
18
+ @selected_period
19
+ ),
20
+ class: "form-select form-select-sm me-2" %>
21
+ <%= submit_tag t("raif.admin.common.update"), class: "btn btn-sm btn-primary" %>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="table-responsive">
27
+ <table class="table table-striped table-hover">
28
+ <thead class="table-light">
29
+ <tr>
30
+ <th><%= t("raif.admin.common.tool_type") %></th>
31
+ <th class="text-end"><%= t("raif.admin.common.count") %></th>
32
+ </tr>
33
+ </thead>
34
+ <tbody>
35
+ <% @model_tool_invocation_stats_by_type.each do |tool_type, count| %>
36
+ <tr>
37
+ <td><%= tool_type %></td>
38
+ <td class="text-end"><%= number_with_delimiter(count) %></td>
39
+ </tr>
40
+ <% end %>
41
+ </tbody>
42
+ </table>
43
+ </div>
@@ -7,6 +7,10 @@
7
7
 
8
8
  <div class="period-filter">
9
9
  <%= form_tag raif.admin_stats_tasks_path, method: :get, id: "period_filter_form", class: "d-flex align-items-center" do %>
10
+ <div class="form-check me-4 text-nowrap">
11
+ <%= check_box_tag :show_model_breakdown, "1", @show_model_breakdown, class: "form-check-input", id: "show_model_breakdown" %>
12
+ <%= label_tag :show_model_breakdown, t("raif.admin.stats.tasks.show_model_breakdown"), class: "form-check-label" %>
13
+ </div>
10
14
  <%= select_tag :period,
11
15
  options_for_select(
12
16
  [
@@ -28,16 +32,26 @@
28
32
  <thead class="table-light">
29
33
  <tr>
30
34
  <th><%= t("raif.admin.common.type") %></th>
31
- <th><%= t("raif.admin.common.count") %></th>
32
- <th><%= t("raif.admin.common.est_cost") %></th>
35
+ <% if @show_model_breakdown %>
36
+ <th><%= t("raif.admin.common.model") %></th>
37
+ <% end %>
38
+ <th class="text-end"><%= t("raif.admin.common.count") %></th>
39
+ <th class="text-end"><%= t("raif.admin.common.input_token_cost") %></th>
40
+ <th class="text-end"><%= t("raif.admin.common.output_token_cost") %></th>
41
+ <th class="text-end"><%= t("raif.admin.common.total_cost") %></th>
33
42
  </tr>
34
43
  </thead>
35
44
  <tbody>
36
- <% @task_counts_by_type.each do |type, count| %>
45
+ <% @task_stats_by_type.each do |task_stat| %>
37
46
  <tr>
38
- <td><%= type %></td>
39
- <td><%= number_with_delimiter(count) %></td>
40
- <td><%= number_to_currency(@task_costs_by_type[type] || 0, precision: 6) %></td>
47
+ <td><%= task_stat.type %></td>
48
+ <% if @show_model_breakdown %>
49
+ <td><%= task_stat.llm_model_key %></td>
50
+ <% end %>
51
+ <td class="text-end"><%= number_with_delimiter(task_stat.count) %></td>
52
+ <td class="text-end"><%= number_to_currency(task_stat.input_cost, precision: 2) %></td>
53
+ <td class="text-end"><%= number_to_currency(task_stat.output_cost, precision: 2) %></td>
54
+ <td class="text-end"><%= number_to_currency(task_stat.total_cost, precision: 2) %></td>
41
55
  </tr>
42
56
  <% end %>
43
57
  </tbody>
@@ -1,4 +1,9 @@
1
- <h1 class="my-4"><%= t("raif.admin.common.tasks") %></h1>
1
+ <div class="d-flex justify-content-between align-items-center my-4">
2
+ <h1 class="mb-0"><%= t("raif.admin.common.tasks") %></h1>
3
+ <%= link_to raif.admin_stats_tasks_path, class: "btn btn-outline-primary" do %>
4
+ <%= t("raif.admin.common.stats") %> &raquo;
5
+ <% end %>
6
+ </div>
2
7
 
3
8
  <div class="row">
4
9
  <div class="col-12">
@@ -93,22 +93,55 @@
93
93
  <div class="col-md-3"><strong><%= t("raif.admin.common.created_at") %>:</strong></div>
94
94
  <div class="col-md-9"><%= @task.raif_model_completion.created_at.rfc822 %></div>
95
95
  </div>
96
+ <div class="row mb-3">
97
+ <div class="col-md-3"><strong><%= t("raif.admin.common.retry_count") %>:</strong></div>
98
+ <div class="col-md-9"><%= @task.raif_model_completion.retry_count %></div>
99
+ </div>
96
100
  <div class="row mb-3">
97
101
  <div class="col-md-3"><strong><%= t("raif.admin.common.prompt_tokens") %>:</strong></div>
98
- <div class="col-md-9"><%= @task.raif_model_completion.prompt_tokens ? number_with_delimiter(@task.raif_model_completion.prompt_tokens) : "-" %></div>
102
+ <div class="col-md-9">
103
+ <% if @task.raif_model_completion.prompt_tokens %>
104
+ <%= number_with_delimiter(@task.raif_model_completion.prompt_tokens) %>
105
+ <% if @task.raif_model_completion.prompt_token_cost %>
106
+ <small>(<%= t("raif.admin.common.est_cost") %>: <%= "$" %><%= number_with_precision(@task.raif_model_completion.prompt_token_cost, precision: 6) %>)</small>
107
+ <% end %>
108
+ <% else %>
109
+ -
110
+ <% end %>
111
+ </div>
99
112
  </div>
100
113
  <div class="row mb-3">
101
114
  <div class="col-md-3"><strong><%= t("raif.admin.common.completion_tokens") %>:</strong></div>
102
- <div class="col-md-9"><%= @task.raif_model_completion.completion_tokens ? number_with_delimiter(@task.raif_model_completion.completion_tokens) : "-" %></div>
115
+ <div class="col-md-9">
116
+ <% if @task.raif_model_completion.completion_tokens %>
117
+ <%= number_with_delimiter(@task.raif_model_completion.completion_tokens) %>
118
+ <% if @task.raif_model_completion.output_token_cost %>
119
+ <small>(<%= t("raif.admin.common.est_cost") %>: <%= "$" %><%= number_with_precision(@task.raif_model_completion.output_token_cost, precision: 6) %>)</small>
120
+ <% end %>
121
+ <% else %>
122
+ -
123
+ <% end %>
124
+ </div>
103
125
  </div>
104
126
  <div class="row mb-3">
105
127
  <div class="col-md-3"><strong><%= t("raif.admin.common.total_tokens") %>:</strong></div>
106
- <div class="col-md-9"><%= @task.raif_model_completion.total_tokens ? number_with_delimiter(@task.raif_model_completion.total_tokens) : "-" %></div>
128
+ <div class="col-md-9">
129
+ <% if @task.raif_model_completion.total_tokens %>
130
+ <%= number_with_delimiter(@task.raif_model_completion.total_tokens) %>
131
+ <% if @task.raif_model_completion.total_cost %>
132
+ <small>(<%= t("raif.admin.common.est_cost") %>: <%= "$" %><%= number_with_precision(@task.raif_model_completion.total_cost, precision: 6) %>)</small>
133
+ <% end %>
134
+ <% else %>
135
+ -
136
+ <% end %>
137
+ </div>
107
138
  </div>
108
139
  </div>
109
140
  </div>
110
141
  <% end %>
111
142
 
143
+ <%= render "raif/admin/model_tools/list", model_tools: @task.available_model_tools_map %>
144
+
112
145
  <div class="card mb-4">
113
146
  <div class="card-header">
114
147
  <h5 class="mb-0"><%= t("raif.admin.common.system_prompt") %></h5>
@@ -1,5 +1,8 @@
1
+ <%# locals: (conversation:, conversation_entry:) %>
2
+
1
3
  <%= form_with model: conversation_entry,
2
4
  url: raif.conversation_entries_path(conversation),
5
+ id: dom_id(conversation, "entry_form"),
3
6
  local: true do |f| %>
4
7
 
5
8
  <% if conversation_entry.raif_user_tool_invocation %>
@@ -10,7 +13,7 @@
10
13
  <% end %>
11
14
  <% end %>
12
15
 
13
- <div class="d-flex px-2">
16
+ <div class="d-flex px-2 align-items-center">
14
17
  <%= f.text_field :user_message,
15
18
  class: "form-control me-2",
16
19
  placeholder: conversation_entry.raif_user_tool_invocation&.message_input_placeholder.presence || t("raif.common.type_your_message"),
@@ -0,0 +1,10 @@
1
+ <%# locals: (conversation:) %>
2
+
3
+ <tr>
4
+ <td class="ps-2"><%= conversation.created_at.strftime("%B %d, %Y") %></td>
5
+ <td>
6
+ <%= link_to t("raif.conversations.index.table.view"),
7
+ raif.conversation_path(conversation),
8
+ class: "btn btn-sm btn-primary" %>
9
+ </td>
10
+ </tr>
@@ -0,0 +1,12 @@
1
+ <%# locals: (conversation:, conversation_entry:) %>
2
+
3
+ <%# Update the conversation entry now that it's been processed & has a model response %>
4
+ <%= turbo_stream.replace conversation_entry do %>
5
+ <%= render conversation_entry %>
6
+ <% end %>
7
+
8
+ <%= turbo_stream.replace dom_id(conversation, "entry_form") do %>
9
+ <%= render "raif/conversation_entries/form", conversation: conversation, conversation_entry: Raif::ConversationEntry.new %>
10
+ <% end %>
11
+
12
+ <%= turbo_stream.action :raif_scroll_to_bottom, ActionView::RecordIdentifier.dom_id(conversation, :entries) %>
@@ -1,14 +1,11 @@
1
1
  <%= turbo_stream_from conversation %>
2
2
 
3
- <div id="<%= dom_id(conversation, :entries) %>" class="flex-grow-1 overflow-auto" data-controller="raif--conversations">
4
- <%= render "raif/conversation_entries/message",
5
- content: conversation.initial_chat_message,
6
- message_type: :model_response %>
7
-
3
+ <div id="<%= dom_id(conversation, :entries) %>" class="flex-grow-1 overflow-auto raif-conversation-entries-container" data-controller="raif--conversations">
4
+ <%= render conversation.initial_chat_message_partial_path, conversation: conversation %>
8
5
  <%= render conversation.entries.oldest_first %>
9
6
  </div>
10
7
 
11
- <div id="<%= dom_id(conversation, :entry_input) %>">
8
+ <div id="<%= dom_id(conversation, :entry_input) %>" class="raif-conversation-entry-input-container">
12
9
  <%= render "raif/conversation_entries/form_with_available_tools",
13
10
  conversation: conversation,
14
11
  conversation_entry: Raif::ConversationEntry.new %>
@@ -0,0 +1,5 @@
1
+ <%# locals: (conversation:) %>
2
+
3
+ <%= render "raif/conversation_entries/message",
4
+ content: conversation.initial_chat_message,
5
+ message_type: :model_response %>
@@ -0,0 +1,23 @@
1
+ <div class="conversation-history p-4">
2
+ <h2><%= t("raif.conversations.index.title") %></h2>
3
+
4
+ <% if @conversations.any? %>
5
+ <div class="table-responsive">
6
+ <table class="table table-striped">
7
+ <thead>
8
+ <tr>
9
+ <th><%= t("raif.conversations.index.table.started") %></th>
10
+ <th><%= t("raif.conversations.index.table.actions") %></th>
11
+ </tr>
12
+ </thead>
13
+ <tbody>
14
+ <%= render collection: @conversations, partial: "raif/conversations/conversation" %>
15
+ </tbody>
16
+ </table>
17
+ </div>
18
+ <% else %>
19
+ <div class="text-center py-4">
20
+ <p class="text-muted"><%= t("raif.conversations.index.no_conversations") %></p>
21
+ </div>
22
+ <% end %>
23
+ </div>
@@ -10,28 +10,37 @@ en:
10
10
  agents: Agents
11
11
  all: All
12
12
  arguments: Arguments
13
+ arguments_schema: Arguments Schema
13
14
  at: at
15
+ available_tools: Available Tools
14
16
  citations: Citations
15
17
  completed: Completed
16
18
  completed_at: Completed At
17
19
  completion_tokens: Completion Tokens
20
+ config: Config
18
21
  conversation_entries: Conversation Entries
19
22
  conversation_history: Conversation History
20
23
  conversations: Conversations
21
24
  count: Count
22
25
  created_at: Created At
23
26
  creator: Creator
27
+ description: Description
24
28
  details: Details
25
29
  entries_count: Entries Count
26
30
  entry: Entry
27
31
  est_cost: est. cost
32
+ est_costs: est. costs
28
33
  failed: Failed
29
34
  failed_at: Failed At
35
+ failure_error: Failure Error
36
+ failure_reason: Failure Reason
30
37
  filter: Filter
31
38
  final_answer: Final Answer
32
39
  id: ID
33
40
  in_progress: In Progress
34
41
  initial_task: Initial Task
42
+ input: Input
43
+ input_token_cost: Input Token Cost
35
44
  invalid_json: Invalid JSON
36
45
  iterations: Iterations
37
46
  language: Language
@@ -48,6 +57,9 @@ en:
48
57
  no_model_tool_invocations: No model tool invocations found.
49
58
  no_tasks: No tasks found.
50
59
  no_tool_calls: No tool calls
60
+ none: None
61
+ output: Output
62
+ output_token_cost: Output Token Cost
51
63
  pending: Pending
52
64
  period_all: All time
53
65
  period_day: Past 24 hours
@@ -61,8 +73,8 @@ en:
61
73
  requested_language: Requested Language
62
74
  response: Response
63
75
  response_format: Response Format
64
- response_format_parameter: Response Format Parameter
65
76
  result: Result
77
+ retry_count: Retry Count
66
78
  running: Running
67
79
  since: Since
68
80
  source: Source
@@ -73,15 +85,31 @@ en:
73
85
  task: Task
74
86
  tasks: Tasks
75
87
  tool_arguments: Tool Arguments
88
+ tool_call: Tool Call
76
89
  tool_calls: Tool Calls
77
90
  tool_invocations: Tool Invocations
78
91
  tool_name: Tool Name
92
+ tool_result: Tool Result
79
93
  tool_type: Tool Type
94
+ total: Total
80
95
  total_cost: Total Cost
81
96
  total_tokens: Total Tokens
82
97
  type: Type
83
98
  update: Update
84
99
  user_message: User Message
100
+ config:
101
+ show:
102
+ configuration_settings: Configuration Settings
103
+ default: default
104
+ key: Key
105
+ no_embedding_models_registered: No embedding models registered
106
+ no_llms_registered: No LLMs registered
107
+ not_set: Not set
108
+ registered_embedding_models: Registered Embedding Models
109
+ registered_llms: Registered LLMs
110
+ setting: Setting
111
+ title: Raif Configuration
112
+ value: Value
85
113
  conversations:
86
114
  show:
87
115
  back_to_conversations: Back to Conversations
@@ -98,8 +126,12 @@ en:
98
126
  back_to_model_tool_invocations: Back to Model Tool Invocations
99
127
  title: 'Model Tool Invocation #%{id}'
100
128
  stats:
129
+ model_tool_invocations:
130
+ back_to_stats: Back to Stats
131
+ title: Model Tool Invocation Stats
101
132
  tasks:
102
133
  back_to_stats: Back to Stats
134
+ show_model_breakdown: Show model breakdown
103
135
  title: Task Stats
104
136
  tasks:
105
137
  show: