1.0.0 • Published 8 months ago

@arizeai/openinference-instrumentation-langchain v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

OpenInference Instrumentation for LangChain.js

This module provides automatic instrumentation for LangChain.js. which may be used in conjunction with @opentelemetry/sdk-trace-node.

Installation

npm install --save @arizeai/openinference-instrumentation-langchain

Usage

To load the Langchain instrumentation, manually instrument the @langchain/core/callbacks/manager module. The callbacks manager must be manually instrumented due to the non-traditional module structure in @langchain/core. Additional instrumentations can be registered as usual using the registerInstrumentations function.

import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
import { LangChainInstrumentation } from "@arizeai/openinference-instrumentation-langchain";
import * as CallbackManagerModule from "@langchain/core/callbacks/manager";

const provider = new NodeTracerProvider();
provider.register();

const lcInstrumentation = new LangChainInstrumentation();
// LangChain must be manually instrumented as it doesn't have a traditional module structure
lcInstrumentation.manuallyInstrument(CallbackManagerModule);

For more information on OpenTelemetry Node.js SDK, see the OpenTelemetry Node.js SDK documentation.

1.0.0

8 months ago

0.2.1

8 months ago

0.2.0

10 months ago

0.1.0

10 months ago

0.1.1

10 months ago

0.0.9

12 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago