@wix/auto_sdk_ai-gateway_prompts 1.0.0 → 1.0.1

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 (37) hide show
  1. package/build/cjs/index.d.ts +484 -1
  2. package/build/cjs/index.js +196 -3
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -1
  5. package/build/cjs/index.typings.js +188 -3
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +466 -2
  8. package/build/cjs/meta.js +167 -3
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +484 -1
  11. package/build/es/index.mjs +194 -2
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +1 -1
  14. package/build/es/index.typings.mjs +186 -2
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +466 -2
  17. package/build/es/meta.mjs +165 -2
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +15 -3
  20. package/build/internal/cjs/index.js +196 -3
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +494 -1
  23. package/build/internal/cjs/index.typings.js +188 -3
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +466 -2
  26. package/build/internal/cjs/meta.js +167 -3
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +15 -3
  29. package/build/internal/es/index.mjs +194 -2
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +494 -1
  32. package/build/internal/es/index.typings.mjs +186 -2
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +466 -2
  35. package/build/internal/es/meta.mjs +165 -2
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -12,7 +12,14 @@ import { transformRESTBytesToSDKBytes } from "@wix/sdk-runtime/transformations/b
12
12
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
13
13
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
14
14
  function resolveWixApiInfraV1WixAiExternalGatewayUrl(opts) {
15
- const domainToMappings = {};
15
+ const domainToMappings = {
16
+ "www.wixapis.com": [
17
+ {
18
+ srcPath: "/ai-external-gateway-poc",
19
+ destPath: ""
20
+ }
21
+ ]
22
+ };
16
23
  return resolveUrl(Object.assign(opts, { domainToMappings }));
17
24
  }
18
25
  var PACKAGE_NAME = "@wix/auto_sdk_ai-gateway_prompts";
@@ -312,6 +319,141 @@ function generateContentByPromptObject(payload) {
312
319
  }
313
320
  return __generateContentByPromptObject;
314
321
  }
322
+ function generateTextByPromptObjectStreamed(payload) {
323
+ function __generateTextByPromptObjectStreamed({ host }) {
324
+ const serializedData = transformPaths(payload, [
325
+ {
326
+ transformFn: transformSDKFloatToRESTFloat,
327
+ paths: [
328
+ { path: "prompt.openAiChatCompletionRequest.temperature" },
329
+ { path: "prompt.openAiChatCompletionRequest.topP" },
330
+ { path: "prompt.openAiChatCompletionRequest.presencePenalty" },
331
+ { path: "prompt.openAiChatCompletionRequest.frequencyPenalty" },
332
+ { path: "prompt.googleTextBisonRequest.parameters.temperature" },
333
+ { path: "prompt.googleTextBisonRequest.parameters.topP" },
334
+ { path: "prompt.googleChatBisonRequest.parameters.temperature" },
335
+ { path: "prompt.googleChatBisonRequest.parameters.topP" },
336
+ { path: "prompt.azureChatCompletionRequest.temperature" },
337
+ { path: "prompt.azureChatCompletionRequest.topP" },
338
+ { path: "prompt.azureChatCompletionRequest.presencePenalty" },
339
+ { path: "prompt.azureChatCompletionRequest.frequencyPenalty" },
340
+ {
341
+ path: "prompt.googleGeminiGenerateContentRequest.generationConfig.temperature"
342
+ },
343
+ {
344
+ path: "prompt.googleGeminiGenerateContentRequest.generationConfig.topP"
345
+ },
346
+ { path: "prompt.anthropicClaudeRequest.temperature" },
347
+ { path: "prompt.anthropicClaudeRequest.topP" },
348
+ { path: "prompt.googleAnthropicClaudeRequest.temperature" },
349
+ { path: "prompt.googleAnthropicClaudeRequest.topP" },
350
+ { path: "prompt.invokeAnthropicModelRequest.temperature" },
351
+ { path: "prompt.invokeAnthropicModelRequest.topP" },
352
+ { path: "prompt.stabilityAiTextToImageRequest.textPrompts.weight" },
353
+ { path: "prompt.stabilityAiStableDiffusionRequest.strength" },
354
+ {
355
+ path: "prompt.blackForestLabsGenerateImageRequest.imagePromptStrength"
356
+ },
357
+ { path: "prompt.replicateCreatePredictionRequest.fluxPulid.trueCfg" },
358
+ {
359
+ path: "prompt.replicateCreatePredictionRequest.fluxPulid.idWeight"
360
+ },
361
+ {
362
+ path: "prompt.replicateCreatePredictionRequest.fluxPulid.guidanceScale"
363
+ },
364
+ {
365
+ path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.loraStrength"
366
+ },
367
+ {
368
+ path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.guidanceScale"
369
+ },
370
+ {
371
+ path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.controlStrength"
372
+ },
373
+ {
374
+ path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.imageToImageStrength"
375
+ },
376
+ { path: "prompt.stabilityAiEditWithPromptRequest.creativity" },
377
+ { path: "prompt.runwareTextToImageRequest.strength" },
378
+ { path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.trueCfg" },
379
+ { path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.idWeight" },
380
+ {
381
+ path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.guidanceScale"
382
+ },
383
+ { path: "prompt.googleCreateChatCompletionRequest.temperature" },
384
+ { path: "prompt.googleCreateChatCompletionRequest.topP" },
385
+ { path: "prompt.googleCreateChatCompletionRequest.presencePenalty" },
386
+ { path: "prompt.googleCreateChatCompletionRequest.frequencyPenalty" },
387
+ { path: "prompt.mlPlatformOpenAiRawRequest.temperature" },
388
+ { path: "prompt.mlPlatformOpenAiRawRequest.topP" },
389
+ { path: "prompt.mlPlatformOpenAiRawRequest.presencePenalty" },
390
+ { path: "prompt.mlPlatformOpenAiRawRequest.frequencyPenalty" },
391
+ { path: "prompt.openAiResponsesRequest.temperature" },
392
+ { path: "prompt.openAiResponsesRequest.topP" },
393
+ { path: "prompt.azureOpenAiResponsesRequest.temperature" },
394
+ { path: "prompt.azureOpenAiResponsesRequest.topP" },
395
+ { path: "prompt.llamaModelRequest.temperature" },
396
+ { path: "prompt.llamaModelRequest.topP" },
397
+ { path: "prompt.runwareTextToImageRequest.cfgScale" },
398
+ { path: "prompt.runwareTextToImageRequest.loraModels.weight" },
399
+ { path: "prompt.mlPlatformLlamaModelRequest.temperature" },
400
+ { path: "prompt.mlPlatformLlamaModelRequest.topP" },
401
+ { path: "prompt.perplexityChatCompletionRequest.temperature" },
402
+ { path: "prompt.perplexityChatCompletionRequest.topP" },
403
+ { path: "prompt.perplexityChatCompletionRequest.topK" },
404
+ { path: "prompt.perplexityChatCompletionRequest.presencePenalty" },
405
+ { path: "prompt.perplexityChatCompletionRequest.frequencyPenalty" },
406
+ { path: "prompt.runwareVideoInferenceRequest.cfgScale" }
407
+ ]
408
+ }
409
+ ]);
410
+ const metadata = {
411
+ entityFqdn: "wix.api_infra.v1.prompt_proxy",
412
+ method: "POST",
413
+ methodFqn: "wix.api_infra.v1.WixAiExternalGateway.GenerateTextByPromptObjectStreamed",
414
+ packageName: PACKAGE_NAME,
415
+ migrationOptions: {
416
+ optInTransformResponse: true
417
+ },
418
+ url: resolveWixApiInfraV1WixAiExternalGatewayUrl({
419
+ protoPath: "/v1/generate-by-prompt-object-streamed",
420
+ data: serializedData,
421
+ host
422
+ }),
423
+ data: serializedData,
424
+ transformResponse: (payload2) => transformPaths(payload2, [
425
+ {
426
+ transformFn: transformRESTFloatToSDKFloat,
427
+ paths: [
428
+ {
429
+ path: "googleGeminiStreamChunk.candidates.safetyRatings.probabilityScore"
430
+ },
431
+ {
432
+ path: "googleGeminiStreamChunk.candidates.safetyRatings.severityScore"
433
+ },
434
+ {
435
+ path: "googleGeminiStreamChunk.candidates.groundingMetadata.groundingSupports.confidenceScores",
436
+ isRepeated: true
437
+ },
438
+ {
439
+ path: "googleGeminiStreamChunk.candidates.groundingMetadata.retrievalMetadata.googleSearchDynamicRetrievalScore"
440
+ }
441
+ ]
442
+ },
443
+ {
444
+ transformFn: transformRESTBytesToSDKBytes,
445
+ paths: [
446
+ {
447
+ path: "googleGeminiStreamChunk.candidates.groundingMetadata.searchEntryPoint.sdkBlob"
448
+ }
449
+ ]
450
+ }
451
+ ])
452
+ };
453
+ return metadata;
454
+ }
455
+ return __generateTextByPromptObjectStreamed;
456
+ }
315
457
 
316
458
  // src/api-infra-v1-prompt-proxy-prompts.universal.ts
317
459
  var OpenaiproxyV1Model = /* @__PURE__ */ ((OpenaiproxyV1Model2) => {
@@ -983,6 +1125,47 @@ async function generateContentByPromptObject2(options) {
983
1125
  throw transformedError;
984
1126
  }
985
1127
  }
1128
+ async function generateTextByPromptObjectStreamed2(options) {
1129
+ const { httpClient, sideEffects } = arguments[1];
1130
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1131
+ prompt: options?.prompt,
1132
+ params: options?.params,
1133
+ userRequestInfo: options?.userRequestInfo,
1134
+ fallbackProperties: options?.fallbackProperties,
1135
+ dynamicProperties: options?.dynamicProperties,
1136
+ dynamicRequestConfig: options?.dynamicRequestConfig,
1137
+ asyncResultTopic: options?.asyncResultTopic
1138
+ });
1139
+ const reqOpts = generateTextByPromptObjectStreamed(
1140
+ payload
1141
+ );
1142
+ sideEffects?.onSiteCall?.();
1143
+ try {
1144
+ const result = await httpClient.request(reqOpts);
1145
+ sideEffects?.onSuccess?.(result);
1146
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1147
+ } catch (err) {
1148
+ const transformedError = sdkTransformError(
1149
+ err,
1150
+ {
1151
+ spreadPathsToArguments: {},
1152
+ explicitPathsToArguments: {
1153
+ prompt: "$[0].prompt",
1154
+ params: "$[0].params",
1155
+ userRequestInfo: "$[0].userRequestInfo",
1156
+ fallbackProperties: "$[0].fallbackProperties",
1157
+ dynamicProperties: "$[0].dynamicProperties",
1158
+ dynamicRequestConfig: "$[0].dynamicRequestConfig",
1159
+ asyncResultTopic: "$[0].asyncResultTopic"
1160
+ },
1161
+ singleArgumentUnchanged: false
1162
+ },
1163
+ ["options"]
1164
+ );
1165
+ sideEffects?.onError?.(err);
1166
+ throw transformedError;
1167
+ }
1168
+ }
986
1169
  export {
987
1170
  AnthropicModel,
988
1171
  CacheControlType,
@@ -1056,6 +1239,7 @@ export {
1056
1239
  V1ToolChoiceType,
1057
1240
  VideoGenModel,
1058
1241
  VideoModel,
1059
- generateContentByPromptObject2 as generateContentByPromptObject
1242
+ generateContentByPromptObject2 as generateContentByPromptObject,
1243
+ generateTextByPromptObjectStreamed2 as generateTextByPromptObjectStreamed
1060
1244
  };
1061
1245
  //# sourceMappingURL=index.typings.mjs.map