@coalex-ai/sdk 2.2.1 → 2.2.2-beta.681

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.
Files changed (2) hide show
  1. package/README.md +21 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -110,6 +110,27 @@ Convenience functions to instrument a single library.
110
110
  instrumentOpenAI(); // returns boolean
111
111
  ```
112
112
 
113
+ ### LangChain.js
114
+
115
+ With `@arizeai/openinference-instrumentation-langchain` 4.x installed, `autoInstrument()` captures
116
+ LangChain.js 0.3 and 1.x (`@langchain/core`) in a CommonJS app: `LLM`, `CHAIN`, `PROMPT` and `TOOL`
117
+ spans. Call `register()` first, since the spans go to the globally registered provider and not to
118
+ a `tracerProvider` option, and instrument before the app first loads LangChain. On its first call
119
+ the result reads `langchain: "already_instrumented"` although the instrumentation is active.
120
+
121
+ In an ESM app neither `autoInstrument()` nor `autoInstrumentAsync()` captures LangChain yet. Hand
122
+ the instrumentor LangChain's callback manager instead, before your LangChain code runs:
123
+
124
+ ```typescript
125
+ import { LangChainInstrumentation } from "@arizeai/openinference-instrumentation-langchain";
126
+
127
+ register({ apiKey: process.env.COALEX_API_KEY, serviceName: "my-agent" });
128
+ new LangChainInstrumentation().manuallyInstrument(await import("@langchain/core/callbacks/manager"));
129
+ ```
130
+
131
+ Which lines are proven, and on which versions:
132
+ [Supported Frameworks](https://docs.coalex.ai/reference/supported-frameworks/).
133
+
113
134
  ### `coalexContext(options, fn)` / `coalexContextSync(options, fn)`
114
135
 
115
136
  Wrap a function in a traced Coalex invocation span.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coalex-ai/sdk",
3
- "version": "2.2.1",
3
+ "version": "2.2.2-beta.681",
4
4
  "description": "Coalex TypeScript SDK for AI governance observability",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {