promptgun 0.11.1 → 0.11.3

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/README.md CHANGED
@@ -18,37 +18,23 @@ for await (const chunk of stream) {
18
18
 
19
19
  ### Data output - single
20
20
  ```typescript
21
- const count /* type: number */ = await ai
22
- .chat('How many countries are in the EU')
23
- .getNumber()
24
- ```
25
- Promptgun will both tell the LLM what shape its output data should be, parse that data to JS types
26
- and correctly Typescript-type the output!
27
-
28
- You can do this for types of any complexity:
29
- ```typescript
30
21
  const restaurants /* type: {name: string, address?: string}[] */ = await ai
31
22
  .chat('Give 5 top restaurants in London')
32
23
  .getArray(o => o
33
24
  .object(o => o
34
25
  .hasString('name')
35
- .canHaveString('address')
26
+ .canHaveString('description', 'A 50 character description')
36
27
  )
37
28
  )
38
29
  ```
30
+ Promptgun will
31
+ * tell the LLM what shape its output data should be,
32
+ * parse that data to JS types,
33
+ * correctly Typescript-type the output and
34
+ * pass your optional hints!
39
35
 
40
- You can also put instructions to the LLM in your type spec:
41
- ```typescript
42
- const restaurants /* type: {name: string, address: string}[] */ = await ai
43
- .chat('Give the top restaurant in London')
44
- .getObject(o => o
45
- .hasString('name')
46
- .hasString('description', 'A 50 character description')
47
- )
48
- ```
49
-
50
- ### Data output - stream data-aware
51
- You can put callbacks on elements of the result data, which get called as they come in:
36
+ ### Data output - stream
37
+ Stream data-aware. Put callbacks on elements of the result data, which get called as they come in:
52
38
  ```typescript
53
39
  await ai
54
40
  .chat('Give 5 top restaurants in London')
@@ -58,7 +44,7 @@ await ai
58
44
  .hasString('address')
59
45
  )
60
46
  )
61
- .onElement(restaurantStream /* type safe */ => {
47
+ .onElement(async restaurantStream /* type safe */ => {
62
48
  console.log(await restaurantStream)
63
49
  })
64
50
  ```
package/build/index.d.ts CHANGED
@@ -35,32 +35,6 @@ export declare const AiModel: {
35
35
  * [Official doc](https://platform.openai.com/docs/models/gpt-4o-audio-preview-2024-12-17)
36
36
  */
37
37
  readonly gpt_4o_audio_preview_2024_12_17: "gpt-4o-audio-preview-2024-12-17";
38
- /**
39
- * | Attribute | Rating | Value |
40
- * |----------------|-----------------|----------------|
41
- * | Intelligence | ○○○○ | High |
42
- * | Speed | ○○○ | Moderate |
43
- * | | Input | Output |
44
- * | Type | Text | Text |
45
- * | Price | Unknown | Unknown |
46
- *
47
- * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
48
- * [Official doc](https://platform.openai.com/docs/models/o3-mini-2025-01-31)
49
- */
50
- readonly o3_mini_2025_01_31: "o3-mini-2025-01-31";
51
- /**
52
- * | Attribute | Rating | Value |
53
- * |----------------|-----------------|----------------|
54
- * | Intelligence | ○○○○ | High |
55
- * | Speed | ○○○ | Moderate |
56
- * | | Input | Output |
57
- * | Type | Text | Text |
58
- * | Price | Unknown | Unknown |
59
- *
60
- * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
61
- * [Official doc](https://platform.openai.com/docs/models/o3-mini)
62
- */
63
- readonly o3_mini: "o3-mini";
64
38
  /**
65
39
  * | Attribute | Rating | Value |
66
40
  * |----------------|-----------------|----------------|
@@ -477,6 +451,19 @@ export declare const AiModel: {
477
451
  * [Official doc](https://platform.openai.com/docs/models/gpt-3.5-turbo-16k)
478
452
  */
479
453
  readonly gpt_3_5_turbo_16k: "gpt-3.5-turbo-16k";
454
+ /**
455
+ * | Attribute | Rating | Value |
456
+ * |----------------|-----------------|----------------|
457
+ * | Intelligence | ? | ? |
458
+ * | Speed | ? | ? |
459
+ * | | Input | Output |
460
+ * | Type | Text | Text |
461
+ * | Price | Unknown | Unknown |
462
+ *
463
+ * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
464
+ * [Official doc](https://platform.openai.com/docs/models/gpt-image-1)
465
+ */
466
+ readonly gpt_image_1: "gpt-image-1";
480
467
  /**
481
468
  * | Attribute | Rating | Value |
482
469
  * |----------------|-----------------|----------------|
@@ -516,32 +503,6 @@ export declare const AiModel: {
516
503
  * [Official doc](https://platform.openai.com/docs/models/gpt-4.5-preview)
517
504
  */
518
505
  readonly gpt_4_5_preview: "gpt-4.5-preview";
519
- /**
520
- * | Attribute | Rating | Value |
521
- * |----------------|-----------------|----------------|
522
- * | Intelligence | ○○○○○ | Very High |
523
- * | Speed | ○○ | Slow |
524
- * | | Input | Output |
525
- * | Type | Text | Text |
526
- * | Price | \$15.00/1M tokens | \$60.00/1M tokens |
527
- *
528
- * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
529
- * [Official doc](https://platform.openai.com/docs/models/o1-2024-12-17)
530
- */
531
- readonly o1_2024_12_17: "o1-2024-12-17";
532
- /**
533
- * | Attribute | Rating | Value |
534
- * |----------------|-----------------|----------------|
535
- * | Intelligence | ○○○○○ | Very High |
536
- * | Speed | ○○ | Slow |
537
- * | | Input | Output |
538
- * | Type | Text | Text |
539
- * | Price | \$15.00/1M tokens | \$60.00/1M tokens |
540
- *
541
- * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
542
- * [Official doc](https://platform.openai.com/docs/models/o1)
543
- */
544
- readonly o1: "o1";
545
506
  /**
546
507
  * | Attribute | Rating | Value |
547
508
  * |----------------|-----------------|----------------|
@@ -558,55 +519,55 @@ export declare const AiModel: {
558
519
  /**
559
520
  * | Attribute | Rating | Value |
560
521
  * |----------------|-----------------|----------------|
561
- * | Intelligence | ○○○○○ | Very High |
562
- * | Speed | ○○ | Slow |
522
+ * | Intelligence | ○○○○ | High |
523
+ * | Speed | ○○○ | Moderate |
563
524
  * | | Input | Output |
564
525
  * | Type | Text | Text |
565
526
  * | Price | Unknown | Unknown |
566
527
  *
567
528
  * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
568
- * [Official doc](https://platform.openai.com/docs/models/o1-pro)
529
+ * [Official doc](https://platform.openai.com/docs/models/gpt-4o-search-preview-2025-03-11)
569
530
  */
570
- readonly o1_pro: "o1-pro";
531
+ readonly gpt_4o_search_preview_2025_03_11: "gpt-4o-search-preview-2025-03-11";
571
532
  /**
572
533
  * | Attribute | Rating | Value |
573
534
  * |----------------|-----------------|----------------|
574
- * | Intelligence | ○○○○ | High |
575
- * | Speed | ○○○ | Moderate |
535
+ * | Intelligence | ○○○ | Moderate |
536
+ * | Speed | ○○○○ | Fast |
576
537
  * | | Input | Output |
577
538
  * | Type | Text | Text |
578
539
  * | Price | Unknown | Unknown |
579
540
  *
580
541
  * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
581
- * [Official doc](https://platform.openai.com/docs/models/gpt-4o-search-preview-2025-03-11)
542
+ * [Official doc](https://platform.openai.com/docs/models/omni-moderation-2024-09-26)
582
543
  */
583
- readonly gpt_4o_search_preview_2025_03_11: "gpt-4o-search-preview-2025-03-11";
544
+ readonly omni_moderation_2024_09_26: "omni-moderation-2024-09-26";
584
545
  /**
585
546
  * | Attribute | Rating | Value |
586
547
  * |----------------|-----------------|----------------|
587
- * | Intelligence | ○○○○○ | Very High |
588
- * | Speed | ○○ | Slow |
548
+ * | Intelligence | ○○○○ | High |
549
+ * | Speed | ○○○ | Moderate |
589
550
  * | | Input | Output |
590
551
  * | Type | Text | Text |
591
552
  * | Price | Unknown | Unknown |
592
553
  *
593
554
  * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
594
- * [Official doc](https://platform.openai.com/docs/models/o1-pro-2025-03-19)
555
+ * [Official doc](https://platform.openai.com/docs/models/o3-mini)
595
556
  */
596
- readonly o1_pro_2025_03_19: "o1-pro-2025-03-19";
557
+ readonly o3_mini: "o3-mini";
597
558
  /**
598
559
  * | Attribute | Rating | Value |
599
560
  * |----------------|-----------------|----------------|
600
- * | Intelligence | ○○○ | Moderate |
601
- * | Speed | ○○○○ | Fast |
561
+ * | Intelligence | ○○○○ | High |
562
+ * | Speed | ○○○ | Moderate |
602
563
  * | | Input | Output |
603
564
  * | Type | Text | Text |
604
565
  * | Price | Unknown | Unknown |
605
566
  *
606
567
  * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
607
- * [Official doc](https://platform.openai.com/docs/models/omni-moderation-2024-09-26)
568
+ * [Official doc](https://platform.openai.com/docs/models/o3-mini-2025-01-31)
608
569
  */
609
- readonly omni_moderation_2024_09_26: "omni-moderation-2024-09-26";
570
+ readonly o3_mini_2025_01_31: "o3-mini-2025-01-31";
610
571
  /**
611
572
  * | Attribute | Rating | Value |
612
573
  * |----------------|-----------------|----------------|
@@ -750,6 +711,19 @@ export declare const AiModel: {
750
711
  * [Official doc](https://platform.openai.com/docs/models/gpt-3.5-turbo-0125)
751
712
  */
752
713
  readonly gpt_3_5_turbo_0125: "gpt-3.5-turbo-0125";
714
+ /**
715
+ * | Attribute | Rating | Value |
716
+ * |----------------|-----------------|----------------|
717
+ * | Intelligence | ○○○○○ | Very High |
718
+ * | Speed | ○○ | Slow |
719
+ * | | Input | Output |
720
+ * | Type | Text | Text |
721
+ * | Price | \$15.00/1M tokens | \$60.00/1M tokens |
722
+ *
723
+ * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
724
+ * [Official doc](https://platform.openai.com/docs/models/o1)
725
+ */
726
+ readonly o1: "o1";
753
727
  /**
754
728
  * | Attribute | Rating | Value |
755
729
  * |----------------|-----------------|----------------|
@@ -763,6 +737,45 @@ export declare const AiModel: {
763
737
  * [Official doc](https://platform.openai.com/docs/models/o1-mini-2024-09-12)
764
738
  */
765
739
  readonly o1_mini_2024_09_12: "o1-mini-2024-09-12";
740
+ /**
741
+ * | Attribute | Rating | Value |
742
+ * |----------------|-----------------|----------------|
743
+ * | Intelligence | ○○○○○ | Very High |
744
+ * | Speed | ○○ | Slow |
745
+ * | | Input | Output |
746
+ * | Type | Text | Text |
747
+ * | Price | \$15.00/1M tokens | \$60.00/1M tokens |
748
+ *
749
+ * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
750
+ * [Official doc](https://platform.openai.com/docs/models/o1-2024-12-17)
751
+ */
752
+ readonly o1_2024_12_17: "o1-2024-12-17";
753
+ /**
754
+ * | Attribute | Rating | Value |
755
+ * |----------------|-----------------|----------------|
756
+ * | Intelligence | ○○○○○ | Very High |
757
+ * | Speed | ○○ | Slow |
758
+ * | | Input | Output |
759
+ * | Type | Text | Text |
760
+ * | Price | Unknown | Unknown |
761
+ *
762
+ * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
763
+ * [Official doc](https://platform.openai.com/docs/models/o1-pro)
764
+ */
765
+ readonly o1_pro: "o1-pro";
766
+ /**
767
+ * | Attribute | Rating | Value |
768
+ * |----------------|-----------------|----------------|
769
+ * | Intelligence | ○○○○○ | Very High |
770
+ * | Speed | ○○ | Slow |
771
+ * | | Input | Output |
772
+ * | Type | Text | Text |
773
+ * | Price | Unknown | Unknown |
774
+ *
775
+ * Note, this documentation is auto-generated and may contain errors. For the most accurate information, please refer to the official documentation.
776
+ * [Official doc](https://platform.openai.com/docs/models/o1-pro-2025-03-19)
777
+ */
778
+ readonly o1_pro_2025_03_19: "o1-pro-2025-03-19";
766
779
  /**
767
780
  * | Attribute | Rating | Value |
768
781
  * |----------------|-----------------|----------------|