ai 3.2.15 → 3.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "3.2.15",
3
+ "version": "3.2.17",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -58,12 +58,12 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@ai-sdk/provider": "0.0.11",
61
- "@ai-sdk/provider-utils": "1.0.0",
62
- "@ai-sdk/react": "0.0.15",
63
- "@ai-sdk/solid": "0.0.11",
64
- "@ai-sdk/svelte": "0.0.12",
65
- "@ai-sdk/ui-utils": "0.0.9",
66
- "@ai-sdk/vue": "0.0.11",
61
+ "@ai-sdk/provider-utils": "1.0.1",
62
+ "@ai-sdk/react": "0.0.17",
63
+ "@ai-sdk/solid": "0.0.12",
64
+ "@ai-sdk/svelte": "0.0.13",
65
+ "@ai-sdk/ui-utils": "0.0.10",
66
+ "@ai-sdk/vue": "0.0.12",
67
67
  "eventsource-parser": "1.1.2",
68
68
  "jsondiffpatch": "0.6.0",
69
69
  "json-schema": "0.4.0",
@@ -91,7 +91,7 @@
91
91
  "eslint": "^7.32.0",
92
92
  "jsdom": "^24.0.0",
93
93
  "langchain": "0.0.196",
94
- "msw": "2.0.9",
94
+ "msw": "2.3.1",
95
95
  "openai": "4.47.1",
96
96
  "react-dom": "^18",
97
97
  "react-server-dom-webpack": "18.3.0-canary-eb33bd747-20240312",
@@ -5,6 +5,6 @@ export { CreateMessage, Message, UseChatHelpers, UseChatOptions } from '@ai-sdk/
5
5
  declare const useChat: typeof useChat$1;
6
6
  declare const useCompletion: typeof useCompletion$1;
7
7
  declare const useAssistant: typeof useAssistant$1;
8
- declare const experimental_useObject: <RESULT, INPUT = any>({ api, id, schema, initialValue, fetch, }: _ai_sdk_react.Experimental_UseObjectOptions<RESULT>) => _ai_sdk_react.Experimental_UseObjectHelpers<RESULT, INPUT>;
8
+ declare const experimental_useObject: <RESULT, INPUT = any>({ api, id, schema, initialValue, fetch, onError, }: _ai_sdk_react.Experimental_UseObjectOptions<RESULT>) => _ai_sdk_react.Experimental_UseObjectHelpers<RESULT, INPUT>;
9
9
 
10
10
  export { experimental_useObject, useAssistant, useChat, useCompletion };
@@ -5,7 +5,7 @@ export { CreateMessage, Message, UseChatHelpers, UseChatOptions } from '@ai-sdk/
5
5
  declare const useChat: typeof useChat$1;
6
6
  declare const useCompletion: typeof useCompletion$1;
7
7
  declare const useAssistant: typeof useAssistant$1;
8
- declare const experimental_useObject: <RESULT, INPUT = any>({ api, id, schema, initialValue, fetch, }: _ai_sdk_react.Experimental_UseObjectOptions<RESULT>) => _ai_sdk_react.Experimental_UseObjectHelpers<RESULT, INPUT>;
8
+ declare const experimental_useObject: <RESULT, INPUT = any>({ api, id, schema, initialValue, fetch, onError, }: _ai_sdk_react.Experimental_UseObjectOptions<RESULT>) => _ai_sdk_react.Experimental_UseObjectHelpers<RESULT, INPUT>;
9
9
 
10
10
  export { experimental_useObject, useAssistant, useChat, useCompletion };
11
11
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -466,6 +466,16 @@ function getValidatedPrompt(prompt) {
466
466
  message: "prompt and messages cannot be defined at the same time"
467
467
  });
468
468
  }
469
+ if (prompt.messages != null) {
470
+ for (const message of prompt.messages) {
471
+ if (message.role === "system" && typeof message.content !== "string") {
472
+ throw new InvalidPromptError({
473
+ prompt,
474
+ message: "system message content must be a string"
475
+ });
476
+ }
477
+ }
478
+ }
469
479
  return prompt.prompt != null ? {
470
480
  type: "prompt",
471
481
  prompt: prompt.prompt,
@@ -1209,7 +1219,7 @@ function createStreamableValueImpl(initialValue) {
1209
1219
  }
1210
1220
  warningTimeout = setTimeout(() => {
1211
1221
  console.warn(
1212
- "The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call `.done()`."
1222
+ "The streamable value has been slow to update. This may be a bug or a performance issue or you forgot to call `.done()`."
1213
1223
  );
1214
1224
  }, DEV_DEFAULT_STREAMABLE_WARNING_TIME);
1215
1225
  }