promptgun 0.10.0 → 0.10.1

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 (2) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -18,7 +18,7 @@ for await (const chunk of stream) {
18
18
 
19
19
  ### Data output - single
20
20
  ```typescript
21
- const count /* type: boolean */ = await ai
21
+ const count /* type: number */ = await ai
22
22
  .chat('How many countries are in the EU')
23
23
  .toNumber()
24
24
  ```
@@ -26,12 +26,12 @@ Promptgun will both tell the LLM what shape its output data should be, parse tha
26
26
 
27
27
  You can do this for types of any complexity:
28
28
  ```typescript
29
- const restaurants /* type: {name: string, address: string}[] */ = await ai
29
+ const restaurants /* type: {name: string, address?: string}[] */ = await ai
30
30
  .chat('Give 5 top restaurants in London')
31
31
  .toArray(o => o
32
32
  .object(o => o
33
33
  .hasString('name')
34
- .hasString('address')
34
+ .canHaveString('address')
35
35
  )
36
36
  )
37
37
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptgun",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "type": "module",
5
5
  "exports": "./build/index.js",
6
6
  "types": "./build/index.d.ts",