@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.
- package/build/cjs/index.d.ts +484 -1
- package/build/cjs/index.js +196 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +188 -3
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +466 -2
- package/build/cjs/meta.js +167 -3
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +484 -1
- package/build/es/index.mjs +194 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +186 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +466 -2
- package/build/es/meta.mjs +165 -2
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +15 -3
- package/build/internal/cjs/index.js +196 -3
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +494 -1
- package/build/internal/cjs/index.typings.js +188 -3
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +466 -2
- package/build/internal/cjs/meta.js +167 -3
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +15 -3
- package/build/internal/es/index.mjs +194 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +494 -1
- package/build/internal/es/index.typings.mjs +186 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +466 -2
- package/build/internal/es/meta.mjs +165 -2
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.js
CHANGED
|
@@ -92,7 +92,8 @@ __export(index_exports, {
|
|
|
92
92
|
V1ToolChoiceType: () => V1ToolChoiceType,
|
|
93
93
|
VideoGenModel: () => VideoGenModel,
|
|
94
94
|
VideoModel: () => VideoModel,
|
|
95
|
-
generateContentByPromptObject: () => generateContentByPromptObject4
|
|
95
|
+
generateContentByPromptObject: () => generateContentByPromptObject4,
|
|
96
|
+
generateTextByPromptObjectStreamed: () => generateTextByPromptObjectStreamed4
|
|
96
97
|
});
|
|
97
98
|
module.exports = __toCommonJS(index_exports);
|
|
98
99
|
|
|
@@ -107,7 +108,14 @@ var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
|
|
|
107
108
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
108
109
|
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
109
110
|
function resolveWixApiInfraV1WixAiExternalGatewayUrl(opts) {
|
|
110
|
-
const domainToMappings = {
|
|
111
|
+
const domainToMappings = {
|
|
112
|
+
"www.wixapis.com": [
|
|
113
|
+
{
|
|
114
|
+
srcPath: "/ai-external-gateway-poc",
|
|
115
|
+
destPath: ""
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
};
|
|
111
119
|
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
112
120
|
}
|
|
113
121
|
var PACKAGE_NAME = "@wix/auto_sdk_ai-gateway_prompts";
|
|
@@ -407,6 +415,141 @@ function generateContentByPromptObject(payload) {
|
|
|
407
415
|
}
|
|
408
416
|
return __generateContentByPromptObject;
|
|
409
417
|
}
|
|
418
|
+
function generateTextByPromptObjectStreamed(payload) {
|
|
419
|
+
function __generateTextByPromptObjectStreamed({ host }) {
|
|
420
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
421
|
+
{
|
|
422
|
+
transformFn: import_float.transformSDKFloatToRESTFloat,
|
|
423
|
+
paths: [
|
|
424
|
+
{ path: "prompt.openAiChatCompletionRequest.temperature" },
|
|
425
|
+
{ path: "prompt.openAiChatCompletionRequest.topP" },
|
|
426
|
+
{ path: "prompt.openAiChatCompletionRequest.presencePenalty" },
|
|
427
|
+
{ path: "prompt.openAiChatCompletionRequest.frequencyPenalty" },
|
|
428
|
+
{ path: "prompt.googleTextBisonRequest.parameters.temperature" },
|
|
429
|
+
{ path: "prompt.googleTextBisonRequest.parameters.topP" },
|
|
430
|
+
{ path: "prompt.googleChatBisonRequest.parameters.temperature" },
|
|
431
|
+
{ path: "prompt.googleChatBisonRequest.parameters.topP" },
|
|
432
|
+
{ path: "prompt.azureChatCompletionRequest.temperature" },
|
|
433
|
+
{ path: "prompt.azureChatCompletionRequest.topP" },
|
|
434
|
+
{ path: "prompt.azureChatCompletionRequest.presencePenalty" },
|
|
435
|
+
{ path: "prompt.azureChatCompletionRequest.frequencyPenalty" },
|
|
436
|
+
{
|
|
437
|
+
path: "prompt.googleGeminiGenerateContentRequest.generationConfig.temperature"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
path: "prompt.googleGeminiGenerateContentRequest.generationConfig.topP"
|
|
441
|
+
},
|
|
442
|
+
{ path: "prompt.anthropicClaudeRequest.temperature" },
|
|
443
|
+
{ path: "prompt.anthropicClaudeRequest.topP" },
|
|
444
|
+
{ path: "prompt.googleAnthropicClaudeRequest.temperature" },
|
|
445
|
+
{ path: "prompt.googleAnthropicClaudeRequest.topP" },
|
|
446
|
+
{ path: "prompt.invokeAnthropicModelRequest.temperature" },
|
|
447
|
+
{ path: "prompt.invokeAnthropicModelRequest.topP" },
|
|
448
|
+
{ path: "prompt.stabilityAiTextToImageRequest.textPrompts.weight" },
|
|
449
|
+
{ path: "prompt.stabilityAiStableDiffusionRequest.strength" },
|
|
450
|
+
{
|
|
451
|
+
path: "prompt.blackForestLabsGenerateImageRequest.imagePromptStrength"
|
|
452
|
+
},
|
|
453
|
+
{ path: "prompt.replicateCreatePredictionRequest.fluxPulid.trueCfg" },
|
|
454
|
+
{
|
|
455
|
+
path: "prompt.replicateCreatePredictionRequest.fluxPulid.idWeight"
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
path: "prompt.replicateCreatePredictionRequest.fluxPulid.guidanceScale"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.loraStrength"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.guidanceScale"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.controlStrength"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
path: "prompt.replicateCreatePredictionRequest.fluxDevControlnet.imageToImageStrength"
|
|
471
|
+
},
|
|
472
|
+
{ path: "prompt.stabilityAiEditWithPromptRequest.creativity" },
|
|
473
|
+
{ path: "prompt.runwareTextToImageRequest.strength" },
|
|
474
|
+
{ path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.trueCfg" },
|
|
475
|
+
{ path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.idWeight" },
|
|
476
|
+
{
|
|
477
|
+
path: "prompt.mlPlatformGenerateImageRequest.fluxPulid.guidanceScale"
|
|
478
|
+
},
|
|
479
|
+
{ path: "prompt.googleCreateChatCompletionRequest.temperature" },
|
|
480
|
+
{ path: "prompt.googleCreateChatCompletionRequest.topP" },
|
|
481
|
+
{ path: "prompt.googleCreateChatCompletionRequest.presencePenalty" },
|
|
482
|
+
{ path: "prompt.googleCreateChatCompletionRequest.frequencyPenalty" },
|
|
483
|
+
{ path: "prompt.mlPlatformOpenAiRawRequest.temperature" },
|
|
484
|
+
{ path: "prompt.mlPlatformOpenAiRawRequest.topP" },
|
|
485
|
+
{ path: "prompt.mlPlatformOpenAiRawRequest.presencePenalty" },
|
|
486
|
+
{ path: "prompt.mlPlatformOpenAiRawRequest.frequencyPenalty" },
|
|
487
|
+
{ path: "prompt.openAiResponsesRequest.temperature" },
|
|
488
|
+
{ path: "prompt.openAiResponsesRequest.topP" },
|
|
489
|
+
{ path: "prompt.azureOpenAiResponsesRequest.temperature" },
|
|
490
|
+
{ path: "prompt.azureOpenAiResponsesRequest.topP" },
|
|
491
|
+
{ path: "prompt.llamaModelRequest.temperature" },
|
|
492
|
+
{ path: "prompt.llamaModelRequest.topP" },
|
|
493
|
+
{ path: "prompt.runwareTextToImageRequest.cfgScale" },
|
|
494
|
+
{ path: "prompt.runwareTextToImageRequest.loraModels.weight" },
|
|
495
|
+
{ path: "prompt.mlPlatformLlamaModelRequest.temperature" },
|
|
496
|
+
{ path: "prompt.mlPlatformLlamaModelRequest.topP" },
|
|
497
|
+
{ path: "prompt.perplexityChatCompletionRequest.temperature" },
|
|
498
|
+
{ path: "prompt.perplexityChatCompletionRequest.topP" },
|
|
499
|
+
{ path: "prompt.perplexityChatCompletionRequest.topK" },
|
|
500
|
+
{ path: "prompt.perplexityChatCompletionRequest.presencePenalty" },
|
|
501
|
+
{ path: "prompt.perplexityChatCompletionRequest.frequencyPenalty" },
|
|
502
|
+
{ path: "prompt.runwareVideoInferenceRequest.cfgScale" }
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
]);
|
|
506
|
+
const metadata = {
|
|
507
|
+
entityFqdn: "wix.api_infra.v1.prompt_proxy",
|
|
508
|
+
method: "POST",
|
|
509
|
+
methodFqn: "wix.api_infra.v1.WixAiExternalGateway.GenerateTextByPromptObjectStreamed",
|
|
510
|
+
packageName: PACKAGE_NAME,
|
|
511
|
+
migrationOptions: {
|
|
512
|
+
optInTransformResponse: true
|
|
513
|
+
},
|
|
514
|
+
url: resolveWixApiInfraV1WixAiExternalGatewayUrl({
|
|
515
|
+
protoPath: "/v1/generate-by-prompt-object-streamed",
|
|
516
|
+
data: serializedData,
|
|
517
|
+
host
|
|
518
|
+
}),
|
|
519
|
+
data: serializedData,
|
|
520
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
521
|
+
{
|
|
522
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
523
|
+
paths: [
|
|
524
|
+
{
|
|
525
|
+
path: "googleGeminiStreamChunk.candidates.safetyRatings.probabilityScore"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
path: "googleGeminiStreamChunk.candidates.safetyRatings.severityScore"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
path: "googleGeminiStreamChunk.candidates.groundingMetadata.groundingSupports.confidenceScores",
|
|
532
|
+
isRepeated: true
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
path: "googleGeminiStreamChunk.candidates.groundingMetadata.retrievalMetadata.googleSearchDynamicRetrievalScore"
|
|
536
|
+
}
|
|
537
|
+
]
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
transformFn: import_bytes.transformRESTBytesToSDKBytes,
|
|
541
|
+
paths: [
|
|
542
|
+
{
|
|
543
|
+
path: "googleGeminiStreamChunk.candidates.groundingMetadata.searchEntryPoint.sdkBlob"
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
}
|
|
547
|
+
])
|
|
548
|
+
};
|
|
549
|
+
return metadata;
|
|
550
|
+
}
|
|
551
|
+
return __generateTextByPromptObjectStreamed;
|
|
552
|
+
}
|
|
410
553
|
|
|
411
554
|
// src/api-infra-v1-prompt-proxy-prompts.universal.ts
|
|
412
555
|
var OpenaiproxyV1Model = /* @__PURE__ */ ((OpenaiproxyV1Model2) => {
|
|
@@ -1078,6 +1221,47 @@ async function generateContentByPromptObject2(options) {
|
|
|
1078
1221
|
throw transformedError;
|
|
1079
1222
|
}
|
|
1080
1223
|
}
|
|
1224
|
+
async function generateTextByPromptObjectStreamed2(options) {
|
|
1225
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1226
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1227
|
+
prompt: options?.prompt,
|
|
1228
|
+
params: options?.params,
|
|
1229
|
+
userRequestInfo: options?.userRequestInfo,
|
|
1230
|
+
fallbackProperties: options?.fallbackProperties,
|
|
1231
|
+
dynamicProperties: options?.dynamicProperties,
|
|
1232
|
+
dynamicRequestConfig: options?.dynamicRequestConfig,
|
|
1233
|
+
asyncResultTopic: options?.asyncResultTopic
|
|
1234
|
+
});
|
|
1235
|
+
const reqOpts = generateTextByPromptObjectStreamed(
|
|
1236
|
+
payload
|
|
1237
|
+
);
|
|
1238
|
+
sideEffects?.onSiteCall?.();
|
|
1239
|
+
try {
|
|
1240
|
+
const result = await httpClient.request(reqOpts);
|
|
1241
|
+
sideEffects?.onSuccess?.(result);
|
|
1242
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1243
|
+
} catch (err) {
|
|
1244
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1245
|
+
err,
|
|
1246
|
+
{
|
|
1247
|
+
spreadPathsToArguments: {},
|
|
1248
|
+
explicitPathsToArguments: {
|
|
1249
|
+
prompt: "$[0].prompt",
|
|
1250
|
+
params: "$[0].params",
|
|
1251
|
+
userRequestInfo: "$[0].userRequestInfo",
|
|
1252
|
+
fallbackProperties: "$[0].fallbackProperties",
|
|
1253
|
+
dynamicProperties: "$[0].dynamicProperties",
|
|
1254
|
+
dynamicRequestConfig: "$[0].dynamicRequestConfig",
|
|
1255
|
+
asyncResultTopic: "$[0].asyncResultTopic"
|
|
1256
|
+
},
|
|
1257
|
+
singleArgumentUnchanged: false
|
|
1258
|
+
},
|
|
1259
|
+
["options"]
|
|
1260
|
+
);
|
|
1261
|
+
sideEffects?.onError?.(err);
|
|
1262
|
+
throw transformedError;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1081
1265
|
|
|
1082
1266
|
// src/api-infra-v1-prompt-proxy-prompts.public.ts
|
|
1083
1267
|
function generateContentByPromptObject3(httpClient) {
|
|
@@ -1087,10 +1271,18 @@ function generateContentByPromptObject3(httpClient) {
|
|
|
1087
1271
|
{ httpClient }
|
|
1088
1272
|
);
|
|
1089
1273
|
}
|
|
1274
|
+
function generateTextByPromptObjectStreamed3(httpClient) {
|
|
1275
|
+
return (options) => generateTextByPromptObjectStreamed2(
|
|
1276
|
+
options,
|
|
1277
|
+
// @ts-ignore
|
|
1278
|
+
{ httpClient }
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1090
1281
|
|
|
1091
1282
|
// src/api-infra-v1-prompt-proxy-prompts.context.ts
|
|
1092
1283
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
1093
1284
|
var generateContentByPromptObject4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(generateContentByPromptObject3);
|
|
1285
|
+
var generateTextByPromptObjectStreamed4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(generateTextByPromptObjectStreamed3);
|
|
1094
1286
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1095
1287
|
0 && (module.exports = {
|
|
1096
1288
|
AnthropicModel,
|
|
@@ -1165,6 +1357,7 @@ var generateContentByPromptObject4 = /* @__PURE__ */ (0, import_rest_modules2.cr
|
|
|
1165
1357
|
V1ToolChoiceType,
|
|
1166
1358
|
VideoGenModel,
|
|
1167
1359
|
VideoModel,
|
|
1168
|
-
generateContentByPromptObject
|
|
1360
|
+
generateContentByPromptObject,
|
|
1361
|
+
generateTextByPromptObjectStreamed
|
|
1169
1362
|
});
|
|
1170
1363
|
//# sourceMappingURL=index.js.map
|