@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.d.cts CHANGED
@@ -102,7 +102,6 @@ declare class _Brizz {
102
102
  private _sdk;
103
103
  static getInstance(): _Brizz;
104
104
  initialize(options: IBrizzInitializeOptions): void;
105
- private initLangChainInstrumentation;
106
105
  private setupInstrumentation;
107
106
  private createAndStartNodeSDK;
108
107
  private initializeModules;
package/dist/index.d.ts CHANGED
@@ -102,7 +102,6 @@ declare class _Brizz {
102
102
  private _sdk;
103
103
  static getInstance(): _Brizz;
104
104
  initialize(options: IBrizzInitializeOptions): void;
105
- private initLangChainInstrumentation;
106
105
  private setupInstrumentation;
107
106
  private createAndStartNodeSDK;
108
107
  private initializeModules;
package/dist/index.js CHANGED
@@ -318,7 +318,6 @@ var BRIZZ_SDK_LANGUAGE = "brizz.sdk.language";
318
318
  var SDK_LANGUAGE = "typescript";
319
319
 
320
320
  // src/internal/instrumentation/registry.ts
321
- import { LangChainInstrumentation } from "@arizeai/openinference-instrumentation-langchain";
322
321
  import { AnthropicInstrumentation as AnthropicInstrumentation2 } from "@traceloop/instrumentation-anthropic";
323
322
  import { BedrockInstrumentation as BedrockInstrumentation2 } from "@traceloop/instrumentation-bedrock";
324
323
  import { ChromaDBInstrumentation as ChromaDBInstrumentation2 } from "@traceloop/instrumentation-chromadb";
@@ -419,64 +418,23 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
419
418
  }
420
419
  }
421
420
  if (this.manualModules?.langchain?.callbackManagerModule) {
422
- try {
423
- const lcInst = new LangChainInstrumentation();
424
- lcInst.manuallyInstrument(this.manualModules.langchain.callbackManagerModule);
425
- instrumentations.push(lcInst);
426
- logger.debug("Manual instrumentation enabled for LangChain");
427
- } catch (error) {
428
- logger.error(`Failed to load LangChain instrumentation: ${String(error)}`);
429
- }
421
+ const callbackManagerModule = this.manualModules.langchain.callbackManagerModule;
422
+ void (async () => {
423
+ try {
424
+ const { LangChainInstrumentation } = await import("@arizeai/openinference-instrumentation-langchain");
425
+ const lcInst = new LangChainInstrumentation();
426
+ lcInst.manuallyInstrument(callbackManagerModule);
427
+ logger.debug("Manual instrumentation enabled for LangChain");
428
+ } catch (error) {
429
+ logger.error(
430
+ `Failed to load LangChain instrumentation. Ensure @langchain/core is installed: ${String(error)}`
431
+ );
432
+ }
433
+ })();
430
434
  }
431
435
  }
432
436
  };
433
437
 
434
- // src/internal/instrumentation/langchain-instrumentation.ts
435
- import { createRequire } from "module";
436
- import { pathToFileURL } from "url";
437
- import { LangChainInstrumentation as LangChainInstrumentation2 } from "@arizeai/openinference-instrumentation-langchain";
438
- var initialized = false;
439
- async function importCallbackManager() {
440
- try {
441
- return await import("@langchain/core/callbacks/manager");
442
- } catch {
443
- }
444
- const resolvers = [
445
- () => createRequire(pathToFileURL(process.cwd() + "/package.json").href),
446
- () => {
447
- const main = process.argv[1];
448
- if (!main) {
449
- throw new Error("no main");
450
- }
451
- return createRequire(pathToFileURL(main).href);
452
- }
453
- ];
454
- for (const getRequire of resolvers) {
455
- try {
456
- const req = getRequire();
457
- const cjsPath = req.resolve("@langchain/core/callbacks/manager");
458
- const esmPath = cjsPath.replace(/\.cjs$/, ".js");
459
- return await import(pathToFileURL(esmPath).href);
460
- } catch {
461
- }
462
- }
463
- return null;
464
- }
465
- async function setupLangChainInstrumentation() {
466
- if (initialized) {
467
- return;
468
- }
469
- const callbackManagerModule = await importCallbackManager();
470
- if (!callbackManagerModule) {
471
- logger.debug("@langchain/core not found \u2014 skipping LangChain instrumentation");
472
- return;
473
- }
474
- const instrumentation = new LangChainInstrumentation2();
475
- instrumentation.manuallyInstrument(callbackManagerModule);
476
- initialized = true;
477
- logger.info("LangChain instrumentation enabled (OpenInference)");
478
- }
479
-
480
438
  // src/internal/log/logging.ts
481
439
  import { SeverityNumber } from "@opentelemetry/api-logs";
482
440
  import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
@@ -487,7 +445,7 @@ import {
487
445
 
488
446
  // src/internal/version.ts
489
447
  function getSDKVersion() {
490
- return "0.1.12";
448
+ return "0.1.14";
491
449
  }
492
450
 
493
451
  // src/internal/log/processors/log-processor.ts
@@ -1868,7 +1826,6 @@ var _Brizz = class __Brizz {
1868
1826
  const resolvedConfig = resolveConfig(options);
1869
1827
  this.initializeModules(resolvedConfig);
1870
1828
  this.setupInstrumentation(options);
1871
- this.initLangChainInstrumentation();
1872
1829
  this.createAndStartNodeSDK(options, resolvedConfig);
1873
1830
  this._initialized = true;
1874
1831
  logger.info("Brizz SDK initialization completed successfully", {
@@ -1879,15 +1836,6 @@ var _Brizz = class __Brizz {
1879
1836
  throw new Error(`Failed to initialize SDK: ${String(error)}`, { cause: error });
1880
1837
  }
1881
1838
  }
1882
- /**
1883
- * Async LangChain instrumentation setup (fire-and-forget).
1884
- * @private
1885
- */
1886
- initLangChainInstrumentation() {
1887
- setupLangChainInstrumentation().catch((error) => {
1888
- logger.debug(`LangChain instrumentation skipped: ${String(error)}`);
1889
- });
1890
- }
1891
1839
  /**
1892
1840
  * Set up instrumentation registry and configure manual modules.
1893
1841
  * @private