@brizz/sdk 0.1.12 → 0.1.14

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/dist/index.cjs CHANGED
@@ -368,7 +368,6 @@ var BRIZZ_SDK_LANGUAGE = "brizz.sdk.language";
368
368
  var SDK_LANGUAGE = "typescript";
369
369
 
370
370
  // src/internal/instrumentation/registry.ts
371
- var import_openinference_instrumentation_langchain = require("@arizeai/openinference-instrumentation-langchain");
372
371
  var import_instrumentation_anthropic2 = require("@traceloop/instrumentation-anthropic");
373
372
  var import_instrumentation_bedrock2 = require("@traceloop/instrumentation-bedrock");
374
373
  var import_instrumentation_chromadb2 = require("@traceloop/instrumentation-chromadb");
@@ -469,64 +468,23 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
469
468
  }
470
469
  }
471
470
  if (this.manualModules?.langchain?.callbackManagerModule) {
472
- try {
473
- const lcInst = new import_openinference_instrumentation_langchain.LangChainInstrumentation();
474
- lcInst.manuallyInstrument(this.manualModules.langchain.callbackManagerModule);
475
- instrumentations.push(lcInst);
476
- logger.debug("Manual instrumentation enabled for LangChain");
477
- } catch (error) {
478
- logger.error(`Failed to load LangChain instrumentation: ${String(error)}`);
479
- }
471
+ const callbackManagerModule = this.manualModules.langchain.callbackManagerModule;
472
+ void (async () => {
473
+ try {
474
+ const { LangChainInstrumentation } = await import("@arizeai/openinference-instrumentation-langchain");
475
+ const lcInst = new LangChainInstrumentation();
476
+ lcInst.manuallyInstrument(callbackManagerModule);
477
+ logger.debug("Manual instrumentation enabled for LangChain");
478
+ } catch (error) {
479
+ logger.error(
480
+ `Failed to load LangChain instrumentation. Ensure @langchain/core is installed: ${String(error)}`
481
+ );
482
+ }
483
+ })();
480
484
  }
481
485
  }
482
486
  };
483
487
 
484
- // src/internal/instrumentation/langchain-instrumentation.ts
485
- var import_node_module = require("module");
486
- var import_node_url = require("url");
487
- var import_openinference_instrumentation_langchain2 = require("@arizeai/openinference-instrumentation-langchain");
488
- var initialized = false;
489
- async function importCallbackManager() {
490
- try {
491
- return await import("@langchain/core/callbacks/manager");
492
- } catch {
493
- }
494
- const resolvers = [
495
- () => (0, import_node_module.createRequire)((0, import_node_url.pathToFileURL)(process.cwd() + "/package.json").href),
496
- () => {
497
- const main = process.argv[1];
498
- if (!main) {
499
- throw new Error("no main");
500
- }
501
- return (0, import_node_module.createRequire)((0, import_node_url.pathToFileURL)(main).href);
502
- }
503
- ];
504
- for (const getRequire of resolvers) {
505
- try {
506
- const req = getRequire();
507
- const cjsPath = req.resolve("@langchain/core/callbacks/manager");
508
- const esmPath = cjsPath.replace(/\.cjs$/, ".js");
509
- return await import((0, import_node_url.pathToFileURL)(esmPath).href);
510
- } catch {
511
- }
512
- }
513
- return null;
514
- }
515
- async function setupLangChainInstrumentation() {
516
- if (initialized) {
517
- return;
518
- }
519
- const callbackManagerModule = await importCallbackManager();
520
- if (!callbackManagerModule) {
521
- logger.debug("@langchain/core not found \u2014 skipping LangChain instrumentation");
522
- return;
523
- }
524
- const instrumentation = new import_openinference_instrumentation_langchain2.LangChainInstrumentation();
525
- instrumentation.manuallyInstrument(callbackManagerModule);
526
- initialized = true;
527
- logger.info("LangChain instrumentation enabled (OpenInference)");
528
- }
529
-
530
488
  // src/internal/log/logging.ts
531
489
  var import_api_logs = require("@opentelemetry/api-logs");
532
490
  var import_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
@@ -535,7 +493,7 @@ var import_sdk_logs2 = require("@opentelemetry/sdk-logs");
535
493
 
536
494
  // src/internal/version.ts
537
495
  function getSDKVersion() {
538
- return "0.1.12";
496
+ return "0.1.14";
539
497
  }
540
498
 
541
499
  // src/internal/log/processors/log-processor.ts
@@ -1913,7 +1871,6 @@ var _Brizz = class __Brizz {
1913
1871
  const resolvedConfig = resolveConfig(options);
1914
1872
  this.initializeModules(resolvedConfig);
1915
1873
  this.setupInstrumentation(options);
1916
- this.initLangChainInstrumentation();
1917
1874
  this.createAndStartNodeSDK(options, resolvedConfig);
1918
1875
  this._initialized = true;
1919
1876
  logger.info("Brizz SDK initialization completed successfully", {
@@ -1924,15 +1881,6 @@ var _Brizz = class __Brizz {
1924
1881
  throw new Error(`Failed to initialize SDK: ${String(error)}`, { cause: error });
1925
1882
  }
1926
1883
  }
1927
- /**
1928
- * Async LangChain instrumentation setup (fire-and-forget).
1929
- * @private
1930
- */
1931
- initLangChainInstrumentation() {
1932
- setupLangChainInstrumentation().catch((error) => {
1933
- logger.debug(`LangChain instrumentation skipped: ${String(error)}`);
1934
- });
1935
- }
1936
1884
  /**
1937
1885
  * Set up instrumentation registry and configure manual modules.
1938
1886
  * @private