completion-kit 0.28.22 → 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: 4002f7ff2f3f043b2ea72eae0f0db0bf86721a50ff8732f06e7c36f61fa50fd0
4
- data.tar.gz: 021d6558136345e259cfb9ffe496316b09e459c3649e31e85b044aa4fe5f0bfb
3
+ metadata.gz: 4c5b5a45e20e1884194db7473fa6bc44e75b33b919d1790dfa240f2e3902bd48
4
+ data.tar.gz: c6eeabc0e477591231895f42868514d50363b34834967d0088593e360ccaf04b
5
5
  SHA512:
6
- metadata.gz: 074ae258466fa22de1769596d9a2f92b0cbecc81e97db3ab42968070e646c95e682fbcde310a860b98cbeba3c16ede4daa204f3f070a93b63ff4d818cda51e3a
7
- data.tar.gz: 6e9d91eca839c24c41991c8178efb4ebacab4559b0188bc9e4f79d2a9ca58f125126a95df6e24eb24b9b79904e577053f1727398aad11deb3a4b64bec2253df6
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
@@ -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 saving creates a new version of this prompt.</p>
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">
@@ -1,3 +1,3 @@
1
1
  module CompletionKit
2
- VERSION = "0.28.22"
2
+ VERSION = "0.28.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: completion-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.22
4
+ version: 0.28.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Bastin