264 lines
14 KiB
React
264 lines
14 KiB
React
/* Metro module 985; source: unknown; dependencies: [77, 986, 966, 874, 848, 849, 877, 987] */
|
|
function _fun10359(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#10359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:6, offset: 0x00d8afed, size: 93 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
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.createLangChainCallbackHandler = createLangChainCallbackHandler;
|
|
}
|
|
|
|
function createLangChainCallbackHandler() { // fn#10360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:138, offset: 0x00d8b04a, size: 411 bytes, params: 1, frame: 14
|
|
const r2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
const recordInputs = r2.recordInputs;
|
|
const env0_0 = recordInputs != null && recordInputs;
|
|
const recordOutputs = r2.recordOutputs;
|
|
const env0_1 = recordOutputs != null && recordOutputs;
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
return {lc_serializable: false, lc_namespace: ['langchain_core', 'callbacks', 'sentry'], lc_secrets: undefined,
|
|
lc_attributes: undefined, lc_aliases: undefined, lc_serializable_keys: undefined, lc_id: ['langchain_core',
|
|
'callbacks', 'sentry'], lc_kwargs: {}, name: 'SentryCallbackHandler', ignoreLLM: false, ignoreChain: false,
|
|
ignoreAgent: false, ignoreRetriever: false, ignoreCustomEvent: false, raiseError: false, awaitHandlers: true,
|
|
handleLLMStart: handleLLMStart, handleChatModelStart: handleChatModelStart, handleLLMEnd: handleLLMEnd,
|
|
handleLLMError: handleLLMError, handleChainStart: handleChainStart, handleChainEnd: handleChainEnd,
|
|
handleChainError: handleChainError, handleToolStart: handleToolStart, handleToolEnd: handleToolEnd,
|
|
handleToolError: handleToolError, copy: copy_10376, toJSON: toJSON_10377,
|
|
toJSONNotImplemented: toJSONNotImplemented};
|
|
}
|
|
|
|
function exitSpan(a0) { // fn#10361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:321, owner: createLangChainCallbackHandler.exitSpan, offset: 0x00d8b1e5, size: 69 bytes, params: 2, frame: 13
|
|
const value2 = env0_2.get(a0);
|
|
if (value2 != null && value2.isRecording()) {
|
|
value2.end();
|
|
env0_2.delete(a0);
|
|
}
|
|
}
|
|
|
|
function handleLLMStart(a0, a1, a2, a3, a4, a5, a6, a7) { // fn#10362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:783, owner: createLangChainCallbackHandler.handleLLMStart, offset: 0x00d8b22a, size: 260 bytes, params: 9, frame: 27
|
|
var environment;
|
|
const env0_0 = a2;
|
|
const value = environment.__proto__;
|
|
const value4 = (require(986) /* metro dependency 986 */).extractLLMRequestAttributes(a0, a1, env0_0,
|
|
(require(986) /* metro dependency 986 */).getInvocationParams(a5), a6);
|
|
const GEN_AI_REQUEST_MODEL_ATTRIBUTE = (require(966) /* metro dependency 966 */).GEN_AI_REQUEST_MODEL_ATTRIBUTE;
|
|
const property = value4[GEN_AI_REQUEST_MODEL_ATTRIBUTE];
|
|
const GEN_AI_OPERATION_NAME_ATTRIBUTE = (require(966) /* metro dependency 966 */).GEN_AI_OPERATION_NAME_ATTRIBUTE;
|
|
const property2 = value4[GEN_AI_OPERATION_NAME_ATTRIBUTE];
|
|
const moduleValue3 = require(874) /* metro dependency 874 */;
|
|
const startSpanManual = moduleValue3.startSpanManual;
|
|
const object2 = {};
|
|
object2.name = '' + property2 + ' ' + property;
|
|
object2.op = 'gen_ai.pipeline';
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
const binding = env1_2;
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_OP = (require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_OP;
|
|
object2.attributes = Reflect.apply(assign, Object, [{}, value4, binding({}, SEMANTIC_ATTRIBUTE_SENTRY_OP,
|
|
'gen_ai.pipeline')]);
|
|
Reflect.apply(startSpanManual, moduleValue3, [object2, _fun10363]);
|
|
}
|
|
|
|
function handleChatModelStart(a0, a1, a2, a3, a4, a5, a6, a7) { // fn#10364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:1213, owner: createLangChainCallbackHandler.handleChatModelStart, offset: 0x00d8b34c, size: 260 bytes, params: 9, frame: 27
|
|
var environment;
|
|
const env0_0 = a2;
|
|
const value = environment.__proto__;
|
|
const value4 = (require(986) /* metro dependency 986 */).extractChatModelRequestAttributes(a0, a1, env0_0,
|
|
(require(986) /* metro dependency 986 */).getInvocationParams(a5), a6);
|
|
const GEN_AI_REQUEST_MODEL_ATTRIBUTE = (require(966) /* metro dependency 966 */).GEN_AI_REQUEST_MODEL_ATTRIBUTE;
|
|
const property = value4[GEN_AI_REQUEST_MODEL_ATTRIBUTE];
|
|
const GEN_AI_OPERATION_NAME_ATTRIBUTE = (require(966) /* metro dependency 966 */).GEN_AI_OPERATION_NAME_ATTRIBUTE;
|
|
const property2 = value4[GEN_AI_OPERATION_NAME_ATTRIBUTE];
|
|
const moduleValue3 = require(874) /* metro dependency 874 */;
|
|
const startSpanManual = moduleValue3.startSpanManual;
|
|
const object2 = {};
|
|
object2.name = '' + property2 + ' ' + property;
|
|
object2.op = 'gen_ai.chat';
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
const binding = env1_2;
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_OP = (require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_OP;
|
|
object2.attributes = Reflect.apply(assign, Object, [{}, value4, binding({}, SEMANTIC_ATTRIBUTE_SENTRY_OP,
|
|
'gen_ai.chat')]);
|
|
Reflect.apply(startSpanManual, moduleValue3, [object2, _fun10365]);
|
|
}
|
|
|
|
function handleLLMEnd(a0, a1, a2, a3, a4) { // fn#10366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:1639, owner: createLangChainCallbackHandler.handleLLMEnd, offset: 0x00d8b450, size: 110 bytes, params: 6, frame: 17
|
|
var value3;
|
|
var value4;
|
|
const value2 = env0_2.get(a1);
|
|
if (value2 != null) {
|
|
if (value2.isRecording()) {
|
|
value3 = environment.__proto__;
|
|
value4 = (require(986) /* metro dependency 986 */).extractLlmResponseAttributes(a0, env0_1);
|
|
if (value4) {
|
|
value2.setAttributes(value4);
|
|
}
|
|
exitSpan(a1);
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleLLMError(a0, a1) { // fn#10367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:1808, owner: createLangChainCallbackHandler.handleLLMError, offset: 0x00d8b4be, size: 218 bytes, params: 3, frame: 18
|
|
var setStatus;
|
|
var object2;
|
|
var value4;
|
|
const value2 = env0_2.get(a1);
|
|
if (value2 != null && value2.isRecording()) {
|
|
setStatus = value2.setStatus;
|
|
object2 = {};
|
|
value4 = environment.__proto__;
|
|
object2.code = (require(849) /* metro dependency 849 */).SPAN_STATUS_ERROR;
|
|
object2.message = 'llm_error';
|
|
Reflect.apply(setStatus, value2, [object2]);
|
|
exitSpan(a1);
|
|
}
|
|
let value = environment.__proto__;
|
|
value = require(877) /* metro dependency 877 */;
|
|
const captureException = value.captureException;
|
|
const LANGCHAIN_ORIGIN = (require(987) /* metro dependency 987 */).LANGCHAIN_ORIGIN;
|
|
Reflect.apply(captureException, value, [a0, {mechanism: {handled: false,
|
|
type: '' + LANGCHAIN_ORIGIN + '.llm_error_handler'}}]);
|
|
}
|
|
|
|
function handleChainStart({name}, a1, a2, a3) { // fn#10368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:2075, owner: createLangChainCallbackHandler.handleChainStart, offset: 0x00d8b598, size: 264 bytes, params: 5, frame: 24
|
|
var environment;
|
|
var JSON;
|
|
const env0_0 = a2;
|
|
name = !name ? 'unknown_chain' : name;
|
|
const value = environment.__proto__;
|
|
let binding = env1_2;
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = (require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN;
|
|
const value3 = binding(binding({}, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.ai.langchain'), 'langchain.chain.name',
|
|
name);
|
|
if (env0_0) {
|
|
JSON = global.JSON;
|
|
value3['langchain.chain.inputs'] = JSON.stringify(a1);
|
|
}
|
|
const moduleValue = require(874) /* metro dependency 874 */;
|
|
const startSpanManual = moduleValue.startSpanManual;
|
|
const object2 = {};
|
|
object2.name = 'chain ' + name;
|
|
object2.op = 'gen_ai.invoke_agent';
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
binding = env1_2;
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_OP = (require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_OP;
|
|
object2.attributes = Reflect.apply(assign, Object, [{}, value3, binding({}, SEMANTIC_ATTRIBUTE_SENTRY_OP,
|
|
'gen_ai.invoke_agent')]);
|
|
Reflect.apply(startSpanManual, moduleValue, [object2, _fun10369]);
|
|
}
|
|
|
|
function handleChainEnd(a0, a1) { // fn#10370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:2505, owner: createLangChainCallbackHandler.handleChainEnd, offset: 0x00d8b6a0, size: 106 bytes, params: 3, frame: 16
|
|
var setAttributes;
|
|
var JSON;
|
|
const value2 = env0_2.get(a1);
|
|
if (value2 != null && value2.isRecording()) {
|
|
if (env0_1) {
|
|
setAttributes = value2.setAttributes;
|
|
JSON = global.JSON;
|
|
Reflect.apply(setAttributes, value2, [{['langchain.chain.outputs']: JSON.stringify(a0)}]);
|
|
}
|
|
exitSpan(a1);
|
|
}
|
|
}
|
|
|
|
function handleChainError(a0, a1) { // fn#10371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:2666, owner: createLangChainCallbackHandler.handleChainError, offset: 0x00d8b70a, size: 218 bytes, params: 3, frame: 18
|
|
var setStatus;
|
|
var object2;
|
|
var value4;
|
|
const value2 = env0_2.get(a1);
|
|
if (value2 != null && value2.isRecording()) {
|
|
setStatus = value2.setStatus;
|
|
object2 = {};
|
|
value4 = environment.__proto__;
|
|
object2.code = (require(849) /* metro dependency 849 */).SPAN_STATUS_ERROR;
|
|
object2.message = 'chain_error';
|
|
Reflect.apply(setStatus, value2, [object2]);
|
|
exitSpan(a1);
|
|
}
|
|
let value = environment.__proto__;
|
|
value = require(877) /* metro dependency 877 */;
|
|
const captureException = value.captureException;
|
|
const LANGCHAIN_ORIGIN = (require(987) /* metro dependency 987 */).LANGCHAIN_ORIGIN;
|
|
Reflect.apply(captureException, value, [a0, {mechanism: {handled: false,
|
|
type: '' + LANGCHAIN_ORIGIN + '.chain_error_handler'}}]);
|
|
}
|
|
|
|
function handleToolStart({name}, a1, a2, a3) { // fn#10372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:2938, owner: createLangChainCallbackHandler.handleToolStart, offset: 0x00d8b7e4, size: 257 bytes, params: 5, frame: 24
|
|
var environment;
|
|
const env0_0 = a2;
|
|
name = !name ? 'unknown_tool' : name;
|
|
const value = environment.__proto__;
|
|
let binding = env1_2;
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = (require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN;
|
|
const LANGCHAIN_ORIGIN = (require(987) /* metro dependency 987 */).LANGCHAIN_ORIGIN;
|
|
const value3 = binding(binding({}, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, LANGCHAIN_ORIGIN), 'gen_ai.tool.name', name);
|
|
if (env0_0) {
|
|
value3['gen_ai.tool.input'] = a1;
|
|
}
|
|
const moduleValue = require(874) /* metro dependency 874 */;
|
|
const startSpanManual = moduleValue.startSpanManual;
|
|
const object2 = {};
|
|
object2.name = 'execute_tool ' + name;
|
|
object2.op = 'gen_ai.execute_tool';
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
binding = env1_2;
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_OP = (require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_OP;
|
|
object2.attributes = Reflect.apply(assign, Object, [{}, value3, binding({}, SEMANTIC_ATTRIBUTE_SENTRY_OP,
|
|
'gen_ai.execute_tool')]);
|
|
Reflect.apply(startSpanManual, moduleValue, [object2, _fun10373]);
|
|
}
|
|
|
|
function handleToolEnd(a0, a1) { // fn#10374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:3352, owner: createLangChainCallbackHandler.handleToolEnd, offset: 0x00d8b8e5, size: 106 bytes, params: 3, frame: 16
|
|
var setAttributes;
|
|
var JSON;
|
|
const value2 = env0_2.get(a1);
|
|
if (value2 != null && value2.isRecording()) {
|
|
if (env0_1) {
|
|
setAttributes = value2.setAttributes;
|
|
JSON = global.JSON;
|
|
Reflect.apply(setAttributes, value2, [{['gen_ai.tool.output']: JSON.stringify(a0)}]);
|
|
}
|
|
exitSpan(a1);
|
|
}
|
|
}
|
|
|
|
function handleToolError(a0, a1) { // fn#10375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:3506, owner: createLangChainCallbackHandler.handleToolError, offset: 0x00d8b94f, size: 218 bytes, params: 3, frame: 18
|
|
var setStatus;
|
|
var object2;
|
|
var value4;
|
|
const value2 = env0_2.get(a1);
|
|
if (value2 != null && value2.isRecording()) {
|
|
setStatus = value2.setStatus;
|
|
object2 = {};
|
|
value4 = environment.__proto__;
|
|
object2.code = (require(849) /* metro dependency 849 */).SPAN_STATUS_ERROR;
|
|
object2.message = 'tool_error';
|
|
Reflect.apply(setStatus, value2, [object2]);
|
|
exitSpan(a1);
|
|
}
|
|
let value = environment.__proto__;
|
|
value = require(877) /* metro dependency 877 */;
|
|
const captureException = value.captureException;
|
|
const LANGCHAIN_ORIGIN = (require(987) /* metro dependency 987 */).LANGCHAIN_ORIGIN;
|
|
Reflect.apply(captureException, value, [a0, {mechanism: {handled: false,
|
|
type: '' + LANGCHAIN_ORIGIN + '.tool_error_handler'}}]);
|
|
}
|
|
|
|
function createLangChainCallbackHandlerCopy() { // fn#10376, owner: createLangChainCallbackHandler.copy, offset: 0x00d16d26, size: 9 bytes, params: 1, frame: 1
|
|
return env0_4;
|
|
}
|
|
|
|
function createLangChainCallbackHandlerToJSON() { // fn#10377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:3797, owner: createLangChainCallbackHandler.toJSON, offset: 0x00d8ba29, size: 29 bytes, params: 1, frame: 2
|
|
return {'lc': 1, 'type': 'not_implemented', id: env0_4.lc_id};
|
|
}
|
|
|
|
function _fun10363(a0) { // fn#10363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1112:1156, offset: 0x00d8b32e, size: 30 bytes, params: 2, frame: 13
|
|
env1_2.set(importDefault, a0);
|
|
return a0;
|
|
}
|
|
|