completion-kit 0.28.21 → 0.28.23
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: 4c5b5a45e20e1884194db7473fa6bc44e75b33b919d1790dfa240f2e3902bd48
|
|
4
|
+
data.tar.gz: c6eeabc0e477591231895f42868514d50363b34834967d0088593e360ccaf04b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b604a731fd81ba9c6aadd87f00e5a0b7665685df4651a3fca27e2995375cfcac7a48ef8860ba573abd3af612fd4cdee1224ec804a0fbd57a7bdbee50bd996684
|
|
7
|
+
data.tar.gz: 566e496833459b9f16e8c19251e4847d71c917e14bdb408fee2f5d08252aa542a554a4578fbcc9dfbc62e53e89c288745eda4a1cbadd78310b86d10c70b96b85
|
|
@@ -32,7 +32,7 @@ module CompletionKit
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def update
|
|
35
|
-
if @prompt.runs.exists?
|
|
35
|
+
if @prompt.runs.exists? && behavioral_change?
|
|
36
36
|
new_prompt = @prompt.build_next_version(prompt_params.to_h)
|
|
37
37
|
if new_prompt.valid?
|
|
38
38
|
CompletionKit::ApplicationRecord.transaction do
|
|
@@ -63,7 +63,16 @@ module CompletionKit
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
private
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
BEHAVIORAL_ATTRS = %w[template llm_model].freeze
|
|
68
|
+
|
|
69
|
+
def behavioral_change?
|
|
70
|
+
permitted = prompt_params
|
|
71
|
+
BEHAVIORAL_ATTRS.any? do |attr|
|
|
72
|
+
permitted.key?(attr) && permitted[attr].to_s != @prompt.public_send(attr).to_s
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
67
76
|
def set_prompt
|
|
68
77
|
@prompt = Prompt.find(params[:id])
|
|
69
78
|
end
|
|
@@ -314,13 +314,14 @@ module CompletionKit
|
|
|
314
314
|
if judge
|
|
315
315
|
judge_metrics = llm_judge_configured? ? llm_metrics.to_a : []
|
|
316
316
|
chk_metrics = check_metrics.to_a
|
|
317
|
-
response_ids.
|
|
318
|
-
judge_metrics.
|
|
319
|
-
|
|
317
|
+
review_jobs = response_ids.flat_map do |rid|
|
|
318
|
+
judge_metrics.map { |m| JudgeReviewJob.new(rid, m.id, id) } +
|
|
319
|
+
chk_metrics.map { |m| CheckReviewJob.new(rid, m.id, id) }
|
|
320
320
|
end
|
|
321
|
+
ActiveJob.perform_all_later(review_jobs) if review_jobs.any?
|
|
321
322
|
RunCompletionCheckJob.perform_later(id)
|
|
322
323
|
else
|
|
323
|
-
response_ids.
|
|
324
|
+
ActiveJob.perform_all_later(response_ids.map { |rid| GenerateRowJob.new(id, rid) })
|
|
324
325
|
end
|
|
325
326
|
end
|
|
326
327
|
rescue ActiveRecord::RecordInvalid => e
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<% end %>
|
|
20
20
|
|
|
21
21
|
<% if prompt.persisted? && prompt.runs.exists? %>
|
|
22
|
-
<p class="ck-version-note">Editing <%= prompt.version_label %>. It has runs, so
|
|
22
|
+
<p class="ck-version-note">Editing <%= prompt.version_label %>. It has runs, so changing the prompt or model saves a new version. Name and tags update in place.</p>
|
|
23
23
|
<% end %>
|
|
24
24
|
|
|
25
25
|
<div class="ck-card ck-form-card">
|