prompt_navigator 1.0.0 → 2.0.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/models/prompt_navigator/prompt_execution.rb +16 -0
- data/lib/prompt_navigator/version.rb +1 -1
- 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: 1519a5a4fc2a28bda0f3795d7ce91f15afeeab646db88d53888cce56ef031869
|
|
4
|
+
data.tar.gz: 6dd58cf6962f7db2fcdb51937147926588d69c8d2c9d71e32d7e923632038789
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf79eba4420fc941941e99cc7701b3b0970227f62e171b23b43750ea5342b90b4600efdac5290a309f8d1773dfe71673719cfd7d11da9718b4e96e99a558afe0
|
|
7
|
+
data.tar.gz: 1146200b8a8eecd25555f3b83f858039d323b775832566cd4c8a2d80584417c224cb61fb7400e5637359f7b6071aa5257fa873c5dd0d3c7e352ee3afe1e76b25
|
data/README.md
CHANGED
|
@@ -13,6 +13,22 @@ module PromptNavigator
|
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
# Bulk-delete a set of PromptExecutions, tolerating the self-referential
|
|
17
|
+
# `previous_id` foreign key by first nulling intra-set links. Callers
|
|
18
|
+
# (e.g. a host's Chat#destroy flow) pass the ids of orphaned executions
|
|
19
|
+
# after their owning records (Messages) have been destroyed.
|
|
20
|
+
#
|
|
21
|
+
# Raises ActiveRecord::InvalidForeignKey if any PE in the set is still
|
|
22
|
+
# referenced from outside the set (e.g. another chat's branch); callers
|
|
23
|
+
# decide whether to rescue and leave the orphans in place.
|
|
24
|
+
def self.delete_set!(ids)
|
|
25
|
+
ids = Array(ids).compact
|
|
26
|
+
return if ids.empty?
|
|
27
|
+
|
|
28
|
+
where(id: ids).update_all(previous_id: nil)
|
|
29
|
+
where(id: ids).delete_all
|
|
30
|
+
end
|
|
31
|
+
|
|
16
32
|
private
|
|
17
33
|
|
|
18
34
|
# Returns ancestor PromptExecutions in chronological order (oldest first),
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: prompt_navigator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- dhq_boiler
|
|
@@ -79,14 +79,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
79
79
|
requirements:
|
|
80
80
|
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 3.
|
|
82
|
+
version: 3.4.9
|
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
requirements:
|
|
85
85
|
- - ">="
|
|
86
86
|
- !ruby/object:Gem::Version
|
|
87
87
|
version: '0'
|
|
88
88
|
requirements: []
|
|
89
|
-
rubygems_version:
|
|
89
|
+
rubygems_version: 3.6.9
|
|
90
90
|
specification_version: 4
|
|
91
91
|
summary: A Rails engine for managing and visualizing LLM prompt execution history.
|
|
92
92
|
test_files: []
|