@raindrop-ai/langchain 0.0.8 → 0.0.9

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/README.md CHANGED
@@ -47,6 +47,7 @@ await raindrop.flush();
47
47
  | `userId` | `string` | - | Associate all events with a user |
48
48
  | `convoId` | `string` | - | Group events into a conversation |
49
49
  | `projectId` | `string` | - | Route events to a specific project (slug); omit for the default **Production** project |
50
+ | `eventName` | `string` | `ai_generation` | Event name applied to every event (the `event` field in the dashboard) |
50
51
  | `debug` | `boolean` | `false` | Enable verbose logging |
51
52
  | `traceChains` | `boolean` | `true` | Create spans for chain execution |
52
53
  | `traceRetrievers` | `boolean` | `true` | Create spans for retriever calls |
package/dist/index.d.mts CHANGED
@@ -61,6 +61,7 @@ type Patch = {
61
61
  output?: string;
62
62
  model?: string;
63
63
  properties?: Record<string, unknown>;
64
+ featureFlags?: Record<string, string>;
64
65
  attachments?: Attachment[];
65
66
  isPending?: boolean;
66
67
  timestamp?: string;
@@ -161,6 +162,7 @@ declare class EventShipper {
161
162
  output?: string;
162
163
  model?: string;
163
164
  properties?: Record<string, unknown>;
165
+ featureFlags?: Record<string, string>;
164
166
  userId?: string;
165
167
  }): Promise<void>;
166
168
  flush(): Promise<void>;
@@ -501,6 +503,13 @@ interface LangChainOptions {
501
503
  * resolves to `default` server-side; byte-identical to prior behavior).
502
504
  */
503
505
  projectId?: string;
506
+ /**
507
+ * Event name applied to every event produced by this integration (the
508
+ * `event` field in the Raindrop dashboard). Lets you distinguish LangChain
509
+ * traffic — e.g. `"support_agent"` vs `"billing_agent"` — instead of the
510
+ * generic default. Defaults to `"ai_generation"`.
511
+ */
512
+ eventName?: string;
504
513
  traceChains?: boolean;
505
514
  traceRetrievers?: boolean;
506
515
  /**
package/dist/index.d.ts CHANGED
@@ -61,6 +61,7 @@ type Patch = {
61
61
  output?: string;
62
62
  model?: string;
63
63
  properties?: Record<string, unknown>;
64
+ featureFlags?: Record<string, string>;
64
65
  attachments?: Attachment[];
65
66
  isPending?: boolean;
66
67
  timestamp?: string;
@@ -161,6 +162,7 @@ declare class EventShipper {
161
162
  output?: string;
162
163
  model?: string;
163
164
  properties?: Record<string, unknown>;
165
+ featureFlags?: Record<string, string>;
164
166
  userId?: string;
165
167
  }): Promise<void>;
166
168
  flush(): Promise<void>;
@@ -501,6 +503,13 @@ interface LangChainOptions {
501
503
  * resolves to `default` server-side; byte-identical to prior behavior).
502
504
  */
503
505
  projectId?: string;
506
+ /**
507
+ * Event name applied to every event produced by this integration (the
508
+ * `event` field in the Raindrop dashboard). Lets you distinguish LangChain
509
+ * traffic — e.g. `"support_agent"` vs `"billing_agent"` — instead of the
510
+ * generic default. Defaults to `"ai_generation"`.
511
+ */
512
+ eventName?: string;
504
513
  traceChains?: boolean;
505
514
  traceRetrievers?: boolean;
