anbaric 1.40.0 → 1.41.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.
package/docs/api/stores.md
CHANGED
|
@@ -88,27 +88,27 @@ const key = await secrets.retrieve("stripe-key", actor);
|
|
|
88
88
|
|
|
89
89
|
## `PromptManager`
|
|
90
90
|
|
|
91
|
-
Versioned prompts - instructions plus optional
|
|
92
|
-
|
|
91
|
+
Versioned prompts - instructions plus an optional output schema - owned by the
|
|
92
|
+
calling app.
|
|
93
93
|
|
|
94
94
|
```ts
|
|
95
95
|
PromptManagerFactory.instance() : PromptManager
|
|
96
96
|
|
|
97
97
|
// methods:
|
|
98
|
-
save(promptId : string, instructions : string,
|
|
98
|
+
save(promptId : string, instructions : string, outputSchema? : JsonSchema) : Promise<Prompt>
|
|
99
99
|
retrieve(promptId : string, version? : number) : Promise<Prompt>
|
|
100
100
|
list() : Promise<Array<Prompt>>
|
|
101
101
|
history(promptId : string) : Promise<Array<Prompt>>
|
|
102
102
|
|
|
103
103
|
type Prompt = {
|
|
104
104
|
appId : string, promptId : string, version : number, instructions : string,
|
|
105
|
-
|
|
105
|
+
outputSchema? : JsonSchema, createdAt : string,
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
```ts
|
|
110
110
|
const prompts = PromptManagerFactory.instance();
|
|
111
|
-
await prompts.save("triage", "Decide the priority.",
|
|
111
|
+
await prompts.save("triage", "Decide the priority.", { type: "object", properties: { priority: { type: "string" } } });
|
|
112
112
|
const latest = await prompts.retrieve("triage"); // highest version
|
|
113
113
|
const specific = await prompts.retrieve("triage", 1);
|
|
114
114
|
const all = await prompts.list(); // latest of each prompt
|
|
@@ -66,7 +66,7 @@ import {PromptManagerFactory} from "anbaric";
|
|
|
66
66
|
|
|
67
67
|
const prompts = PromptManagerFactory.instance();
|
|
68
68
|
await prompts.save("triage", "Decide the priority of the support ticket from its subject.",
|
|
69
|
-
|
|
69
|
+
{ type: "object", properties: { priority: { type: "string", enum: ["low", "high"] } } });
|
|
70
70
|
|
|
71
71
|
const prompt = await prompts.retrieve("triage");
|
|
72
72
|
const triage = new RemoteLLMAgenticAction("Triage the ticket", triager,
|
package/docs/features/prompts.md
CHANGED
|
@@ -20,15 +20,14 @@ const prompts = PromptManagerFactory.instance();
|
|
|
20
20
|
await prompts.save(
|
|
21
21
|
"triage",
|
|
22
22
|
"Decide the priority of the support ticket from its subject and body. Escalate anything mentioning an outage.",
|
|
23
|
-
{ type: "object", required: ["subject", "body"], properties: { subject: { type: "string" }, body: { type: "string" } } },
|
|
24
23
|
{ type: "object", required: ["priority"], properties: { priority: { type: "string", enum: ["low", "high"] } } },
|
|
25
24
|
);
|
|
26
25
|
```
|
|
27
26
|
|
|
28
|
-
A prompt has an **id**, its **instructions**, and optionally an **
|
|
29
|
-
schema**
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
A prompt has an **id**, its **instructions**, and optionally an **output
|
|
28
|
+
schema** - what the model must produce. Edit the instructions and redeploy: the
|
|
29
|
+
next save stores version 2. There's no rollback and no tagging - an app always
|
|
30
|
+
gets the latest.
|
|
32
31
|
|
|
33
32
|
## Use the latest where you call the model
|
|
34
33
|
|
|
@@ -56,7 +55,8 @@ const versions = await prompts.history("triage"); // every version, newest first
|
|
|
56
55
|
```
|
|
57
56
|
|
|
58
57
|
The console's **Prompts** page shows the same for every app on the tenant: each
|
|
59
|
-
prompt, its current instructions and
|
|
58
|
+
prompt, its current instructions and output schema, and the full history to
|
|
59
|
+
browse.
|
|
60
60
|
|
|
61
61
|
## Everything is scoped to your app
|
|
62
62
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anbaric",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.0",
|
|
4
4
|
"description": "Everything needed to write an Anbaric app: state machines, jobs, document and secret stores, local in-memory implementations and the Anbaric Cloud clients",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"prepublishOnly": "npm run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"anbaric-impl-cloud": "^1.
|
|
28
|
-
"anbaric-data-store": "^1.
|
|
29
|
-
"anbaric-state-machine": "^1.
|
|
30
|
-
"anbaric-tsapi": "^1.
|
|
27
|
+
"anbaric-impl-cloud": "^1.41.0",
|
|
28
|
+
"anbaric-data-store": "^1.41.0",
|
|
29
|
+
"anbaric-state-machine": "^1.41.0",
|
|
30
|
+
"anbaric-tsapi": "^1.41.0"
|
|
31
31
|
}
|
|
32
32
|
}
|