rhachet-brains-openai 0.1.4 → 0.1.5
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/package.json +1 -1
- package/readme.md +6 -6
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "rhachet-brains-openai",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "rhachet brain.atom and brain.repl adapter for openai",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.5",
|
|
6
6
|
"repository": "ehmpathy/rhachet-brains-openai",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/rhachet-brains-openai",
|
|
8
8
|
"keywords": [
|
package/readme.md
CHANGED
|
@@ -18,14 +18,14 @@ import { z } from 'zod';
|
|
|
18
18
|
const brainAtom = genBrainAtom({ slug: 'openai/gpt-4o-mini' });
|
|
19
19
|
|
|
20
20
|
// simple string output
|
|
21
|
-
const
|
|
21
|
+
const explanation = await brainAtom.ask({
|
|
22
22
|
role: { briefs: [] },
|
|
23
23
|
prompt: 'explain this code',
|
|
24
24
|
schema: { output: z.string() },
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
// structured object output
|
|
28
|
-
const
|
|
28
|
+
const { summary, issues } = await brainAtom.ask({
|
|
29
29
|
role: { briefs: [] },
|
|
30
30
|
prompt: 'analyze this code',
|
|
31
31
|
schema: { output: z.object({ summary: z.string(), issues: z.array(z.string()) }) },
|
|
@@ -35,17 +35,17 @@ const result = await brainAtom.ask({
|
|
|
35
35
|
const brainRepl = genBrainRepl({ slug: 'openai/codex' });
|
|
36
36
|
|
|
37
37
|
// use ask() for read-only operations
|
|
38
|
-
const
|
|
38
|
+
const { analysis } = await brainRepl.ask({
|
|
39
39
|
role: { briefs: [] },
|
|
40
40
|
prompt: 'analyze this codebase',
|
|
41
|
-
schema: { output: z.object({
|
|
41
|
+
schema: { output: z.object({ analysis: z.string() }) },
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
// use act() for read+write operations
|
|
45
|
-
const
|
|
45
|
+
const { proposal } = await brainRepl.act({
|
|
46
46
|
role: { briefs: [] },
|
|
47
47
|
prompt: 'refactor this module',
|
|
48
|
-
schema: { output: z.object({
|
|
48
|
+
schema: { output: z.object({ proposal: z.string() }) },
|
|
49
49
|
});
|
|
50
50
|
```
|
|
51
51
|
|