ai 4.1.37 → 4.1.39

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # ai
2
2
 
3
+ ## 4.1.39
4
+
5
+ ### Patch Changes
6
+
7
+ - 075a9a9: fix (ai): improve tsdoc on custom provider
8
+
9
+ ## 4.1.38
10
+
11
+ ### Patch Changes
12
+
13
+ - 4c9c194: chore (ai): add description to provider-defined tools for better accessibility
14
+ - 2e898b4: chore (ai): move mockId test helper into provider utils
15
+ - Updated dependencies [2e898b4]
16
+ - @ai-sdk/provider-utils@2.1.8
17
+ - @ai-sdk/react@1.1.14
18
+ - @ai-sdk/ui-utils@1.1.14
19
+
3
20
  ## 4.1.37
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1526,6 +1526,12 @@ type Tool<PARAMETERS extends Parameters = any, RESULT = any> = {
1526
1526
  */
1527
1527
  parameters: PARAMETERS;
1528
1528
  /**
1529
+ An optional description of what the tool does.
1530
+ Will be used by the language model to decide whether to use the tool.
1531
+ Not used for provider-defined tools.
1532
+ */
1533
+ description?: string;
1534
+ /**
1529
1535
  Optional conversion function that maps the tool result to multi-part tool content for LLMs.
1530
1536
  */
1531
1537
  experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
@@ -1542,10 +1548,6 @@ type Tool<PARAMETERS extends Parameters = any, RESULT = any> = {
1542
1548
  Function tool.
1543
1549
  */
1544
1550
  type?: undefined | 'function';
1545
- /**
1546
- An optional description of what the tool does. Will be used by the language model to decide whether to use the tool.
1547
- */
1548
- description?: string;
1549
1551
  } | {
1550
1552
  /**
1551
1553
  Provider-defined tool.
@@ -2673,8 +2675,9 @@ declare const experimental_wrapLanguageModel: ({ model, middleware: middlewareAr
2673
2675
  * @param {Object} options - The options for creating the custom provider.
2674
2676
  * @param {Record<string, LanguageModel>} [options.languageModels] - A record of language models, where keys are model IDs and values are LanguageModel instances.
2675
2677
  * @param {Record<string, EmbeddingModel<string>>} [options.textEmbeddingModels] - A record of text embedding models, where keys are model IDs and values are EmbeddingModel<string> instances.
2678
+ * @param {Record<string, ImageModel>} [options.imageModels] - A record of image models, where keys are model IDs and values are ImageModel instances.
2676
2679
  * @param {Provider} [options.fallbackProvider] - An optional fallback provider to use when a requested model is not found in the custom provider.
2677
- * @returns {Provider} A Provider object with languageModel and textEmbeddingModel methods.
2680
+ * @returns {Provider} A Provider object with languageModel, textEmbeddingModel, and imageModel methods.
2678
2681
  *
2679
2682
  * @throws {NoSuchModelError} Throws when a requested model is not found and no fallback provider is available.
2680
2683
  */
package/dist/index.d.ts CHANGED
@@ -1526,6 +1526,12 @@ type Tool<PARAMETERS extends Parameters = any, RESULT = any> = {
1526
1526
  */
1527
1527
  parameters: PARAMETERS;
1528
1528
  /**
1529
+ An optional description of what the tool does.
1530
+ Will be used by the language model to decide whether to use the tool.
1531
+ Not used for provider-defined tools.
1532
+ */
1533
+ description?: string;
1534
+ /**
1529
1535
  Optional conversion function that maps the tool result to multi-part tool content for LLMs.
1530
1536
  */
1531
1537
  experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
@@ -1542,10 +1548,6 @@ type Tool<PARAMETERS extends Parameters = any, RESULT = any> = {
1542
1548
  Function tool.
1543
1549
  */
1544
1550
  type?: undefined | 'function';
1545
- /**
1546
- An optional description of what the tool does. Will be used by the language model to decide whether to use the tool.
1547
- */
1548
- description?: string;
1549
1551
  } | {
1550
1552
  /**
1551
1553
  Provider-defined tool.
@@ -2673,8 +2675,9 @@ declare const experimental_wrapLanguageModel: ({ model, middleware: middlewareAr
2673
2675
  * @param {Object} options - The options for creating the custom provider.
2674
2676
  * @param {Record<string, LanguageModel>} [options.languageModels] - A record of language models, where keys are model IDs and values are LanguageModel instances.
2675
2677
  * @param {Record<string, EmbeddingModel<string>>} [options.textEmbeddingModels] - A record of text embedding models, where keys are model IDs and values are EmbeddingModel<string> instances.
2678
+ * @param {Record<string, ImageModel>} [options.imageModels] - A record of image models, where keys are model IDs and values are ImageModel instances.
2676
2679
  * @param {Provider} [options.fallbackProvider] - An optional fallback provider to use when a requested model is not found in the custom provider.
2677
- * @returns {Provider} A Provider object with languageModel and textEmbeddingModel methods.
2680
+ * @returns {Provider} A Provider object with languageModel, textEmbeddingModel, and imageModel methods.
2678
2681
  *
2679
2682
  * @throws {NoSuchModelError} Throws when a requested model is not found and no fallback provider is available.
2680
2683
  */