@ai-sdk/provider 0.0.16 → 0.0.17

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/dist/index.d.mts CHANGED
@@ -445,7 +445,18 @@ type LanguageModelV1CallSettings = {
445
445
  type: 'text';
446
446
  } | {
447
447
  type: 'json';
448
+ /**
449
+ * JSON schema that the generated output should conform to.
450
+ */
448
451
  schema?: JSONSchema7;
452
+ /**
453
+ * Name of output that should be generated. Used by some providers for additional LLM guidance.
454
+ */
455
+ name?: string;
456
+ /**
457
+ * Description of the output that should be generated. Used by some providers for additional LLM guidance.
458
+ */
459
+ description?: string;
449
460
  };
450
461
  /**
451
462
  The seed (integer) to use for random sampling. If set and supported
@@ -607,7 +618,8 @@ type LanguageModelV1CallOptions = LanguageModelV1CallSettings & {
607
618
  object-tool mode.
608
619
 
609
620
  @deprecated mode will be removed in v2.
610
- All necessary settings will be directly supported through the call settings.
621
+ All necessary settings will be directly supported through the call settings,
622
+ in particular responseFormat, toolChoice, and tools.
611
623
  */
612
624
  mode: {
613
625
  type: 'regular';
@@ -621,7 +633,18 @@ Specifies how the tool should be selected. Defaults to 'auto'.
621
633
  toolChoice?: LanguageModelV1ToolChoice;
622
634
  } | {
623
635
  type: 'object-json';
624
- schema: JSONSchema7;
636
+ /**
637
+ * JSON schema that the generated output should conform to.
638
+ */
639
+ schema?: JSONSchema7;
640
+ /**
641
+ * Name of output that should be generated. Used by some providers for additional LLM guidance.
642
+ */
643
+ name?: string;
644
+ /**
645
+ * Description of the output that should be generated. Used by some providers for additional LLM guidance.
646
+ */
647
+ description?: string;
625
648
  } | {
626
649
  type: 'object-tool';
627
650
  tool: LanguageModelV1FunctionTool;
@@ -724,12 +747,22 @@ type LanguageModelV1 = {
724
747
  */
725
748
  readonly supportsImageUrls?: boolean;
726
749
  /**
727
- Flag whether this model supports structured outputs,
750
+ Flag whether this model supports grammar-guided generation,
728
751
  i.e. follows JSON schemas for object generation
729
752
  when the response format is set to 'json' or
730
753
  when the `object-json` mode is used.
731
754
 
755
+ This means that the model guarantees that the generated JSON
756
+ will be a valid JSON object AND that the object will match the
757
+ JSON schema.
758
+
759
+ Please note that `generateObject` and `streamObject` will work
760
+ regardless of this flag, but might send different prompts and
761
+ use further optimizations if this flag is set to `true`.
762
+
732
763
  Defaults to `false`.
764
+
765
+ TODO rename to supportsGrammarGuidedGeneration in v2
733
766
  */
734
767
  readonly supportsStructuredOutputs?: boolean;
735
768
  /**
package/dist/index.d.ts CHANGED
@@ -445,7 +445,18 @@ type LanguageModelV1CallSettings = {
445
445
  type: 'text';
446
446
  } | {
447
447
  type: 'json';
448
+ /**
449
+ * JSON schema that the generated output should conform to.
450
+ */
448
451
  schema?: JSONSchema7;
452
+ /**
453
+ * Name of output that should be generated. Used by some providers for additional LLM guidance.
454
+ */
455
+ name?: string;
456
+ /**
457
+ * Description of the output that should be generated. Used by some providers for additional LLM guidance.
458
+ */
459
+ description?: string;
449
460
  };
450
461
  /**
451
462
  The seed (integer) to use for random sampling. If set and supported
@@ -607,7 +618,8 @@ type LanguageModelV1CallOptions = LanguageModelV1CallSettings & {
607
618
  object-tool mode.
608
619
 
609
620
  @deprecated mode will be removed in v2.
610
- All necessary settings will be directly supported through the call settings.
621
+ All necessary settings will be directly supported through the call settings,
622
+ in particular responseFormat, toolChoice, and tools.
611
623
  */
612
624
  mode: {
613
625
  type: 'regular';
@@ -621,7 +633,18 @@ Specifies how the tool should be selected. Defaults to 'auto'.
621
633
  toolChoice?: LanguageModelV1ToolChoice;
622
634
  } | {
623
635
  type: 'object-json';
624
- schema: JSONSchema7;
636
+ /**
637
+ * JSON schema that the generated output should conform to.
638
+ */
639
+ schema?: JSONSchema7;
640
+ /**
641
+ * Name of output that should be generated. Used by some providers for additional LLM guidance.
642
+ */
643
+ name?: string;
644
+ /**
645
+ * Description of the output that should be generated. Used by some providers for additional LLM guidance.
646
+ */
647
+ description?: string;
625
648
  } | {
626
649
  type: 'object-tool';
627
650
  tool: LanguageModelV1FunctionTool;
@@ -724,12 +747,22 @@ type LanguageModelV1 = {
724
747
  */
725
748
  readonly supportsImageUrls?: boolean;
726
749
  /**
727
- Flag whether this model supports structured outputs,
750
+ Flag whether this model supports grammar-guided generation,
728
751
  i.e. follows JSON schemas for object generation
729
752
  when the response format is set to 'json' or
730
753
  when the `object-json` mode is used.
731
754
 
755
+ This means that the model guarantees that the generated JSON
756
+ will be a valid JSON object AND that the object will match the
757
+ JSON schema.
758
+
759
+ Please note that `generateObject` and `streamObject` will work
760
+ regardless of this flag, but might send different prompts and
761
+ use further optimizations if this flag is set to `true`.
762
+
732
763
  Defaults to `false`.
764
+
765
+ TODO rename to supportsGrammarGuidedGeneration in v2
733
766
  */
734
767
  readonly supportsStructuredOutputs?: boolean;
735
768
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",