prompt_manager 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/lib/prompt_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b3b9572e08d0f90b7857d9451a13e0ed5d3b089761a1ce820d3b4cf9a47b805
|
4
|
+
data.tar.gz: aa374359e5200177d631ce9607bac8559529bdc968a661820110017021414605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 992bc7f9e337d3fadbc99d0d192a325640bc113f244dd0bf448273398717e9e0d60d0e2a2ee02d18f617e3c9687efaee8fc36c6594f0a3819ca9e877140d6164
|
7
|
+
data.tar.gz: a7d7891c715aa4beea562a82135e2f945d36d4e2132eb39efaf71a8795572dc804ef55bd253a34734a4d84bfb1e516fd6f973dc0c62da0b63fb4ad59cd18f5c2
|
data/README.md
CHANGED
@@ -14,31 +14,31 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
17
|
-
See [examples/simple.rb](examples
|
17
|
+
See [examples/simple.rb](examples/simple.rb)
|
18
18
|
|
19
19
|
## Overview
|
20
20
|
|
21
21
|
### Generative AI (gen-AI)
|
22
22
|
|
23
|
-
Gen-AI deals with the conversion (some would say execution) of a human natural language text (the "prompt") into somthing else using what are known as large language models (LLM) such as those available from OpenAI. A parameterized prompt is one in
|
23
|
+
Gen-AI deals with the conversion (some would say execution) of a human natural language text (the "prompt") into somthing else using what are known as large language models (LLM) such as those available from OpenAI. A parameterized prompt is one in which there are embedded keywords (parameters) which are place holders for other text to be inserted into the prompt.
|
24
24
|
|
25
|
-
The prompt_manager uses a
|
25
|
+
The prompt_manager uses a regular expression to identify these keywords within the prompt. It uses the keywords as keys in a `parameters` Hash which is stored with the prompt text in a serialized form - for example as JSON.
|
26
26
|
|
27
27
|
#### What does a keyword look like?
|
28
28
|
|
29
|
-
The current hard-coded REGEX for a [KEYWORD] identifies any all [UPPERCASE_TEXT] enclosed in
|
29
|
+
The current hard-coded REGEX for a [KEYWORD] identifies any all [UPPERCASE_TEXT] enclosed in square brackets as a keyword. [KEYWORDS CAN ALSO HAVE SPACES] as well as the underscore character.
|
30
30
|
|
31
|
-
This is just the initial convention adopted by prompt_manager.
|
31
|
+
This is just the initial convention adopted by prompt_manager. It is intended that this REGEX be configurable so that the prompt_manager can be used with other conventions.
|
32
32
|
|
33
33
|
### Storage Adapters
|
34
34
|
|
35
|
-
A storage adapter is a class instance that ties the `PromptManager::Prompt` class to a storage facility that holds the actual prompts.
|
35
|
+
A storage adapter is a class instance that ties the `PromptManager::Prompt` class to a storage facility that holds the actual prompts. Currently there are 3 storage adapters planned for implementation.
|
36
36
|
|
37
37
|
#### FileSystemAdapter
|
38
38
|
|
39
|
-
This is the first storage adapter developed.
|
39
|
+
This is the first storage adapter developed. It saves prompts as text files within the file system inside a designated `prompts_dir` (directory) such as `~/.prompts` or where it makes the most sense to you. Another example would be to have your directory on a shared file system so that others can use the same prompts.
|
40
40
|
|
41
|
-
The `
|
41
|
+
The `prompt ID` is the basename of the text file. For example `todo.txt` is the file for the prompt ID `todo` (see the examples directory.)
|
42
42
|
|
43
43
|
The parameters for the `todo` prompt ID are saved in the same directory as `todo.txt` in a JSON file named `todo.json` (also in the examples directory.)
|
44
44
|
|
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dewayne VanHoozer
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: "Manage the parameterized prompts (text) used in generative AI (aka chatGPT,
|
56
|
-
\
|
56
|
+
\nOpenAI, et.al.) using storage adapters such as FileSystemAdapter, \nSqliteAdapter
|
57
57
|
and ActiveRecordAdapter.\n"
|
58
58
|
email:
|
59
59
|
- dvanhoozer@gmail.com
|