You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update readme to reflect full feature parity with DotPrompt 0.0.6.1
- Replace outdated feature list with full support table
- Remove note about few-shot not being supported (now implemented)
- Add installation snippet, code usage example, database schema section
- Document new columns (Temperature, OutputSchema, FewShots) and migration behaviour
- Fix broken image path
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This is a SQL store configured to be used with the the DotPrompt library. It currently has support for everything that you would find in DotPrompt prompt files bar a couple of things that are still in development. You can give it a prompt file and it will add the data from the prompt file to a set of related SQL tables.
3
+
A SQL store for the [DotPrompt](https://github.com/elastacloud/dotprompt) library. It stores prompt files in a set of related SQL Server tables, with automatic versioning — a new version is only inserted when the content of a prompt actually changes.
4
4
5
-
In order to use this a CLI is provided which will allow you to add a prompt file to the database as long it adheres to the rules defined in DotPrompt.
5
+
A CLI is provided to add prompt files directly to the database.
**DotPrompt.SQL** currently supports the following features from a prompt file.
31
+
## Supported Features
32
+
33
+
DotPrompt.Sql supports all current DotPrompt prompt file features:
34
+
35
+
| Feature | Supported |
36
+
|---|---|
37
+
| Name | ✅ |
38
+
| Version | ✅ |
39
+
| Model | ✅ |
40
+
| System prompt | ✅ |
41
+
| User prompt | ✅ |
42
+
| Temperature | ✅ |
43
+
| MaxTokens | ✅ |
44
+
| Parameters | ✅ |
45
+
| Default values | ✅ |
46
+
| Output format | ✅ |
47
+
| Output schema (JSON Schema) | ✅ |
48
+
| Few-shot examples | ✅ |
49
+
50
+
## Using the Store in Code
51
+
52
+
Instantiate `SqlTablePromptStore` with an `IPromptRepository` backed by an open `IDbConnection`:
53
+
54
+
```csharp
55
+
IDbConnection connection = new SqlConnection(connectionString);
56
+
IPromptRepository repository = new SqlPromptRepository(connection);
57
+
IPromptStore store = new SqlTablePromptStore(repository);
58
+
59
+
// Load all latest-version prompts
60
+
IEnumerable<PromptFile> prompts = store.Load();
61
+
62
+
// Save a prompt file
63
+
store.Save(myPromptFile, name: null);
64
+
```
65
+
66
+
## Database Schema
67
+
68
+
Tables are created automatically on first run via `CreateDefaultPromptTables.sql`. The schema uses:
26
69
27
-
- System prompt
28
-
- User prompt
29
-
- Model
30
-
- Name
31
-
- Temperature
32
-
- MaxTokens
33
-
- Parameters
34
-
- Default
70
+
- **`PromptFile`** — one row per prompt version, with a unique constraint on `(PromptName, VersionNumber)`
71
+
- **`PromptParameters`** — parameter name/type pairs linked to a prompt version
72
+
- **`ParameterDefaults`** — default values linked to parameters
35
73
36
-
It doesn't currently support the **Few Shot Prompt** section but will shortly. It has been tested only for only username and password database access but will be tested with the others so whilst config is supported access may well break. Let me know if this is the case.
74
+
New columns added in v0.2.3:
37
75
38
-
It will automatically create the tables with a unique constraint on PromptName which name which names that the names in the prompt files should be unique for now although I'll be looking at more composite uniqueness in the future with a **category table** and **categoryid** which will test for unique names within the category itself.
76
+
| Column | Type | Purpose |
77
+
|---|---|---|
78
+
| `Temperature` | `FLOAT NULL` | Maps to `PromptConfig.Temperature` |
0 commit comments