rubyllm-observ 0.6.7 → 0.6.8
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/app/controllers/observ/annotations_controller.rb +2 -2
- data/app/controllers/observ/chats_controller.rb +1 -1
- data/app/controllers/observ/dataset_items_controller.rb +1 -1
- data/app/controllers/observ/dataset_runs_controller.rb +2 -2
- data/app/controllers/observ/datasets_controller.rb +2 -2
- data/app/controllers/observ/prompts_controller.rb +3 -3
- data/app/controllers/observ/review_queue_controller.rb +1 -1
- data/app/helpers/observ/dashboard_helper.rb +2 -2
- data/app/helpers/observ/pagination_helper.rb +1 -1
- data/app/helpers/observ/prompts_helper.rb +1 -1
- data/app/models/concerns/observ/prompt_management.rb +10 -0
- data/app/models/observ/prompt.rb +2 -2
- data/app/models/observ/review_item.rb +1 -1
- data/app/models/observ/score.rb +1 -1
- data/app/presenters/observ/agent_select_presenter.rb +3 -3
- data/app/services/observ/chat_instrumenter.rb +1 -1
- data/app/services/observ/dataset_runner_service.rb +1 -1
- data/app/services/observ/evaluator_runner_service.rb +1 -1
- data/app/services/observ/evaluators/contains_evaluator.rb +1 -1
- data/app/services/observ/guardrail_service.rb +1 -1
- data/app/services/observ/moderation_guardrail_service.rb +5 -1
- data/app/services/observ/prompt_manager/caching.rb +15 -2
- data/app/validators/observ/prompt_config_validator.rb +5 -5
- data/config/routes.rb +13 -13
- data/db/migrate/005_create_observ_prompts.rb +2 -2
- data/db/migrate/011_create_observ_dataset_items.rb +1 -1
- data/db/migrate/012_create_observ_dataset_runs.rb +2 -2
- data/db/migrate/013_create_observ_dataset_run_items.rb +1 -1
- data/db/migrate/014_create_observ_scores.rb +2 -2
- data/db/migrate/015_refactor_scores_to_polymorphic.rb +2 -2
- data/db/migrate/016_create_observ_review_items.rb +2 -2
- data/lib/observ/version.rb +1 -1
- data/lib/tasks/observ_tasks.rake +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e2fd5186d6cc6b971534172a5d896f2c4fd10d6fabdd464bf5da1da6a279e5c7
|
|
4
|
+
data.tar.gz: 14114760525a4139cce626694f4e0c679ee5840d7893ad72cd07145690081bb9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dcaa38b4b644a78b3104a4aec95daf19f99bbb6d680e3bf13008305f55df7749a555819b1d99c3681655eecbbbf5fe6a518d2561c07ae05138301d923c085930
|
|
7
|
+
data.tar.gz: 399a4b61a84f103e7bad0384dba8da6d5f86aa3fd24ae84bfa48569c680265c4a5fa163a30627063d841538edcfb85146128ca92ebf1dca854bc72dad91bc51a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Observ
|
|
2
2
|
class AnnotationsController < ApplicationController
|
|
3
|
-
before_action :set_annotatable, except: [
|
|
3
|
+
before_action :set_annotatable, except: [:sessions_index, :traces_index, :export]
|
|
4
4
|
|
|
5
5
|
def index
|
|
6
6
|
@annotations = @annotatable.annotations
|
|
@@ -126,7 +126,7 @@ module Observ
|
|
|
126
126
|
|
|
127
127
|
def generate_csv(annotations)
|
|
128
128
|
CSV.generate(headers: true) do |csv|
|
|
129
|
-
csv << [
|
|
129
|
+
csv << ["ID", "Content", "Annotatable Type", "Annotatable ID", "Created At", "Updated At"]
|
|
130
130
|
|
|
131
131
|
annotations.each do |annotation|
|
|
132
132
|
csv << [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Observ
|
|
4
4
|
class DatasetItemsController < ApplicationController
|
|
5
5
|
before_action :set_dataset
|
|
6
|
-
before_action :set_item, only: [
|
|
6
|
+
before_action :set_item, only: [:edit, :update, :destroy]
|
|
7
7
|
|
|
8
8
|
def index
|
|
9
9
|
@items = @dataset.items.order(created_at: :desc)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Observ
|
|
4
4
|
class DatasetRunsController < ApplicationController
|
|
5
5
|
before_action :set_dataset
|
|
6
|
-
before_action :set_run, only: [
|
|
6
|
+
before_action :set_run, only: [:show, :destroy, :run_evaluators, :review]
|
|
7
7
|
|
|
8
8
|
def index
|
|
9
9
|
@runs = @dataset.runs.order(created_at: :desc)
|
|
@@ -52,7 +52,7 @@ module Observ
|
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def run_evaluators
|
|
55
|
-
evaluator_configs = @dataset.metadata&.dig("evaluators") || [
|
|
55
|
+
evaluator_configs = @dataset.metadata&.dig("evaluators") || [{ "type" => "exact_match" }]
|
|
56
56
|
Observ::EvaluatorRunnerService.new(@run, evaluator_configs: evaluator_configs).call
|
|
57
57
|
|
|
58
58
|
redirect_to dataset_run_path(@dataset, @run),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Observ
|
|
4
4
|
class DatasetsController < ApplicationController
|
|
5
|
-
before_action :set_dataset, only: [
|
|
5
|
+
before_action :set_dataset, only: [:show, :edit, :update, :destroy]
|
|
6
6
|
|
|
7
7
|
def index
|
|
8
8
|
@datasets = Observ::Dataset.order(updated_at: :desc)
|
|
@@ -67,7 +67,7 @@ module Observ
|
|
|
67
67
|
|
|
68
68
|
def available_agents
|
|
69
69
|
Observ::AgentProvider.all_agents.map do |agent|
|
|
70
|
-
[
|
|
70
|
+
[agent.display_name, agent.name]
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Observ
|
|
2
2
|
class PromptsController < ApplicationController
|
|
3
|
-
before_action :set_prompt_name, only: [
|
|
4
|
-
before_action :set_prompt, only: [
|
|
3
|
+
before_action :set_prompt_name, only: [:show, :edit, :update, :destroy, :versions, :compare]
|
|
4
|
+
before_action :set_prompt, only: [:edit, :update, :destroy]
|
|
5
5
|
|
|
6
6
|
# GET /observ/prompts
|
|
7
7
|
def index
|
|
@@ -141,7 +141,7 @@ module Observ
|
|
|
141
141
|
respond_to do |format|
|
|
142
142
|
format.html # Render the HTML view
|
|
143
143
|
format.json do
|
|
144
|
-
render json: @versions.as_json(only: [
|
|
144
|
+
render json: @versions.as_json(only: [:version, :state, :commit_message, :created_at])
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
147
|
end
|
|
@@ -118,7 +118,7 @@ module Observ
|
|
|
118
118
|
def render_json_viewer(data, compact: false)
|
|
119
119
|
return "" if data.nil?
|
|
120
120
|
|
|
121
|
-
css_classes = [
|
|
121
|
+
css_classes = ["observ-json-viewer"]
|
|
122
122
|
css_classes << "observ-json-viewer--compact" if compact
|
|
123
123
|
|
|
124
124
|
content_tag(:div,
|
|
@@ -146,7 +146,7 @@ module Observ
|
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
# Display as plain text
|
|
149
|
-
css_classes = [
|
|
149
|
+
css_classes = ["observ-code-block"]
|
|
150
150
|
css_classes << "observ-code-block--compact" if compact
|
|
151
151
|
content_tag(:pre, content, class: css_classes.join(" "))
|
|
152
152
|
end
|
|
@@ -21,7 +21,7 @@ module Observ
|
|
|
21
21
|
return "" if collection.total_count.zero?
|
|
22
22
|
|
|
23
23
|
from = collection.offset_value + 1
|
|
24
|
-
to = [
|
|
24
|
+
to = [collection.offset_value + collection.limit_value, collection.total_count].min
|
|
25
25
|
total = collection.total_count
|
|
26
26
|
|
|
27
27
|
content_tag(:div, class: "observ-pagination__info") do
|
|
@@ -135,6 +135,15 @@ module Observ
|
|
|
135
135
|
|
|
136
136
|
# Override system_prompt to use prompt management
|
|
137
137
|
def system_prompt
|
|
138
|
+
config = prompt_config.presence || {}
|
|
139
|
+
prompt_name = config[:prompt_name] || default_prompt_name
|
|
140
|
+
current_stamp = Observ::PromptManager.cache_stamp(name: prompt_name)
|
|
141
|
+
|
|
142
|
+
if defined?(@_prompt_cache_stamp) && @_prompt_cache_stamp != current_stamp
|
|
143
|
+
reset_prompt_cache!
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@_prompt_cache_stamp = current_stamp
|
|
138
147
|
@_system_prompt ||= fetch_prompt(variables: prompt_variables)
|
|
139
148
|
end
|
|
140
149
|
|
|
@@ -159,6 +168,7 @@ module Observ
|
|
|
159
168
|
def reset_prompt_cache!
|
|
160
169
|
@_system_prompt = nil
|
|
161
170
|
@_prompt_template = nil
|
|
171
|
+
@_prompt_cache_stamp = nil
|
|
162
172
|
end
|
|
163
173
|
|
|
164
174
|
# Override model to check prompt metadata first
|
data/app/models/observ/prompt.rb
CHANGED
|
@@ -101,7 +101,7 @@ module Observ
|
|
|
101
101
|
|
|
102
102
|
def self.clear_cache(name:)
|
|
103
103
|
# Clear all cache keys for this prompt
|
|
104
|
-
[
|
|
104
|
+
[:draft, :production, :archived].each do |state|
|
|
105
105
|
Rails.cache.delete(cache_key_for(name: name, version: nil, state: state))
|
|
106
106
|
end
|
|
107
107
|
end
|
|
@@ -206,7 +206,7 @@ module Observ
|
|
|
206
206
|
|
|
207
207
|
# Export
|
|
208
208
|
def to_json_export
|
|
209
|
-
as_json(except: [
|
|
209
|
+
as_json(except: [:id, :created_at, :updated_at])
|
|
210
210
|
end
|
|
211
211
|
|
|
212
212
|
def to_yaml_export
|
|
@@ -12,7 +12,7 @@ module Observ
|
|
|
12
12
|
validates :reviewable, presence: true
|
|
13
13
|
validates :reviewable_id, uniqueness: { scope: :reviewable_type }
|
|
14
14
|
|
|
15
|
-
scope :actionable, -> { where(status: [
|
|
15
|
+
scope :actionable, -> { where(status: [:pending, :in_progress]) }
|
|
16
16
|
scope :by_priority, -> { order(priority: :desc, created_at: :asc) }
|
|
17
17
|
scope :sessions, -> { where(reviewable_type: "Observ::Session") }
|
|
18
18
|
scope :traces, -> { where(reviewable_type: "Observ::Trace") }
|
data/app/models/observ/score.rb
CHANGED
|
@@ -13,7 +13,7 @@ module Observ
|
|
|
13
13
|
validates :name, presence: true
|
|
14
14
|
validates :value, presence: true, numericality: true
|
|
15
15
|
validates :scoreable_id, uniqueness: {
|
|
16
|
-
scope: [
|
|
16
|
+
scope: [:scoreable_type, :name, :source],
|
|
17
17
|
message: "already has a score with this name and source"
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -31,7 +31,7 @@ module Observ
|
|
|
31
31
|
# Format: [[display_name, identifier], ...]
|
|
32
32
|
# @return [Array<Array<String>>] options array for select dropdown
|
|
33
33
|
def options
|
|
34
|
-
[
|
|
34
|
+
[default_option] + agent_options
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
# Convenience class method that injects agents from Observ::AgentProvider
|
|
@@ -47,13 +47,13 @@ module Observ
|
|
|
47
47
|
# Default option for "no agent selected" state
|
|
48
48
|
# @return [Array<String>] the default option
|
|
49
49
|
def default_option
|
|
50
|
-
[
|
|
50
|
+
["Default Agent", ""]
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
# Maps agents to [display_name, identifier] pairs
|
|
54
54
|
# @return [Array<Array<String>>] agent options
|
|
55
55
|
def agent_options
|
|
56
|
-
agents.map { |agent| [
|
|
56
|
+
agents.map { |agent| [agent.display_name, agent.agent_identifier] }
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
end
|
|
@@ -578,7 +578,7 @@ module Observ
|
|
|
578
578
|
elsif value.is_a?(Hash)
|
|
579
579
|
truncate_large_hash(value)
|
|
580
580
|
elsif value.is_a?(Array) && value.size > 100
|
|
581
|
-
value[0..99] + [
|
|
581
|
+
value[0..99] + ["... #{value.size - 100} more items"]
|
|
582
582
|
else
|
|
583
583
|
value
|
|
584
584
|
end
|
|
@@ -48,7 +48,7 @@ module Observ
|
|
|
48
48
|
.left_joins(:review_item)
|
|
49
49
|
.where(observ_review_items: { id: nil })
|
|
50
50
|
|
|
51
|
-
sample_size = [
|
|
51
|
+
sample_size = [(items.count * percentage / 100.0).ceil, 1].max
|
|
52
52
|
|
|
53
53
|
items.order("RANDOM()").limit(sample_size).find_each do |item|
|
|
54
54
|
item.enqueue_for_review!(reason: "random_sample", priority: :normal)
|
|
@@ -53,7 +53,11 @@ module Observ
|
|
|
53
53
|
return Result.new(action: :skipped, reason: "already_has_moderation") if has_existing_flags?(trace)
|
|
54
54
|
|
|
55
55
|
with_observability do |_session|
|
|
56
|
-
content = extract_trace_content(
|
|
56
|
+
content = extract_trace_content(
|
|
57
|
+
trace,
|
|
58
|
+
moderate_input: moderate_input,
|
|
59
|
+
moderate_output: moderate_output
|
|
60
|
+
)
|
|
57
61
|
return Result.new(action: :skipped, reason: "no_content") if content.blank?
|
|
58
62
|
|
|
59
63
|
perform_moderation(trace, content)
|
|
@@ -82,13 +82,14 @@ module Observ
|
|
|
82
82
|
# @return [Boolean] true if successful
|
|
83
83
|
def invalidate_cache(name:, version: nil)
|
|
84
84
|
keys = if version
|
|
85
|
-
[
|
|
85
|
+
[cache_key(name: name, version: version)]
|
|
86
86
|
else
|
|
87
87
|
# Invalidate all state-based keys for this prompt
|
|
88
|
-
[
|
|
88
|
+
[:draft, :production, :archived].map { |state| cache_key(name: name, state: state) }
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
keys.each { |key| Rails.cache.delete(key) }
|
|
92
|
+
bump_cache_stamp(name: name)
|
|
92
93
|
Rails.logger.info("Cache invalidated for #{name}#{version ? " v#{version}" : ""}")
|
|
93
94
|
|
|
94
95
|
true
|
|
@@ -121,6 +122,18 @@ module Observ
|
|
|
121
122
|
results
|
|
122
123
|
end
|
|
123
124
|
|
|
125
|
+
def cache_stamp_key(name:)
|
|
126
|
+
"#{Observ.config.prompt_cache_namespace}:#{name}:stamp"
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def cache_stamp(name:)
|
|
130
|
+
Rails.cache.read(cache_stamp_key(name: name))
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def bump_cache_stamp(name:)
|
|
134
|
+
Rails.cache.write(cache_stamp_key(name: name), Time.current.to_f)
|
|
135
|
+
end
|
|
136
|
+
|
|
124
137
|
# Get list of critical prompts (prompts used by agents)
|
|
125
138
|
# @return [Array<String>] Array of prompt names
|
|
126
139
|
def critical_prompt_names
|
|
@@ -77,7 +77,7 @@ module Observ
|
|
|
77
77
|
@errors << "#{key} must be a string"
|
|
78
78
|
end
|
|
79
79
|
when :boolean
|
|
80
|
-
unless [
|
|
80
|
+
unless [true, false].include?(value)
|
|
81
81
|
@errors << "#{key} must be a boolean"
|
|
82
82
|
end
|
|
83
83
|
when :array
|
|
@@ -133,7 +133,7 @@ module Observ
|
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
def validate_unknown_keys
|
|
136
|
-
schema_keys = schema.keys.map { |k| [
|
|
136
|
+
schema_keys = schema.keys.map { |k| [k.to_s, k.to_sym] }.flatten
|
|
137
137
|
config_keys = config.keys
|
|
138
138
|
|
|
139
139
|
unknown_keys = config_keys - schema_keys
|
|
@@ -153,11 +153,11 @@ module Observ
|
|
|
153
153
|
|
|
154
154
|
def value_with_key(key)
|
|
155
155
|
if config.key?(key.to_s)
|
|
156
|
-
[
|
|
156
|
+
[config[key.to_s], key.to_s]
|
|
157
157
|
elsif config.key?(key.to_sym)
|
|
158
|
-
[
|
|
158
|
+
[config[key.to_sym], key.to_sym]
|
|
159
159
|
else
|
|
160
|
-
[
|
|
160
|
+
[nil, nil]
|
|
161
161
|
end
|
|
162
162
|
end
|
|
163
163
|
|
data/config/routes.rb
CHANGED
|
@@ -7,22 +7,22 @@ Observ::Engine.routes.draw do
|
|
|
7
7
|
|
|
8
8
|
# Chat routes - only available if Chat model exists in host app
|
|
9
9
|
if defined?(::Chat) && ::Chat.respond_to?(:acts_as_chat)
|
|
10
|
-
resources :chats, only: [
|
|
11
|
-
resources :messages, only: [
|
|
10
|
+
resources :chats, only: [:index, :new, :create, :show] do
|
|
11
|
+
resources :messages, only: [:create]
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
resources :sessions, only: [
|
|
15
|
+
resources :sessions, only: [:index, :show] do
|
|
16
16
|
member do
|
|
17
17
|
get :metrics
|
|
18
18
|
get :drawer_test
|
|
19
19
|
get :annotations_drawer
|
|
20
20
|
end
|
|
21
|
-
resources :annotations, only: [
|
|
22
|
-
resources :scores, only: [
|
|
21
|
+
resources :annotations, only: [:index, :create, :destroy]
|
|
22
|
+
resources :scores, only: [:create, :destroy]
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
resources :traces, only: [
|
|
25
|
+
resources :traces, only: [:index, :show] do
|
|
26
26
|
collection do
|
|
27
27
|
get :search
|
|
28
28
|
end
|
|
@@ -32,11 +32,11 @@ Observ::Engine.routes.draw do
|
|
|
32
32
|
get :add_to_dataset_drawer
|
|
33
33
|
post :add_to_dataset
|
|
34
34
|
end
|
|
35
|
-
resources :annotations, only: [
|
|
36
|
-
resources :scores, only: [
|
|
35
|
+
resources :annotations, only: [:index, :create, :destroy]
|
|
36
|
+
resources :scores, only: [:create, :destroy]
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
resources :observations, only: [
|
|
39
|
+
resources :observations, only: [:index, :show] do
|
|
40
40
|
collection do
|
|
41
41
|
get :generations
|
|
42
42
|
get :spans
|
|
@@ -47,7 +47,7 @@ Observ::Engine.routes.draw do
|
|
|
47
47
|
get "annotations/traces", to: "annotations#traces_index", as: :traces_annotations
|
|
48
48
|
get "annotations/export", to: "annotations#export", as: :export_annotations
|
|
49
49
|
|
|
50
|
-
resources :reviews, only: [
|
|
50
|
+
resources :reviews, only: [:index, :show], controller: "review_queue" do
|
|
51
51
|
collection do
|
|
52
52
|
get :sessions
|
|
53
53
|
get :traces
|
|
@@ -65,7 +65,7 @@ Observ::Engine.routes.draw do
|
|
|
65
65
|
get :compare # Compare versions
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
resources :versions, only: [
|
|
68
|
+
resources :versions, only: [:show], controller: "prompt_versions" do
|
|
69
69
|
member do
|
|
70
70
|
post :promote # draft -> production
|
|
71
71
|
post :demote # production -> archived
|
|
@@ -76,8 +76,8 @@ Observ::Engine.routes.draw do
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
resources :datasets do
|
|
79
|
-
resources :items, controller: "dataset_items", except: [
|
|
80
|
-
resources :runs, controller: "dataset_runs", only: [
|
|
79
|
+
resources :items, controller: "dataset_items", except: [:show]
|
|
80
|
+
resources :runs, controller: "dataset_runs", only: [:index, :show, :new, :create, :destroy] do
|
|
81
81
|
member do
|
|
82
82
|
post :run_evaluators
|
|
83
83
|
get :review
|
|
@@ -12,10 +12,10 @@ class CreateObservPrompts < ActiveRecord::Migration[7.0]
|
|
|
12
12
|
t.timestamps
|
|
13
13
|
|
|
14
14
|
# Composite unique index for name + version
|
|
15
|
-
t.index [
|
|
15
|
+
t.index [:name, :version], unique: true
|
|
16
16
|
|
|
17
17
|
# Index for state queries (e.g., find all production prompts)
|
|
18
|
-
t.index [
|
|
18
|
+
t.index [:name, :state]
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -15,8 +15,8 @@ class CreateObservDatasetRuns < ActiveRecord::Migration[7.0]
|
|
|
15
15
|
t.integer :total_tokens, default: 0
|
|
16
16
|
t.timestamps
|
|
17
17
|
|
|
18
|
-
t.index [
|
|
19
|
-
t.index [
|
|
18
|
+
t.index [:dataset_id, :name], unique: true
|
|
19
|
+
t.index [:dataset_id, :status]
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -10,7 +10,7 @@ class CreateObservDatasetRunItems < ActiveRecord::Migration[7.0]
|
|
|
10
10
|
t.text :error
|
|
11
11
|
t.timestamps
|
|
12
12
|
|
|
13
|
-
t.index [
|
|
13
|
+
t.index [:dataset_run_id, :dataset_item_id], unique: true, name: "idx_run_items_on_run_and_item"
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
end
|
|
@@ -18,8 +18,8 @@ class CreateObservScores < ActiveRecord::Migration[7.0]
|
|
|
18
18
|
|
|
19
19
|
t.timestamps
|
|
20
20
|
|
|
21
|
-
t.index [
|
|
22
|
-
t.index [
|
|
21
|
+
t.index [:dataset_run_item_id, :name, :source], unique: true, name: "idx_scores_on_run_item_name_source"
|
|
22
|
+
t.index [:trace_id, :name]
|
|
23
23
|
t.index :name
|
|
24
24
|
end
|
|
25
25
|
end
|
|
@@ -19,8 +19,8 @@ class RefactorScoresToPolymorphic < ActiveRecord::Migration[7.0]
|
|
|
19
19
|
remove_column :observ_scores, :trace_id, :bigint
|
|
20
20
|
|
|
21
21
|
# Add new indexes
|
|
22
|
-
add_index :observ_scores, [
|
|
23
|
-
add_index :observ_scores, [
|
|
22
|
+
add_index :observ_scores, [:scoreable_type, :scoreable_id]
|
|
23
|
+
add_index :observ_scores, [:scoreable_type, :scoreable_id, :name, :source],
|
|
24
24
|
unique: true,
|
|
25
25
|
name: "idx_scores_unique_on_scoreable_name_source"
|
|
26
26
|
end
|
|
@@ -17,8 +17,8 @@ class CreateObservReviewItems < ActiveRecord::Migration[7.0]
|
|
|
17
17
|
|
|
18
18
|
t.timestamps
|
|
19
19
|
|
|
20
|
-
t.index [
|
|
21
|
-
t.index [
|
|
20
|
+
t.index [:reviewable_type, :reviewable_id], unique: true, name: "idx_review_items_on_reviewable"
|
|
21
|
+
t.index [:status, :priority, :created_at], name: "idx_review_items_on_status_priority_created"
|
|
22
22
|
t.index :status
|
|
23
23
|
end
|
|
24
24
|
end
|
data/lib/observ/version.rb
CHANGED
data/lib/tasks/observ_tasks.rake
CHANGED
|
@@ -11,7 +11,7 @@ namespace :observ do
|
|
|
11
11
|
rails observ:sync_assets[app/javascript/stylesheets/observ]
|
|
12
12
|
rails observ:sync_assets[app/assets/stylesheets/observ,app/javascript/controllers/observ]
|
|
13
13
|
"
|
|
14
|
-
task :sync_assets, [
|
|
14
|
+
task :sync_assets, [:styles_dest, :js_dest] => :environment do |t, args|
|
|
15
15
|
require "observ/asset_installer"
|
|
16
16
|
|
|
17
17
|
# Get the observ gem root (this task is in observ/lib/tasks)
|
|
@@ -46,7 +46,7 @@ namespace :observ do
|
|
|
46
46
|
rails observ:install_assets[app/javascript/stylesheets/observ]
|
|
47
47
|
rails observ:install_assets[app/assets/stylesheets/observ,app/javascript/controllers/observ]
|
|
48
48
|
"
|
|
49
|
-
task :install_assets, [
|
|
49
|
+
task :install_assets, [:styles_dest, :js_dest] => :environment do |t, args|
|
|
50
50
|
require "observ/asset_installer"
|
|
51
51
|
|
|
52
52
|
# Get the observ gem root
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubyllm-observ
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Franck D'agostini
|
|
@@ -203,14 +203,14 @@ dependencies:
|
|
|
203
203
|
requirements:
|
|
204
204
|
- - "~>"
|
|
205
205
|
- !ruby/object:Gem::Version
|
|
206
|
-
version: '
|
|
206
|
+
version: '2.7'
|
|
207
207
|
type: :development
|
|
208
208
|
prerelease: false
|
|
209
209
|
version_requirements: !ruby/object:Gem::Requirement
|
|
210
210
|
requirements:
|
|
211
211
|
- - "~>"
|
|
212
212
|
- !ruby/object:Gem::Version
|
|
213
|
-
version: '
|
|
213
|
+
version: '2.7'
|
|
214
214
|
- !ruby/object:Gem::Dependency
|
|
215
215
|
name: turbo-rails
|
|
216
216
|
requirement: !ruby/object:Gem::Requirement
|