prompt_manager 0.5.7 → 0.5.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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/COMMITS.md +196 -0
  4. data/README.md +485 -203
  5. data/docs/.keep +0 -0
  6. data/docs/advanced/custom-keywords.md +421 -0
  7. data/docs/advanced/dynamic-directives.md +535 -0
  8. data/docs/advanced/performance.md +612 -0
  9. data/docs/advanced/search-integration.md +635 -0
  10. data/docs/api/configuration.md +355 -0
  11. data/docs/api/directive-processor.md +431 -0
  12. data/docs/api/prompt-class.md +354 -0
  13. data/docs/api/storage-adapters.md +462 -0
  14. data/docs/assets/favicon.ico +1 -0
  15. data/docs/assets/logo.svg +24 -0
  16. data/docs/core-features/comments.md +48 -0
  17. data/docs/core-features/directive-processing.md +38 -0
  18. data/docs/core-features/erb-integration.md +68 -0
  19. data/docs/core-features/error-handling.md +197 -0
  20. data/docs/core-features/parameter-history.md +76 -0
  21. data/docs/core-features/parameterized-prompts.md +500 -0
  22. data/docs/core-features/shell-integration.md +79 -0
  23. data/docs/development/architecture.md +544 -0
  24. data/docs/development/contributing.md +425 -0
  25. data/docs/development/roadmap.md +234 -0
  26. data/docs/development/testing.md +822 -0
  27. data/docs/examples/advanced.md +523 -0
  28. data/docs/examples/basic.md +688 -0
  29. data/docs/examples/real-world.md +776 -0
  30. data/docs/examples.md +337 -0
  31. data/docs/getting-started/basic-concepts.md +318 -0
  32. data/docs/getting-started/installation.md +97 -0
  33. data/docs/getting-started/quick-start.md +256 -0
  34. data/docs/index.md +230 -0
  35. data/docs/migration/v0.9.0.md +459 -0
  36. data/docs/migration/v1.0.0.md +591 -0
  37. data/docs/storage/activerecord-adapter.md +348 -0
  38. data/docs/storage/custom-adapters.md +176 -0
  39. data/docs/storage/filesystem-adapter.md +236 -0
  40. data/docs/storage/overview.md +427 -0
  41. data/examples/advanced_integrations.rb +52 -0
  42. data/examples/prompts_dir/advanced_demo.txt +79 -0
  43. data/examples/prompts_dir/directive_example.json +1 -0
  44. data/examples/prompts_dir/directive_example.txt +8 -0
  45. data/examples/prompts_dir/todo.json +1 -1
  46. data/improvement_plan.md +996 -0
  47. data/lib/prompt_manager/storage/file_system_adapter.rb +8 -2
  48. data/lib/prompt_manager/version.rb +1 -1
  49. data/mkdocs.yml +146 -0
  50. data/prompt_manager_logo.png +0 -0
  51. metadata +46 -3
  52. data/LICENSE.txt +0 -21
@@ -189,8 +189,14 @@ class PromptManager::Storage::FileSystemAdapter
189
189
  params_path = file_path(prompt_id, params_extension)
190
190
  file_parameters = params_path.exist? ? deserialize(read_file(params_path)) : {}
191
191
 
192
- # Merge parsed parameters with file parameters
193
- parsed_parameters.merge(file_parameters)
192
+ # Only preserve JSON values for parameters that exist in the current text
193
+ parsed_parameters.each_key do |key|
194
+ if file_parameters.key?(key) && file_parameters[key].is_a?(Array)
195
+ parsed_parameters[key] = file_parameters[key]
196
+ end
197
+ end
198
+
199
+ parsed_parameters
194
200
  end
195
201
 
196
202
  # Parse parameters from the prompt text
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PromptManager
4
- VERSION = "0.5.7"
4
+ VERSION = "0.5.8"
5
5
  end
