ai 3.2.16 → 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/dist/index.mjs CHANGED
@@ -389,6 +389,16 @@ function getValidatedPrompt(prompt) {
389
389
  message: "prompt and messages cannot be defined at the same time"
390
390
  });
391
391
  }
392
+ if (prompt.messages != null) {
393
+ for (const message of prompt.messages) {
394
+ if (message.role === "system" && typeof message.content !== "string") {
395
+ throw new InvalidPromptError({
396
+ prompt,
397
+ message: "system message content must be a string"
398
+ });
399
+ }
400
+ }
401
+ }
392
402
  return prompt.prompt != null ? {
393
403
  type: "prompt",
394
404
  prompt: prompt.prompt,