@picsart/ai-sdk 5.2.0 → 5.3.0

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.
Files changed (2) hide show
  1. package/index.js +4 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -8803,6 +8803,9 @@ function parseTextResult(completed, model) {
8803
8803
  return { text, model: model.id, handle: completed.handle, raw: completed.raw ?? completed.result };
8804
8804
  }
8805
8805
 
8806
+ // src/core/limits.ts
8807
+ var MAX_DRIVE_PROMPT_LENGTH = 18e3;
8808
+
8806
8809
  // src/client/drive.ts
8807
8810
  var USER_REACTION_ATTR = "userReaction";
8808
8811
  function inferResourceType(mode) {
@@ -8866,7 +8869,7 @@ function parseJsonAttr(raw) {
8866
8869
  var asString = (v) => typeof v === "string" && v.trim() ? v : void 0;
8867
8870
  var asStringArray = (v) => Array.isArray(v) && v.length && v.every((x) => typeof x === "string") ? v : void 0;
8868
8871
  function toSdkPayload(params2) {
8869
- const p2 = { prompt: String(params2.prompt ?? "") };
8872
+ const p2 = { prompt: String(params2.prompt ?? "").slice(0, MAX_DRIVE_PROMPT_LENGTH) };
8870
8873
  for (const [key, value] of Object.entries(params2)) {
8871
8874
  if (key === "prompt") continue;
8872
8875
  if (value === void 0 || value === null || value === "") continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picsart/ai-sdk",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "type": "module",
5
5
  "description": "Type-safe SDK for 100+ AI models — image, video, audio, and text generation with Picsart",
6
6
  "license": "MIT",