data/mkdocs.yml ADDED
@@ -0,0 +1,146 @@
1
+ site_name: PromptManager Documentation
2
+ site_description: Comprehensive documentation for the PromptManager Ruby gem - Manage parameterized prompts for generative AI
3
+ site_author: MadBomber
4
+ site_url: https://madbomber.github.io/prompt_manager
5
+ repo_url: https://github.com/MadBomber/prompt_manager
6
+ repo_name: MadBomber/prompt_manager
7
+ edit_uri: edit/main/docs/
8
+
9
+ theme:
10
+ name: material
11
+ logo: assets/logo.svg
12
+ favicon: assets/favicon.ico
13
+ palette:
14
+ - media: "(prefers-color-scheme: light)"
15
+ scheme: default
16
+ primary: indigo
17
+ accent: amber
18
+ toggle:
19
+ icon: material/brightness-7
20
+ name: Switch to dark mode
21
+ - media: "(prefers-color-scheme: dark)"
22
+ scheme: slate
23
+ primary: indigo
24
+ accent: amber
25
+ toggle:
26
+ icon: material/brightness-4
27
+ name: Switch to light mode
28
+ features:
29
+ - navigation.instant
30
+ - navigation.tracking
31
+ - navigation.tabs
32
+ - navigation.tabs.sticky
33
+ - navigation.sections
34
+ - navigation.expand
35
+ - navigation.path
36
+ - navigation.prune
37
+ - navigation.indexes
38
+ - navigation.top
39
+ - toc.follow
40
+ - toc.integrate
41
+ - search.suggest
42
+ - search.highlight
43
+ - search.share
44
+ - header.autohide
45
+ - content.code.copy
46
+ - content.code.annotate
47
+ - content.tabs.link
48
+
49
+ plugins:
50
+ - search:
51
+ separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;'
52
+
53
+ markdown_extensions:
54
+ - abbr
55
+ - admonition
56
+ - attr_list
57
+ - def_list
58
+ - footnotes
59
+ - md_in_html
60
+ - toc:
61
+ permalink: true
62
+ toc_depth: 3
63
+ - pymdownx.arithmatex:
64
+ generic: true
65
+ - pymdownx.betterem:
66
+ smart_enable: all
67
+ - pymdownx.caret
68
+ - pymdownx.details
69
+ - pymdownx.emoji:
70
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
71
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
72
+ - pymdownx.highlight:
73
+ anchor_linenums: true
74
+ line_spans: __span
75
+ pygments_lang_class: true
76
+ - pymdownx.inlinehilite
77
+ - pymdownx.keys
78
+ - pymdownx.mark
79
+ - pymdownx.smartsymbols
80
+ - pymdownx.superfences:
81
+ custom_fences:
82
+ - name: mermaid
83
+ class: mermaid
84
+ format: !!python/name:pymdownx.superfences.fence_code_format
85
+ - pymdownx.tabbed:
86
+ alternate_style: true
87
+ - pymdownx.tasklist:
88
+ custom_checkbox: true
89
+ - pymdownx.tilde
90
+
91
+ extra:
92
+ social:
93
+ - icon: fontawesome/brands/github
94
+ link: https://github.com/MadBomber/prompt_manager
95
+ name: GitHub Repository
96
+ - icon: fontawesome/solid/gem
97
+ link: https://rubygems.org/gems/prompt_manager
98
+ name: RubyGems Package
99
+ version:
100
+ provider: mike
101
+ default: latest
102
+
103
+ nav:
104
+ - Home: index.md
105
+ - Getting Started:
106
+ - Installation: getting-started/installation.md
107
+ - Quick Start: getting-started/quick-start.md
108
+ - Basic Concepts: getting-started/basic-concepts.md
109
+ - Core Features:
110
+ - Parameterized Prompts: core-features/parameterized-prompts.md
111
+ - Directive Processing: core-features/directive-processing.md
112
+ - ERB Integration: core-features/erb-integration.md
113
+ - Shell Integration: core-features/shell-integration.md
114
+ - Comments & Documentation: core-features/comments.md
115
+ - Parameter History: core-features/parameter-history.md
116
+ - Error Handling: core-features/error-handling.md
117
+ - Storage Adapters:
118
+ - Overview: storage/overview.md
119
+ - FileSystemAdapter: storage/filesystem-adapter.md
120
+ - ActiveRecordAdapter: storage/activerecord-adapter.md
121
+ - Custom Adapters: storage/custom-adapters.md
122
+ - API Reference:
123
+ - Prompt Class: api/prompt-class.md
124
+ - Storage Adapters: api/storage-adapters.md
125
+ - Directive Processor: api/directive-processor.md
126
+ - Configuration: api/configuration.md
127
+ - Advanced Usage:
128
+ - Custom Keywords: advanced/custom-keywords.md
129
+ - Dynamic Directives: advanced/dynamic-directives.md
130
+ - Search Integration: advanced/search-integration.md
131
+ - Performance Tips: advanced/performance.md
132
+ - Examples:
133
+ - Overview: examples.md
134
+ - Basic Examples: examples/basic.md
135
+ - Advanced Examples: examples/advanced.md
136
+ - Real World Use Cases: examples/real-world.md
137
+ - Development:
138
+ - Architecture: development/architecture.md
139
+ - Contributing: development/contributing.md
140
+ - Testing: development/testing.md
141
+ - Roadmap: development/roadmap.md
142
+ - Migration Guides:
143
+ - Version 0.9.0: migration/v0.9.0.md
144
+ - Version 1.0.0: migration/v1.0.0.md
145
+
146
+ copyright: Copyright © 2024 MadBomber - MIT License
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prompt_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -133,17 +133,58 @@ files:
133
133
  - ".envrc"