506
515
  /**
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(index_exports);
28
28
  // src/callback-handler.ts
29
29
  var import_base = require("@langchain/core/callbacks/base");
30
30
 
31
- // ../core/dist/chunk-WKRW55KX.js
31
+ // ../core/dist/chunk-ITAZONWL.js
32
32
  function getCrypto() {
33
33
  const c = globalThis.crypto;
34
34
  return c;
@@ -418,13 +418,16 @@ function projectIdHeaders(projectId) {
418
418
  var SHUTDOWN_DEADLINE_MS = 1e4;
419
419
  var POST_SHUTDOWN_TIMEOUT_MS = 5e3;
420
420
  function mergePatches(target, source) {
421
- var _a, _b, _c, _d;
421
+ var _a, _b, _c, _d, _e, _f;
422
422
  const out = { ...target, ...source };
423
423
  if (target.properties || source.properties) {
424
424
  out.properties = { ...(_a = target.properties) != null ? _a : {}, ...(_b = source.properties) != null ? _b : {} };
425
425
  }
426
+ if (target.featureFlags || source.featureFlags) {
427
+ out.featureFlags = { ...(_c = target.featureFlags) != null ? _c : {}, ...(_d = source.featureFlags) != null ? _d : {} };
428
+ }
426
429
  if (target.attachments || source.attachments) {
427
- out.attachments = [...(_c = target.attachments) != null ? _c : [], ...(_d = source.attachments) != null ? _d : []];
430
+ out.attachments = [...(_e = target.attachments) != null ? _e : [], ...(_f = source.attachments) != null ? _f : []];
428
431
  }
429
432
  return out;
430
433
  }
@@ -694,6 +697,7 @@ var EventShipper = class {
694
697
  ...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
695
698
  $context: this.context
696
699
  },
700
+ ...accumulated.featureFlags && Object.keys(accumulated.featureFlags).length > 0 ? { feature_flags: accumulated.featureFlags } : {},
697
701
  attachments: accumulated.attachments,
698
702
  is_pending: isPending
699
703
  };
@@ -1716,7 +1720,7 @@ function extractLLMMetadata(output) {
1716
1720
  // package.json
1717
1721
  var package_default = {
1718
1722
  name: "@raindrop-ai/langchain",
1719
- version: "0.0.8",
1723
+ version: "0.0.9",
1720
1724
  description: "Raindrop integration for LangChain",
1721
1725
  main: "dist/index.js",
1722
1726
  module: "dist/index.mjs",
@@ -1797,7 +1801,8 @@ function createRaindropLangChain(opts) {
1797
1801
  projectId: opts.projectId,
1798
1802
  sdkName: "langchain",
1799
1803
  libraryName,
1800
- libraryVersion
1804
+ libraryVersion,
1805
+ defaultEventName: opts.eventName
1801
1806
  });
1802
1807
  const traceShipper = new TraceShipper({
1803
1808
  writeKey,
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/callback-handler.ts
2
2
  import { BaseCallbackHandler } from "@langchain/core/callbacks/base";
3
3
 
4
- // ../core/dist/chunk-WKRW55KX.js
4
+ // ../core/dist/chunk-ITAZONWL.js
5
5
  function getCrypto() {
6
6
  const c = globalThis.crypto;
7
7
  return c;
@@ -391,13 +391,16 @@ function projectIdHeaders(projectId) {
391
391
  var SHUTDOWN_DEADLINE_MS = 1e4;
392
392
  var POST_SHUTDOWN_TIMEOUT_MS = 5e3;
393
393
  function mergePatches(target, source) {
394
- var _a, _b, _c, _d;
394
+ var _a, _b, _c, _d, _e, _f;
395
395
  const out = { ...target, ...source };
396
396
  if (target.properties || source.properties) {
397
397
  out.properties = { ...(_a = target.properties) != null ? _a : {}, ...(_b = source.properties) != null ? _b : {} };
398
398
  }
399
+ if (target.featureFlags || source.featureFlags) {
400
+ out.featureFlags = { ...(_c = target.featureFlags) != null ? _c : {}, ...(_d = source.featureFlags) != null ? _d : {} };
401
+ }
399
402
  if (target.attachments || source.attachments) {
400
- out.attachments = [...(_c = target.attachments) != null ? _c : [], ...(_d = source.attachments) != null ? _d : []];
403
+ out.attachments = [...(_e = target.attachments) != null ? _e : [], ...(_f = source.attachments) != null ? _f : []];
401
404
  }
402
405
  return out;
403
406
  }
@@ -667,6 +670,7 @@ var EventShipper = class {
667
670
  ...wizardSession ? { "raindrop.wizardSession": wizardSession } : {},
668
671
  $context: this.context
669
672
  },
673
+ ...accumulated.featureFlags && Object.keys(accumulated.featureFlags).length > 0 ? { feature_flags: accumulated.featureFlags } : {},
670
674
  attachments: accumulated.attachments,
671
675
  is_pending: isPending
672
676
  };
@@ -1689,7 +1693,7 @@ function extractLLMMetadata(output) {
1689
1693
  // package.json
1690
1694
  var package_default = {
1691
1695
  name: "@raindrop-ai/langchain",
1692
- version: "0.0.8",
1696
+ version: "0.0.9",
1693
1697
  description: "Raindrop integration for LangChain",
1694
1698
  main: "dist/index.js",
1695
1699
  module: "dist/index.mjs",
@@ -1770,7 +1774,8 @@ function createRaindropLangChain(opts) {
1770
1774
  projectId: opts.projectId,
1771
1775
  sdkName: "langchain",
1772
1776
  libraryName,
1773
- libraryVersion
1777
+ libraryVersion,
1778
+ defaultEventName: opts.eventName
1774
1779
  });
1775
1780
  const traceShipper = new TraceShipper({
1776
1781
  writeKey,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raindrop-ai/langchain",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Raindrop integration for LangChain",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "tsup": "^8.4.0",
32
32
  "typescript": "^5.3.3",
33
33
  "vitest": "^2.1.9",
34
- "@raindrop-ai/core": "0.0.5"
34
+ "@raindrop-ai/core": "0.1.1"
35
35
  },
36
36
  "tsup": {
37
37
  "entry": [