@wix/auto_sdk_ai-gateway_prompts 1.0.0 → 1.0.2
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/build/cjs/index.d.ts +525 -4
- package/build/cjs/index.js +211 -8
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +203 -8
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +507 -5
- package/build/cjs/meta.js +182 -8
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +525 -4
- package/build/es/index.mjs +208 -7
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +200 -7
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +507 -5
- package/build/es/meta.mjs +179 -7
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +16 -4
- package/build/internal/cjs/index.js +211 -8
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +536 -5
- package/build/internal/cjs/index.typings.js +203 -8
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +507 -5
- package/build/internal/cjs/meta.js +182 -8
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +16 -4
- package/build/internal/es/index.mjs +208 -7
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +536 -5
- package/build/internal/es/index.typings.mjs +200 -7
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +507 -5
- package/build/internal/es/meta.mjs +179 -7
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
ClipGuidancePreset: () => ClipGuidancePreset,
|
|
30
30
|
ContentRole: () => ContentRole,
|
|
31
31
|
CreatePredictionModel: () => CreatePredictionModel,
|
|
32
|
+
DynamicRetrievalConfigMode: () => DynamicRetrievalConfigMode,
|
|
32
33
|
EditImageWithPromptRequestModel: () => EditImageWithPromptRequestModel,
|
|
33
34
|
FinishReason: () => FinishReason,
|
|
34
35
|
GatewayMessageDefinitionRole: () => GatewayMessageDefinitionRole,
|
|
@@ -92,7 +93,8 @@ __export(index_exports, {
|
|
|
92
93
|
V1ToolChoiceType: () => V1ToolChoiceType,
|
|
93
94
|
VideoGenModel: () => VideoGenModel,
|
|
94
95
|
VideoModel: () => VideoModel,
|
|
95
|
-
generateContentByPromptObject: () => generateContentByPromptObject4
|
|
96
|
+
generateContentByPromptObject: () => generateContentByPromptObject4,
|
|
97
|
+
generateTextByPromptObjectStreamed: () => generateTextByPromptObjectStreamed4
|
|
96
98
|
});
|
|
97
99
|
module.exports = __toCommonJS(index_exports);
|
|
98
100
|
|
|
@@ -107,7 +109,14 @@ var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
|
|
|
107
109
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
108
110
|
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
109
111
|
function resolveWixApiInfraV1WixAiExternalGatewayUrl(opts) {
|
|
110
|
-
const domainToMappings = {
|
|
112
|
+
const domainToMappings = {
|
|
113
|
+
"www.wixapis.com": [
|
|
114
|
+
{
|
|
115
|
+
srcPath: "/ai-external-gateway-poc",
|
|
116
|
+
destPath: ""
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
};
|
|
111
120
|
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
112
121
|
}
|
|
113
122
|
var PACKAGE_NAME = "@wix/auto_sdk_ai-gateway_prompts";
|
|
@@ -407,6 +416,141 @@ function generateContentByPromptObject(payload) {
|
|
|
407
416
|
}
|
|
408
417
|
return __generateContentByPromptObject;
|
|
409
418
|
}
|
|
419
|
+
function generateTextByPromptObjectStreamed(payload) {
|
|
420
|
+
function __generateTextByPromptObjectStreamed({ host }) {
|
|
421
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
422
|
+
{
|
|
423
|
+
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
424
|
+
paths: [
|
|
425
|
+
{ path: "prompt.openAiChatCompletionRequest.temperature" },
|
|
426
|
+
{ path: "prompt.openAiChatCompletionRequest.topP" },
|
|
427
|
+
{ path: "prompt.openAiChatCompletionRequest.presencePenalty" },
|
|
428
|
+
{ path: "prompt.openAiChatCompletionRequest.frequencyPenalty" },
|
|
429
|
+
{ path: "prompt.googleTextBisonRequest.parameters.temperature" },
|
|
430
|
+
{ path: "prompt.googleTextBisonRequest.parameters.topP" },
|
|
431
|
+
{ path: "prompt.googleChatBisonRequest.parameters.temperature" },
|
|
432
|
+
{ path: "prompt.googleChatBisonRequest.parameters.topP" },
|
|
433
|
+
{ path: "prompt.azureChatCompletionRequest.temperature" },
|
|
434
|
+
{ path: "prompt.azureChatCompletionRequest.topP" },
|
|
435
|
+
{ path: "prompt.azureChatCompletionRequest.presencePenalty" },
|
|
436
|
+
{ path: "prompt.azureChatCompletionRequest.frequencyPenalty" },
|
|
437
|
+
{
|
|
438
|
+
path: "prompt.googleGeminiGenerateContentRequest.generationConfig.temperature"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
path: "prompt.googleGeminiGenerateContentRequest.generationConfig.topP"
|
|
442
|
+
},
|
|
443
|
+
{ path: "prompt.anthropicClaudeRequest.temperature" },
|
|
444
|
+
{ path: "prompt.anthropicClaudeRequest.topP" },
|
|
445
|
+
{ path: "prompt.googleAnthropicClaudeRequest.temperature" },
|
|
446
|
+
{ path: "prompt.googleAnthropicClaudeRequest.topP" },
|
|
447
|
+
{ path: "prompt.invokeAnthropicModelRequest.temperature" },
|
|
448
|
+
{ path: "prompt.invokeAnthropicModelRequest.topP" },
|
|
449
|
+
{ path: "prompt.stabilityAiTextToImageRequest.textPrompts.weight" },
|
|
450
|
+
{ path: "prompt.stabilityAiStableDiffusionRequest.strength" },
|
|
451
|
+
{
|
|
452
|
+
path: "prompt.blackForestLabsGenerateImageRequest.imagePromptStrength"
|
|
453
|
+
},
|
|
454
|
+
{ path: "prompt.replicateCreatePredictionRequest.fluxPulid.trueCfg" },
|
|
455
|
+
{
|
|
456
|
+
path: "prompt.replicateCreatePredictionRequest.fluxPulid.idWeight"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
path: "prompt.replicateCreatePredictionRequest.fluxPulid.guidanceScale"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.loraStrength"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.guidanceScale"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.controlStrength"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.imageToImageStrength"
|
|
472
|
+
},
|
|
473
|
+
{ path: "prompt.stabilityAiEditWithPromptRequest.creativity" },
|
|
474
|
+
{ path: "prompt.runwareTextToImageRequest.strength" },
|
|
475
|
+
{ path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.trueCfg" },
|
|
476
|
+
{ path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.idWeight" },
|
|
477
|
+
{
|
|
478
|
+
path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.guidanceScale"
|
|
479
|
+
},
|
|
480
|
+
{ path: "prompt.googleCreateChatCompletionRequest.temperature" },
|
|
481
|
+
{ path: "prompt.googleCreateChatCompletionRequest.topP" },
|
|
482
|
+
{ path: "prompt.googleCreateChatCompletionRequest.presencePenalty" },
|
|
483
|
+
{ path: "prompt.googleCreateChatCompletionRequest.frequencyPenalty" },
|
|
484
|
+
{ path: "prompt.mlPlatformOpenAiRawRequest.temperature" },
|
|
485
|
+
{ path: "prompt.mlPlatformOpenAiRawRequest.topP" },
|
|
486
|
+
{ path: "prompt.mlPlatformOpenAiRawRequest.presencePenalty" },
|
|
487
|
+
{ path: "prompt.mlPlatformOpenAiRawRequest.frequencyPenalty" },
|
|
488
|
+
{ path: "prompt.openAiResponsesRequest.temperature" },
|
|
489
|
+
{ path: "prompt.openAiResponsesRequest.topP" },
|
|
490
|
+
{ path: "prompt.azureOpenAiResponsesRequest.temperature" },
|
|
491
|
+
{ path: "prompt.azureOpenAiResponsesRequest.topP" },
|
|
492
|
+
{ path: "prompt.llamaModelRequest.temperature" },
|
|
493
|
+
{ path: "prompt.llamaModelRequest.topP" },
|
|
494
|
+
{ path: "prompt.runwareTextToImageRequest.cfgScale" },
|
|
495
|
+
{ path: "prompt.runwareTextToImageRequest.loraModels.weight" },
|
|
496
|
+
{ path: "prompt.mlPlatformLlamaModelRequest.temperature" },
|
|
497
|
+
{ path: "prompt.mlPlatformLlamaModelRequest.topP" },
|
|
498
|
+
{ path: "prompt.perplexityChatCompletionRequest.temperature" },
|
|
499
|
+
{ path: "prompt.perplexityChatCompletionRequest.topP" },
|
|
500
|
+
{ path: "prompt.perplexityChatCompletionRequest.topK" },
|
|
501
|
+
{ path: "prompt.perplexityChatCompletionRequest.presencePenalty" },
|
|
502
|
+
{ path: "prompt.perplexityChatCompletionRequest.frequencyPenalty" },
|
|
503
|
+
{ path: "prompt.runwareVideoInferenceRequest.cfgScale" }
|
|
504
|
+
]
|
|
505
|
+
}
|
|
506
|
+
]);
|
|
507
|
+
const metadata = {
|
|
508
|
+
entityFqdn: "wix.api_infra.v1.prompt_proxy",
|
|
509
|
+
method: "POST",
|
|
510
|
+
methodFqn: "wix.api_infra.v1.WixAiExternalGateway.GenerateTextByPromptObjectStreamed",
|
|
511
|
+
packageName: PACKAGE_NAME,
|
|
512
|
+
migrationOptions: {
|
|
513
|
+
optInTransformResponse: true
|
|
514
|
+
},
|
|
515
|
+
url: resolveWixApiInfraV1WixAiExternalGatewayUrl({
|
|
516
|
+
protoPath: "/v1/generate-by-prompt-object-streamed",
|
|
517
|
+
data: serializedData,
|
|
518
|
+
host
|
|
519
|
+
}),
|
|
520
|
+
data: serializedData,
|
|
521
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
522
|
+
{
|
|
523
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
524
|
+
paths: [
|
|
525
|
+
{
|
|
526
|
+
path: "googleGeminiStreamChunk.candidates.safetyRatings.probabilityScore"
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
path: "googleGeminiStreamChunk.candidates.safetyRatings.severityScore"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
path: "googleGeminiStreamChunk.candidates.groundingMetadata.groundingSupports.confidenceScores",
|
|
533
|
+
isRepeated: true
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
path: "googleGeminiStreamChunk.candidates.groundingMetadata.retrievalMetadata.googleSearchDynamicRetrievalScore"
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
transformFn: import_bytes.transformRESTBytesToSDKBytes,
|
|
542
|
+
paths: [
|
|
543
|
+
{
|
|
544
|
+
path: "googleGeminiStreamChunk.candidates.groundingMetadata.searchEntryPoint.sdkBlob"
|
|
545
|
+
}
|
|
546
|
+
]
|
|
547
|
+
}
|
|
548
|
+
])
|
|
549
|
+
};
|
|
550
|
+
return metadata;
|
|
551
|
+
}
|
|
552
|
+
return __generateTextByPromptObjectStreamed;
|
|
553
|
+
}
|
|
410
554
|
|
|
411
555
|
// src/api-infra-v1-prompt-proxy-prompts.universal.ts
|
|
412
556
|
var OpenaiproxyV1Model = /* @__PURE__ */ ((OpenaiproxyV1Model2) => {
|
|
@@ -537,11 +681,11 @@ var Outcome = /* @__PURE__ */ ((Outcome2) => {
|
|
|
537
681
|
Outcome2["OUTCOME_DEADLINE_EXCEEDED"] = "OUTCOME_DEADLINE_EXCEEDED";
|
|
538
682
|
return Outcome2;
|
|
539
683
|
})(Outcome || {});
|
|
540
|
-
var
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
return
|
|
544
|
-
})(
|
|
684
|
+
var DynamicRetrievalConfigMode = /* @__PURE__ */ ((DynamicRetrievalConfigMode2) => {
|
|
685
|
+
DynamicRetrievalConfigMode2["MODE_UNSPECIFIED"] = "MODE_UNSPECIFIED";
|
|
686
|
+
DynamicRetrievalConfigMode2["MODE_DYNAMIC"] = "MODE_DYNAMIC";
|
|
687
|
+
return DynamicRetrievalConfigMode2;
|
|
688
|
+
})(DynamicRetrievalConfigMode || {});
|
|
545
689
|
var HarmCategory = /* @__PURE__ */ ((HarmCategory2) => {
|
|
546
690
|
HarmCategory2["UNKNOWN_CATEGORY"] = "UNKNOWN_CATEGORY";
|
|
547
691
|
HarmCategory2["HARM_CATEGORY_SEXUALLY_EXPLICIT"] = "HARM_CATEGORY_SEXUALLY_EXPLICIT";
|
|
@@ -565,6 +709,14 @@ var Modality = /* @__PURE__ */ ((Modality2) => {
|
|
|
565
709
|
Modality2["AUDIO"] = "AUDIO";
|
|
566
710
|
return Modality2;
|
|
567
711
|
})(Modality || {});
|
|
712
|
+
var Mode = /* @__PURE__ */ ((Mode2) => {
|
|
713
|
+
Mode2["UNKNOWN"] = "UNKNOWN";
|
|
714
|
+
Mode2["AUTO"] = "AUTO";
|
|
715
|
+
Mode2["ANY"] = "ANY";
|
|
716
|
+
Mode2["NONE"] = "NONE";
|
|
717
|
+
Mode2["VALIDATED"] = "VALIDATED";
|
|
718
|
+
return Mode2;
|
|
719
|
+
})(Mode || {});
|
|
568
720
|
var Type = /* @__PURE__ */ ((Type2) => {
|
|
569
721
|
Type2["UNKNOWN"] = "UNKNOWN";
|
|
570
722
|
Type2["EPHEMERAL"] = "EPHEMERAL";
|
|
@@ -1078,6 +1230,47 @@ async function generateContentByPromptObject2(options) {
|
|
|
1078
1230
|
throw transformedError;
|
|
1079
1231
|
}
|
|
1080
1232
|
}
|
|
1233
|
+
async function generateTextByPromptObjectStreamed2(options) {
|
|
1234
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1235
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1236
|
+
prompt: options?.prompt,
|
|
1237
|
+
params: options?.params,
|
|
1238
|
+
userRequestInfo: options?.userRequestInfo,
|
|
1239
|
+
fallbackProperties: options?.fallbackProperties,
|
|
1240
|
+
dynamicProperties: options?.dynamicProperties,
|
|
1241
|
+
dynamicRequestConfig: options?.dynamicRequestConfig,
|
|
1242
|
+
asyncResultTopic: options?.asyncResultTopic
|
|
1243
|
+
});
|
|
1244
|
+
const reqOpts = generateTextByPromptObjectStreamed(
|
|
1245
|
+
payload
|
|
1246
|
+
);
|
|
1247
|
+
sideEffects?.onSiteCall?.();
|
|
1248
|
+
try {
|
|
1249
|
+
const result = await httpClient.request(reqOpts);
|
|
1250
|
+
sideEffects?.onSuccess?.(result);
|
|
1251
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1252
|
+
} catch (err) {
|
|
1253
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1254
|
+
err,
|
|
1255
|
+
{
|
|
1256
|
+
spreadPathsToArguments: {},
|
|
1257
|
+
explicitPathsToArguments: {
|
|
1258
|
+
prompt: "$[0].prompt",
|
|
1259
|
+
params: "$[0].params",
|
|
1260
|
+
userRequestInfo: "$[0].userRequestInfo",
|
|
1261
|
+
fallbackProperties: "$[0].fallbackProperties",
|
|
1262
|
+
dynamicProperties: "$[0].dynamicProperties",
|
|
1263
|
+
dynamicRequestConfig: "$[0].dynamicRequestConfig",
|
|
1264
|
+
asyncResultTopic: "$[0].asyncResultTopic"
|
|
1265
|
+
},
|
|
1266
|
+
singleArgumentUnchanged: false
|
|
1267
|
+
},
|
|
1268
|
+
["options"]
|
|
1269
|
+
);
|
|
1270
|
+
sideEffects?.onError?.(err);
|
|
1271
|
+
throw transformedError;
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1081
1274
|
|
|
1082
1275
|
// src/api-infra-v1-prompt-proxy-prompts.public.ts
|
|
1083
1276
|
function generateContentByPromptObject3(httpClient) {
|
|
@@ -1087,10 +1280,18 @@ function generateContentByPromptObject3(httpClient) {
|
|
|
1087
1280
|
{ httpClient }
|
|
1088
1281
|
);
|
|
1089
1282
|
}
|
|
1283
|
+
function generateTextByPromptObjectStreamed3(httpClient) {
|
|
1284
|
+
return (options) => generateTextByPromptObjectStreamed2(
|
|
1285
|
+
options,
|
|
1286
|
+
// @ts-ignore
|
|
1287
|
+
{ httpClient }
|
|
1288
|
+
);
|
|
1289
|
+
}
|
|
1090
1290
|
|
|
1091
1291
|
// src/api-infra-v1-prompt-proxy-prompts.context.ts
|
|
1092
1292
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
1093
1293
|
var generateContentByPromptObject4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(generateContentByPromptObject3);
|
|
1294
|
+
var generateTextByPromptObjectStreamed4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(generateTextByPromptObjectStreamed3);
|
|
1094
1295
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1095
1296
|
0 && (module.exports = {
|
|
1096
1297
|
AnthropicModel,
|
|
@@ -1102,6 +1303,7 @@ var generateContentByPromptObject4 = /* @__PURE__ */ (0, import_rest_modules2.cr
|
|
|
1102
1303
|
ClipGuidancePreset,
|
|
1103
1304
|
ContentRole,
|
|
1104
1305
|
CreatePredictionModel,
|
|
1306
|
+
DynamicRetrievalConfigMode,
|
|
1105
1307
|
EditImageWithPromptRequestModel,
|
|
1106
1308
|
FinishReason,
|
|
1107
1309
|
GatewayMessageDefinitionRole,
|
|
@@ -1165,6 +1367,7 @@ var generateContentByPromptObject4 = /* @__PURE__ */ (0, import_rest_modules2.cr
|
|
|
1165
1367
|
V1ToolChoiceType,
|
|
1166
1368
|
VideoGenModel,
|
|
1167
1369
|
VideoModel,
|
|
1168
|
-
generateContentByPromptObject
|
|
1370
|
+
generateContentByPromptObject,
|
|
1371
|
+
generateTextByPromptObjectStreamed
|
|
1169
1372
|
});
|
|
1170
1373
|
//# sourceMappingURL=index.js.map
|