134
134
  - ".irbrc"
135
135
  - CHANGELOG.md
136
+ - COMMITS.md
136
137
  - LICENSE
137
- - LICENSE.txt
138
138
  - README.md
139
139
  - Rakefile
140
+ - docs/.keep
141
+ - docs/advanced/custom-keywords.md
142
+ - docs/advanced/dynamic-directives.md
143
+ - docs/advanced/performance.md
144
+ - docs/advanced/search-integration.md
145
+ - docs/api/configuration.md
146
+ - docs/api/directive-processor.md
147
+ - docs/api/prompt-class.md
148
+ - docs/api/storage-adapters.md
149
+ - docs/assets/favicon.ico
150
+ - docs/assets/logo.svg
151
+ - docs/core-features/comments.md
152
+ - docs/core-features/directive-processing.md
153
+ - docs/core-features/erb-integration.md
154
+ - docs/core-features/error-handling.md
155
+ - docs/core-features/parameter-history.md
156
+ - docs/core-features/parameterized-prompts.md
157
+ - docs/core-features/shell-integration.md
158
+ - docs/development/architecture.md
159
+ - docs/development/contributing.md
160
+ - docs/development/roadmap.md
161
+ - docs/development/testing.md
162
+ - docs/examples.md
163
+ - docs/examples/advanced.md
164
+ - docs/examples/basic.md
165
+ - docs/examples/real-world.md
166
+ - docs/getting-started/basic-concepts.md
167
+ - docs/getting-started/installation.md
168
+ - docs/getting-started/quick-start.md
169
+ - docs/index.md
170
+ - docs/migration/v0.9.0.md
171
+ - docs/migration/v1.0.0.md
172
+ - docs/storage/activerecord-adapter.md
173
+ - docs/storage/custom-adapters.md
174
+ - docs/storage/filesystem-adapter.md
175
+ - docs/storage/overview.md
176
+ - examples/advanced_integrations.rb
140
177
  - examples/directives.rb
178
+ - examples/prompts_dir/advanced_demo.txt
179
+ - examples/prompts_dir/directive_example.json
180
+ - examples/prompts_dir/directive_example.txt
141
181
  - examples/prompts_dir/todo.json
142
182
  - examples/prompts_dir/todo.txt
143
183
  - examples/prompts_dir/toy/8-ball.txt
144
184
  - examples/rgfzf
145
185
  - examples/simple.rb
146
186
  - examples/using_search_proc.rb
187
+ - improvement_plan.md
147
188
  - lib/prompt_manager.rb
148
189
  - lib/prompt_manager/directive_processor.rb
149
190
  - lib/prompt_manager/prompt.rb
@@ -151,6 +192,8 @@ files:
151
192
  - lib/prompt_manager/storage/active_record_adapter.rb
152
193
  - lib/prompt_manager/storage/file_system_adapter.rb
153
194
  - lib/prompt_manager/version.rb
195
+ - mkdocs.yml
196
+ - prompt_manager_logo.png
154
197
  homepage: https://github.com/MadBomber/prompt_manager
155
198
  licenses:
156
199
  - MIT
@@ -173,7 +216,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
216
  - !ruby/object:Gem::Version
174
217
  version: '0'
175
218
  requirements: []
176
- rubygems_version: 3.6.9
219
+ rubygems_version: 3.7.1
177
220
  specification_version: 4
178
221
  summary: Manage prompts for use with gen-AI processes
179
222
  test_files: []
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2023 Dewayne VanHoozer
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.