llm_logs 0.1.3 → 0.1.4
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87a8d5b11b7782e2dbda613ce9ef2c0717f2984574953d1070e7df443366d9d4
|
|
4
|
+
data.tar.gz: b18d3628a4658e2288744f680df716850a99bac16afaf4de07af199513034d46
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c5ddca4dfee273333daf57dbd8b7e96959183547fece1e3c08b1de9e4f556bc8bdf1c2001ecd0110eab703580a559d4a75f4d8472fe6df06ef7a2b5bb757ec59
|
|
7
|
+
data.tar.gz: 1a740b579f7d7c84950edd7b3a70a33a843f8bf8e32a4e5eef902de80110b3a161eef1e2e65ec556b353c9ab7d7ed77c07f84c883d0b62a1e30c168866ca9919
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
module LlmLogs
|
|
2
2
|
class PromptsController < ApplicationController
|
|
3
|
+
SORT_COLUMNS = { "name" => :name, "slug" => :slug, "updated" => :updated_at }.freeze
|
|
4
|
+
|
|
3
5
|
def index
|
|
4
6
|
tag = params[:tag].is_a?(String) ? params[:tag].presence : nil
|
|
5
|
-
|
|
7
|
+
@sort = SORT_COLUMNS.key?(params[:sort]) ? params[:sort] : "name"
|
|
8
|
+
@direction = params[:direction] == "desc" ? "desc" : "asc"
|
|
9
|
+
scope = Prompt.order(SORT_COLUMNS.fetch(@sort) => @direction.to_sym).includes(:versions)
|
|
6
10
|
scope = scope.with_tag(tag) if tag
|
|
7
11
|
@prompts = scope.page(params[:page]).per(25)
|
|
8
12
|
@active_tag = tag
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module LlmLogs
|
|
2
|
+
module PromptsHelper
|
|
3
|
+
def sort_link(label, column)
|
|
4
|
+
active = @sort == column
|
|
5
|
+
next_direction = active && @direction == "asc" ? "desc" : "asc"
|
|
6
|
+
arrow = active ? (@direction == "asc" ? " ↑" : " ↓") : ""
|
|
7
|
+
|
|
8
|
+
link_to(
|
|
9
|
+
"#{label}#{arrow}",
|
|
10
|
+
prompts_path(
|
|
11
|
+
sort: column,
|
|
12
|
+
direction: next_direction,
|
|
13
|
+
tag: @active_tag
|
|
14
|
+
),
|
|
15
|
+
class: "hover:text-gray-700 #{'text-gray-900' if active}"
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
<table class="min-w-full divide-y divide-gray-200">
|
|
18
18
|
<thead class="bg-gray-50">
|
|
19
19
|
<tr>
|
|
20
|
-
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"
|
|
21
|
-
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"
|
|
20
|
+
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"><%= sort_link "Name", "name" %></th>
|
|
21
|
+
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"><%= sort_link "Slug", "slug" %></th>
|
|
22
22
|
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase">Tags</th>
|
|
23
23
|
<th class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase">Version</th>
|
|
24
|
-
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"
|
|
24
|
+
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"><%= sort_link "Updated", "updated" %></th>
|
|
25
25
|
</tr>
|
|
26
26
|
</thead>
|
|
27
27
|
<tbody class="divide-y divide-gray-200">
|
data/lib/llm_logs/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: llm_logs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anton
|
|
@@ -108,6 +108,7 @@ files:
|
|
|
108
108
|
- app/controllers/llm_logs/spans_controller.rb
|
|
109
109
|
- app/controllers/llm_logs/traces_controller.rb
|
|
110
110
|
- app/helpers/llm_logs/formatting_helper.rb
|
|
111
|
+
- app/helpers/llm_logs/prompts_helper.rb
|
|
111
112
|
- app/models/llm_logs/application_record.rb
|
|
112
113
|
- app/models/llm_logs/prompt.rb
|
|
113
114
|
- app/models/llm_logs/prompt_version.rb
|