743 lines
29 KiB
React
743 lines
29 KiB
React
/* Metro module 965; source: unknown; dependencies: [77, 966, 967, 964, 968] */
|
|
function _fun10156(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#10156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1092:6, offset: 0x00d7f530, size: 176 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const closure = convertPromptToMessages;
|
|
const env0_2 = require(77) /* metro dependency 77 */;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports._INTERNAL_cleanupToolCallSpan = function(a0) {
|
|
require(dependencyMap[2]).toolCallSpanMap.delete(a0);
|
|
};
|
|
exports._INTERNAL_getSpanForToolCallId = function(a0) {
|
|
return require(dependencyMap[2]).toolCallSpanMap.get(a0);
|
|
};
|
|
exports.accumulateTokensForParent = accumulateTokensForParent;
|
|
exports.applyAccumulatedTokens = applyAccumulatedTokens;
|
|
exports.convertAvailableToolsToJsonString = function(a0) {
|
|
var value = a0.map(_fun10163);
|
|
var JSON = global.JSON;
|
|
return JSON.stringify(value);
|
|
};
|
|
exports.convertPromptToMessages = closure;
|
|
exports.getSpanOpFromName = getSpanOpFromName;
|
|
exports.requestMessagesFromPrompt = requestMessagesFromPrompt;
|
|
}
|
|
|
|
function convertPromptToMessages(a0) { // fn#10157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1092:44, offset: 0x00d7f5e0, size: 181 bytes, params: 2, frame: 16
|
|
var JSON;
|
|
var parse;
|
|
var value;
|
|
var value2;
|
|
var prompt;
|
|
var system;
|
|
var value3;
|
|
var value4;
|
|
var items2;
|
|
var value5;
|
|
var push;
|
|
var object3;
|
|
var object4;
|
|
var error;
|
|
reducibleJoin3: while (true) {
|
|
reduciblePort37: while (true) {
|
|
exceptionLanding36: while (true) {
|
|
try {
|
|
JSON = global.JSON;
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
break reduciblePort37;
|
|
}
|
|
return [];
|
|
}
|
|
try {
|
|
parse = JSON.parse;
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
value = Reflect.apply(parse, JSON, [a0]);
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
if (value) {
|
|
try {
|
|
value2 = typeof value !== 'object';
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
reducibleJoin37: while (true) {
|
|
if (!value2) {
|
|
try {
|
|
prompt = value.prompt;
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
system = value.system;
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
value = typeof prompt;
|
|
try {
|
|
value3 = value === 'string';
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
if (!value3) {
|
|
try {
|
|
value4 = typeof system === 'string';
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
reducibleJoin16: while (true) {
|
|
if (value4) {
|
|
break reducibleJoin16;
|
|
}
|
|
break reducibleJoin37;
|
|
}
|
|
}
|
|
try {
|
|
items2 = [];
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
value5 = typeof system !== 'string';
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
reducibleJoin26: while (true) {
|
|
if (value5) {
|
|
break reducibleJoin26;
|
|
}
|
|
try {
|
|
push = items2.push;
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
object3 = {};
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
object3.role = 'system';
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
object3.content = system;
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
Reflect.apply(push, items2, [object3]);
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
break reducibleJoin26;
|
|
}
|
|
try {
|
|
value = value !== 'string';
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
reducibleJoin35: while (true) {
|
|
if (value) {
|
|
break reducibleJoin35;
|
|
}
|
|
try {
|
|
push = items2.push;
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
object4 = {};
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
object4.role = 'user';
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
object4.content = prompt;
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
try {
|
|
Reflect.apply(push, items2, [object4]);
|
|
} catch (error) {
|
|
break exceptionLanding36;
|
|
}
|
|
break reducibleJoin35;
|
|
}
|
|
return items2;
|
|
}
|
|
break reducibleJoin37;
|
|
}
|
|
}
|
|
return [];
|
|
}
|
|
|
|
function accumulateTokensForParent(a0, a1) { // fn#10160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1092:656, offset: 0x00d7f6f1, size: 183 bytes, params: 3, frame: 18
|
|
var r1;
|
|
var data;
|
|
var value;
|
|
var property;
|
|
var property2;
|
|
const parent_span_id = a0.parent_span_id;
|
|
if (parent_span_id) {
|
|
data = a0.data;
|
|
property = data[(require(966) /* metro dependency 966 */).GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE];
|
|
data = a0.data;
|
|
property2 = data[(require(966) /* metro dependency 966 */).GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE];
|
|
value = typeof property === 'number';
|
|
if (value) {
|
|
r1 = a1.get(parent_span_id) || ({'inputTokens': 0, 'outputTokens': 0});
|
|
if (value) {
|
|
r1.inputTokens = r1.inputTokens + property;
|
|
}
|
|
if (typeof property2 === 'number') {
|
|
r1.outputTokens = r1.outputTokens + property2;
|
|
}
|
|
a1.set(parent_span_id, r1);
|
|
} else if (typeof property2 === 'number') {
|
|
r1 = a1.get(parent_span_id) || ({'inputTokens': 0, 'outputTokens': 0});
|
|
if (value) {
|
|
r1.inputTokens = r1.inputTokens + property;
|
|
}
|
|
if (typeof property2 === 'number') {
|
|
r1.outputTokens = r1.outputTokens + property2;
|
|
}
|
|
a1.set(parent_span_id, r1);
|
|
}
|
|
}
|
|
}
|
|
|
|
function applyAccumulatedTokens(a0, a1) { // fn#10161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1092:1046, offset: 0x00d7f7a8, size: 210 bytes, params: 3, frame: 15
|
|
var inputTokens;
|
|
const value = a1.get(a0.span_id);
|
|
if (value && a0.data) {
|
|
inputTokens = value.inputTokens;
|
|
if (inputTokens > 0) {
|
|
a0.data[(require(966) /* metro dependency 966 */).GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] = value.inputTokens;
|
|
}
|
|
if (value.outputTokens > 0) {
|
|
a0.data[(require(966) /* metro dependency 966 */).GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] = value.outputTokens;
|
|
}
|
|
inputTokens = value.inputTokens;
|
|
if (inputTokens > 0 || value.outputTokens > 0) {
|
|
a0.data['gen_ai.usage.total_tokens'] = value.inputTokens + value.outputTokens;
|
|
}
|
|
}
|
|
}
|
|
|
|
function convertAvailableToolsToJsonString(a0) { // fn#10162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1092:1433, offset: 0x00d7f87a, size: 41 bytes, params: 2, frame: 11
|
|
let value = a0.map(function(a0) {
|
|
var JSON;
|
|
var value;
|
|
var error;
|
|
if (typeof a0 === 'string') {
|
|
try {
|
|
JSON = global.JSON;
|
|
value = JSON.parse(a0);
|
|
} catch (error) {
|
|
return a0;
|
|
}
|
|
return value;
|
|
}
|
|
return a0;
|
|
});
|
|
let JSON = global.JSON;
|
|
return JSON.stringify(value);
|
|
}
|
|
|
|
function getSpanOpFromName(a0) { // fn#10164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1092:1677, offset: 0x00d7f8d5, size: 457 bytes, params: 2, frame: 11
|
|
if (a0 === 'ai.generateText') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.streamText') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.generateObject') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.streamObject') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.embed') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.embedMany') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.generateText.doGenerate') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_GENERATE_TEXT_DO_GENERATE_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.streamText.doStream') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_STREAM_TEXT_DO_STREAM_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.generateObject.doGenerate') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_GENERATE_OBJECT_DO_GENERATE_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.streamObject.doStream') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_STREAM_OBJECT_DO_STREAM_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.embed.doEmbed') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_EMBED_DO_EMBED_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.embedMany.doEmbed') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_EMBED_MANY_DO_EMBED_OPERATION_ATTRIBUTE;
|
|
}
|
|
if (a0 === 'ai.toolCall') {
|
|
return (require(966) /* metro dependency 966 */).GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE;
|
|
}
|
|
return a0.startsWith('ai.stream') ? 'ai.run' : undefined;
|
|
}
|
|
|
|
function requestMessagesFromPrompt(a0, a1) { // fn#10165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1092:2619, offset: 0x00d7fa9e, size: 612 bytes, params: 3, frame: 27
|
|
var getTruncatedJsonString;
|
|
var GEN_AI_REQUEST_MESSAGES_ATTRIBUTE;
|
|
var AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
var value3;
|
|
var length;
|
|
var setAttributes;
|
|
var binding;
|
|
var GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE;
|
|
var JSON;
|
|
var parse;
|
|
var moduleValue2;
|
|
var value4;
|
|
var Array;
|
|
var isArray;
|
|
var isArray2;
|
|
var object2;
|
|
var moduleValue3;
|
|
var moduleValue4;
|
|
var value5;
|
|
var moduleValue5;
|
|
var error;
|
|
let value = environment;
|
|
const AI_PROMPT_ATTRIBUTE = require(dependencyMap[3]).AI_PROMPT_ATTRIBUTE;
|
|
if (a1[AI_PROMPT_ATTRIBUTE]) {
|
|
a0.setAttribute('gen_ai.prompt', require(dependencyMap[4]).getTruncatedJsonString(a1[AI_PROMPT_ATTRIBUTE]));
|
|
}
|
|
let property = a1[AI_PROMPT_ATTRIBUTE];
|
|
if (typeof property !== 'string') {
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = require(dependencyMap[3]).AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
if (typeof a1[AI_PROMPT_MESSAGES_ATTRIBUTE] === 'string') {
|
|
try {
|
|
JSON = global.JSON;
|
|
parse = JSON.parse;
|
|
property = dependencyMap[3];
|
|
moduleValue2 = require(property);
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = moduleValue2.AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
property = a1[AI_PROMPT_MESSAGES_ATTRIBUTE];
|
|
value4 = Reflect.apply(parse, JSON, [property]);
|
|
Array = global.Array;
|
|
isArray2 = Array.isArray(value4);
|
|
if (isArray2) {
|
|
setAttributes = a0.setAttributes;
|
|
binding = env0_2;
|
|
property = dependencyMap[3];
|
|
value = require(property);
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = value.AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
value = binding({}, AI_PROMPT_MESSAGES_ATTRIBUTE, undefined);
|
|
property = dependencyMap[1];
|
|
moduleValue3 = require(property);
|
|
GEN_AI_REQUEST_MESSAGES_ATTRIBUTE = moduleValue3.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE;
|
|
property = dependencyMap[4];
|
|
moduleValue4 = require(property);
|
|
value5 = moduleValue4.getTruncatedJsonString(value4);
|
|
value = binding(value, GEN_AI_REQUEST_MESSAGES_ATTRIBUTE, value5);
|
|
property = dependencyMap[1];
|
|
moduleValue5 = require(property);
|
|
GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE = moduleValue5.GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE;
|
|
length = value4.length;
|
|
value = binding(value, GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, length);
|
|
Reflect.apply(setAttributes, a0, [value]);
|
|
}
|
|
} catch (error) {
|
|
}
|
|
}
|
|
} else {
|
|
GEN_AI_REQUEST_MESSAGES_ATTRIBUTE = require(dependencyMap[1]).GEN_AI_REQUEST_MESSAGES_ATTRIBUTE;
|
|
if (a1[GEN_AI_REQUEST_MESSAGES_ATTRIBUTE]) {
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = require(dependencyMap[3]).AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
if (typeof a1[AI_PROMPT_MESSAGES_ATTRIBUTE] === 'string') {
|
|
try {
|
|
JSON = global.JSON;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
parse = JSON.parse;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[3];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
moduleValue2 = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = moduleValue2.AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = a1[AI_PROMPT_MESSAGES_ATTRIBUTE];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = Reflect.apply(parse, JSON, [property]);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
Array = global.Array;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
isArray = Array.isArray;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
isArray2 = Reflect.apply(isArray, Array, [value4]);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
if (isArray2) {
|
|
try {
|
|
setAttributes = a0.setAttributes;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env0_2;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[3];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = value.AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = binding(object2, AI_PROMPT_MESSAGES_ATTRIBUTE, undefined);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[1];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
moduleValue3 = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
GEN_AI_REQUEST_MESSAGES_ATTRIBUTE = moduleValue3.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[4];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
moduleValue4 = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
getTruncatedJsonString = moduleValue4.getTruncatedJsonString;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(getTruncatedJsonString, moduleValue4, [value4]);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = binding(value, GEN_AI_REQUEST_MESSAGES_ATTRIBUTE, value5);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[1];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
moduleValue5 = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE = moduleValue5.GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
length = value4.length;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = binding(value, GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, length);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
Reflect.apply(setAttributes, a0, [value]);
|
|
} catch (error) {
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = require(dependencyMap[3]).AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
if (a1[AI_PROMPT_MESSAGES_ATTRIBUTE]) {
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = require(dependencyMap[3]).AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
if (typeof a1[AI_PROMPT_MESSAGES_ATTRIBUTE] === 'string') {
|
|
try {
|
|
JSON = global.JSON;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
parse = JSON.parse;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[3];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
moduleValue2 = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = moduleValue2.AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = a1[AI_PROMPT_MESSAGES_ATTRIBUTE];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = Reflect.apply(parse, JSON, [property]);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
Array = global.Array;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
isArray = Array.isArray;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
isArray2 = Reflect.apply(isArray, Array, [value4]);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
if (isArray2) {
|
|
try {
|
|
setAttributes = a0.setAttributes;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env0_2;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[3];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
AI_PROMPT_MESSAGES_ATTRIBUTE = value.AI_PROMPT_MESSAGES_ATTRIBUTE;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = binding(object2, AI_PROMPT_MESSAGES_ATTRIBUTE, undefined);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[1];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
moduleValue3 = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
GEN_AI_REQUEST_MESSAGES_ATTRIBUTE = moduleValue3.GEN_AI_REQUEST_MESSAGES_ATTRIBUTE;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[4];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
moduleValue4 = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
getTruncatedJsonString = moduleValue4.getTruncatedJsonString;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(getTruncatedJsonString, moduleValue4, [value4]);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = binding(value, GEN_AI_REQUEST_MESSAGES_ATTRIBUTE, value5);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = dependencyMap[1];
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
moduleValue5 = require(property);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE = moduleValue5.GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
length = value4.length;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = binding(value, GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, length);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
Reflect.apply(setAttributes, a0, [value]);
|
|
} catch (error) {
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
value3 = convertPromptToMessages(property);
|
|
if (value3.length) {
|
|
setAttributes = a0.setAttributes;
|
|
binding = env0_2;
|
|
GEN_AI_REQUEST_MESSAGES_ATTRIBUTE = require(dependencyMap[1]).GEN_AI_REQUEST_MESSAGES_ATTRIBUTE;
|
|
value = require(dependencyMap[4]);
|
|
value = value.getTruncatedJsonString(value3);
|
|
value = binding({}, GEN_AI_REQUEST_MESSAGES_ATTRIBUTE, value);
|
|
Reflect.apply(setAttributes, a0, [binding(value,
|
|
require(dependencyMap[1]).GEN_AI_REQUEST_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, value3.length)]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|