@langchain/openrouter 0.4.16 → 0.4.18

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @langchain/openrouter
2
2
 
3
+ ## 0.4.18
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`d71c542`](https://github.com/langchain-ai/langchainjs/commit/d71c542fb1d9cd1ceb310a4759591c024cf0d57d)]:
8
+ - @langchain/openai@1.6.3
9
+
10
+ ## 0.4.17
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`4109812`](https://github.com/langchain-ai/langchainjs/commit/41098120e01596743a588c149230a3580729c289), [`4109812`](https://github.com/langchain-ai/langchainjs/commit/41098120e01596743a588c149230a3580729c289)]:
15
+ - @langchain/openai@1.6.2
16
+
3
17
  ## 0.4.16
4
18
 
5
19
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  //#region src/api-types.d.ts
2
- declare namespace OpenRouter {
2
+ export declare namespace OpenRouter {
3
3
  /** An OpenRouter model identifier, e.g. `"anthropic/claude-4-sonnet"`. */
4
4
  export type ModelName = string;
5
5
  /**
@@ -364,5 +364,4 @@ declare namespace OpenRouter {
364
364
  export {};
365
365
  }
366
366
  //#endregion
367
- export { OpenRouter };
368
367
  //# sourceMappingURL=api-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-types.d.cts","names":[],"sources":["../src/api-types.ts"],"mappings":";kBAMiB;;cAMH;;;;;cAMA;cAMA;cAMA;cAEA;cAYA;cAEA;cA4EA;cAQA;mBAaK;IACf;IACA;;mBAOe;IACf;IACA;IACA,gBAAgB;;mBAGD;IACf;IACA;MACE;MACA;;;mBAIa;IACf;IACA;MAAe;MAAc;;;cAGnB;IACN;IAAqB;MAAa;;;IAClC;IAAmB;MAAa;;;;cAG1B,yBACR,6BACA,8BACA,8BACA;YAMM;IACR;IACA,SAAS;IACT;;mBAGe,+BAA+B;IAC9C;IACA;;mBAGe,iCAAiC;IAChD;IACA;;mBAGe,4BAA4B;IAC3C;IACA;IACA;;cAGU,kBACR,yBACA,2BACA;mBAMa;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,mBAAmB;IACnB;IACA,aAAa;IACb;IACA;IACA,oBAAoB;IACpB,SAAS;MAAQ;QAAa;;;;mBAGf;IACf;IACA,kBAAkB;IAClB;;;cAIU,UACR,gBACA,cACA,mBACA,mBACA;mBAMa;IACf;IACA;IACA;MAAY;MAAc;;;mBAGX;IACf;IACA;IACA;IACA;MAAa;MAAe;;;mBAOb;IACf;IACA;MACE;MACA;MACA,aAAa;MACb;;IAEF,gBAAgB;;mBAGD;IACf;IACA;MAAY;;;cAGF,kDAAkD;mBAM7C;IACf;IACA;IACA,SAAS;IACT;;mBAGe;IACf;IACA,aAAa;;mBAGE;IACf;IACA;;mBAOe;IACf;IACA;IACA;IACA,cAAc;MACZ;MACA;MACA;;;mBAIa;IACf,SAAS;IACT,SAAS;;mBAOM;IACf;IACA;IACA;IACA;MACE;MACA;MACA;MACA;;IAEF;MACE;MACA;MACA;MACA;;;mBAQa;IACf;IACA;IACA;IACA;;mBAGe;IACf;IACA;IACA;IACA;;cAGU,+BAA+B;cAC/B,kCAAkC;mBAE7B;IACf,KAAK;IACL;;cAGU,oBAAoB,eAAe;mBAE9B;IACf;IACA;IACA,kBAAkB;IAClB;IACA;IACA,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,SAAS,MAAM;IACf,gBAAgB;IAChB,OAAO;IACP;MACE,SAAS;MACT,aAAa;MACb,QAAQ;MACR,QAAQ;MACR,UAAU;;IAEZ,2BAA2B;IAC3B,wBAAwB;;mBAOT;IACf;IACA;IACA;;mBAGe;IACf;;mBAGe;IACf;IACA;IACA;IACA;IACA;;mBAGe;IACf;IACA;IACA;MACE;;;mBAIa;IACf;IACA;;cAGU,mBACR,mBACA,mBACA,YACA,mBACA;IACE;KAAa;;mBAMF;IACf;IACA;IACA;IACA;IACA;KACC;;mBAOc;IACf;;mBAOe;IACf,UAAU;IACV,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV;IACA;IACA;IACA,QAAQ;IACR;IACA,aAAa;IACb;IACA;IACA;IACA;IACA,WAAW;IACX;IACA;MACE;MASA,UAAU;;IAEZ;MACM;;MACA;QACF,2BACA;MACE;;IACN;IACA;IACA;IACA,iBAAiB;IACjB;IACA;IACA,cAAc;IACd,QAAQ;IACR;IACA;MAAU;;IACV,eAAe;IACf,aAAa;;mBAOE;IACf,eAAe;IACf;IACA,SAAS;IACT,WAAW;;mBAGI;IACf;IACA,SAAS;IACT;IACA;IACA;IACA;IACA,QAAQ;;mBAOO;IACf;IACA;IACA;IACA;IACA,aAAa;IACb,oBAAoB;;mBAGL;IACf,OAAO;IACP,eAAe;IACf;IACA,WAAW;;mBAGI;IACf;MACE;MACA,SAAS;MACT;MACA;MACA;MACA;MACA;QAAU;QAAiB;;MAC3B,QAAQ;;;mBAQK;IACf;MACE;MACA;MACA;MACA"}
1
+ {"version":3,"file":"api-types.d.cts","names":[],"sources":["../src/api-types.ts"],"mappings":";yBAMiB;;cAMH;;;;;cAMA;cAMA;cAMA;cAEA;cAYA;cAEA;cA4EA;cAQA;mBAaK;IACf;IACA;;mBAOe;IACf;IACA;IACA,gBAAgB;;mBAGD;IACf;IACA;MACE;MACA;;;mBAIa;IACf;IACA;MAAe;MAAc;;;cAGnB;IACN;IAAqB;MAAa;;;IAClC;IAAmB;MAAa;;;;cAG1B,yBACR,6BACA,8BACA,8BACA;YAMM;IACR;IACA,SAAS;IACT;;mBAGe,+BAA+B;IAC9C;IACA;;mBAGe,iCAAiC;IAChD;IACA;;mBAGe,4BAA4B;IAC3C;IACA;IACA;;cAGU,kBACR,yBACA,2BACA;mBAMa;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,mBAAmB;IACnB;IACA,aAAa;IACb;IACA;IACA,oBAAoB;IACpB,SAAS;MAAQ;QAAa;;;;mBAGf;IACf;IACA,kBAAkB;IAClB;;;cAIU,UACR,gBACA,cACA,mBACA,mBACA;mBAMa;IACf;IACA;IACA;MAAY;MAAc;;;mBAGX;IACf;IACA;IACA;IACA;MAAa;MAAe;;;mBAOb;IACf;IACA;MACE;MACA;MACA,aAAa;MACb;;IAEF,gBAAgB;;mBAGD;IACf;IACA;MAAY;;;cAGF,kDAAkD;mBAM7C;IACf;IACA;IACA,SAAS;IACT;;mBAGe;IACf;IACA,aAAa;;mBAGE;IACf;IACA;;mBAOe;IACf;IACA;IACA;IACA,cAAc;MACZ;MACA;MACA;;;mBAIa;IACf,SAAS;IACT,SAAS;;mBAOM;IACf;IACA;IACA;IACA;MACE;MACA;MACA;MACA;;IAEF;MACE;MACA;MACA;MACA;;;mBAQa;IACf;IACA;IACA;IACA;;mBAGe;IACf;IACA;IACA;IACA;;cAGU,+BAA+B;cAC/B,kCAAkC;mBAE7B;IACf,KAAK;IACL;;cAGU,oBAAoB,eAAe;mBAE9B;IACf;IACA;IACA,kBAAkB;IAClB;IACA;IACA,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,SAAS,MAAM;IACf,gBAAgB;IAChB,OAAO;IACP;MACE,SAAS;MACT,aAAa;MACb,QAAQ;MACR,QAAQ;MACR,UAAU;;IAEZ,2BAA2B;IAC3B,wBAAwB;;mBAOT;IACf;IACA;IACA;;mBAGe;IACf;;mBAGe;IACf;IACA;IACA;IACA;IACA;;mBAGe;IACf;IACA;IACA;MACE;;;mBAIa;IACf;IACA;;cAGU,mBACR,mBACA,mBACA,YACA,mBACA;IACE;KAAa;;mBAMF;IACf;IACA;IACA;IACA;IACA;KACC;;mBAOc;IACf;;mBAOe;IACf,UAAU;IACV,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV;IACA;IACA;IACA,QAAQ;IACR;IACA,aAAa;IACb;IACA;IACA;IACA;IACA,WAAW;IACX;IACA;MACE;MASA,UAAU;;IAEZ;MACM;;MACA;QACF,2BACA;MACE;;IACN;IACA;IACA;IACA,iBAAiB;IACjB;IACA;IACA,cAAc;IACd,QAAQ;IACR;IACA;MAAU;;IACV,eAAe;IACf,aAAa;;mBAOE;IACf,eAAe;IACf;IACA,SAAS;IACT,WAAW;;mBAGI;IACf;IACA,SAAS;IACT;IACA;IACA;IACA;IACA,QAAQ;;mBAOO;IACf;IACA;IACA;IACA;IACA,aAAa;IACb,oBAAoB;;mBAGL;IACf,OAAO;IACP,eAAe;IACf;IACA,WAAW;;mBAGI;IACf;MACE;MACA,SAAS;MACT;MACA;MACA;MACA;MACA;QAAU;QAAiB;;MAC3B,QAAQ;;;mBAQK;IACf;MACE;MACA;MACA;MACA"}
@@ -1,5 +1,5 @@
1
1
  //#region src/api-types.d.ts
2
- declare namespace OpenRouter {
2
+ export declare namespace OpenRouter {
3
3
  /** An OpenRouter model identifier, e.g. `"anthropic/claude-4-sonnet"`. */
4
4
  export type ModelName = string;
5
5
  /**
@@ -364,5 +364,4 @@ declare namespace OpenRouter {
364
364
  export {};
365
365
  }
366
366
  //#endregion
367
- export { OpenRouter };
368
367
  //# sourceMappingURL=api-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-types.d.ts","names":[],"sources":["../src/api-types.ts"],"mappings":";kBAMiB;;cAMH;;;;;cAMA;cAMA;cAMA;cAEA;cAYA;cAEA;cA4EA;cAQA;mBAaK;IACf;IACA;;mBAOe;IACf;IACA;IACA,gBAAgB;;mBAGD;IACf;IACA;MACE;MACA;;;mBAIa;IACf;IACA;MAAe;MAAc;;;cAGnB;IACN;IAAqB;MAAa;;;IAClC;IAAmB;MAAa;;;;cAG1B,yBACR,6BACA,8BACA,8BACA;YAMM;IACR;IACA,SAAS;IACT;;mBAGe,+BAA+B;IAC9C;IACA;;mBAGe,iCAAiC;IAChD;IACA;;mBAGe,4BAA4B;IAC3C;IACA;IACA;;cAGU,kBACR,yBACA,2BACA;mBAMa;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,mBAAmB;IACnB;IACA,aAAa;IACb;IACA;IACA,oBAAoB;IACpB,SAAS;MAAQ;QAAa;;;;mBAGf;IACf;IACA,kBAAkB;IAClB;;;cAIU,UACR,gBACA,cACA,mBACA,mBACA;mBAMa;IACf;IACA;IACA;MAAY;MAAc;;;mBAGX;IACf;IACA;IACA;IACA;MAAa;MAAe;;;mBAOb;IACf;IACA;MACE;MACA;MACA,aAAa;MACb;;IAEF,gBAAgB;;mBAGD;IACf;IACA;MAAY;;;cAGF,kDAAkD;mBAM7C;IACf;IACA;IACA,SAAS;IACT;;mBAGe;IACf;IACA,aAAa;;mBAGE;IACf;IACA;;mBAOe;IACf;IACA;IACA;IACA,cAAc;MACZ;MACA;MACA;;;mBAIa;IACf,SAAS;IACT,SAAS;;mBAOM;IACf;IACA;IACA;IACA;MACE;MACA;MACA;MACA;;IAEF;MACE;MACA;MACA;MACA;;;mBAQa;IACf;IACA;IACA;IACA;;mBAGe;IACf;IACA;IACA;IACA;;cAGU,+BAA+B;cAC/B,kCAAkC;mBAE7B;IACf,KAAK;IACL;;cAGU,oBAAoB,eAAe;mBAE9B;IACf;IACA;IACA,kBAAkB;IAClB;IACA;IACA,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,SAAS,MAAM;IACf,gBAAgB;IAChB,OAAO;IACP;MACE,SAAS;MACT,aAAa;MACb,QAAQ;MACR,QAAQ;MACR,UAAU;;IAEZ,2BAA2B;IAC3B,wBAAwB;;mBAOT;IACf;IACA;IACA;;mBAGe;IACf;;mBAGe;IACf;IACA;IACA;IACA;IACA;;mBAGe;IACf;IACA;IACA;MACE;;;mBAIa;IACf;IACA;;cAGU,mBACR,mBACA,mBACA,YACA,mBACA;IACE;KAAa;;mBAMF;IACf;IACA;IACA;IACA;IACA;KACC;;mBAOc;IACf;;mBAOe;IACf,UAAU;IACV,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV;IACA;IACA;IACA,QAAQ;IACR;IACA,aAAa;IACb;IACA;IACA;IACA;IACA,WAAW;IACX;IACA;MACE;MASA,UAAU;;IAEZ;MACM;;MACA;QACF,2BACA;MACE;;IACN;IACA;IACA;IACA,iBAAiB;IACjB;IACA;IACA,cAAc;IACd,QAAQ;IACR;IACA;MAAU;;IACV,eAAe;IACf,aAAa;;mBAOE;IACf,eAAe;IACf;IACA,SAAS;IACT,WAAW;;mBAGI;IACf;IACA,SAAS;IACT;IACA;IACA;IACA;IACA,QAAQ;;mBAOO;IACf;IACA;IACA;IACA;IACA,aAAa;IACb,oBAAoB;;mBAGL;IACf,OAAO;IACP,eAAe;IACf;IACA,WAAW;;mBAGI;IACf;MACE;MACA,SAAS;MACT;MACA;MACA;MACA;MACA;QAAU;QAAiB;;MAC3B,QAAQ;;;mBAQK;IACf;MACE;MACA;MACA;MACA"}
1
+ {"version":3,"file":"api-types.d.ts","names":[],"sources":["../src/api-types.ts"],"mappings":";yBAMiB;;cAMH;;;;;cAMA;cAMA;cAMA;cAEA;cAYA;cAEA;cA4EA;cAQA;mBAaK;IACf;IACA;;mBAOe;IACf;IACA;IACA,gBAAgB;;mBAGD;IACf;IACA;MACE;MACA;;;mBAIa;IACf;IACA;MAAe;MAAc;;;cAGnB;IACN;IAAqB;MAAa;;;IAClC;IAAmB;MAAa;;;;cAG1B,yBACR,6BACA,8BACA,8BACA;YAMM;IACR;IACA,SAAS;IACT;;mBAGe,+BAA+B;IAC9C;IACA;;mBAGe,iCAAiC;IAChD;IACA;;mBAGe,4BAA4B;IAC3C;IACA;IACA;;cAGU,kBACR,yBACA,2BACA;mBAMa;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,kBAAkB;IAClB;;mBAGe;IACf;IACA,mBAAmB;IACnB;IACA,aAAa;IACb;IACA;IACA,oBAAoB;IACpB,SAAS;MAAQ;QAAa;;;;mBAGf;IACf;IACA,kBAAkB;IAClB;;;cAIU,UACR,gBACA,cACA,mBACA,mBACA;mBAMa;IACf;IACA;IACA;MAAY;MAAc;;;mBAGX;IACf;IACA;IACA;IACA;MAAa;MAAe;;;mBAOb;IACf;IACA;MACE;MACA;MACA,aAAa;MACb;;IAEF,gBAAgB;;mBAGD;IACf;IACA;MAAY;;;cAGF,kDAAkD;mBAM7C;IACf;IACA;IACA,SAAS;IACT;;mBAGe;IACf;IACA,aAAa;;mBAGE;IACf;IACA;;mBAOe;IACf;IACA;IACA;IACA,cAAc;MACZ;MACA;MACA;;;mBAIa;IACf,SAAS;IACT,SAAS;;mBAOM;IACf;IACA;IACA;IACA;MACE;MACA;MACA;MACA;;IAEF;MACE;MACA;MACA;MACA;;;mBAQa;IACf;IACA;IACA;IACA;;mBAGe;IACf;IACA;IACA;IACA;;cAGU,+BAA+B;cAC/B,kCAAkC;mBAE7B;IACf,KAAK;IACL;;cAGU,oBAAoB,eAAe;mBAE9B;IACf;IACA;IACA,kBAAkB;IAClB;IACA;IACA,QAAQ,MAAM;IACd,OAAO,MAAM;IACb,SAAS,MAAM;IACf,gBAAgB;IAChB,OAAO;IACP;MACE,SAAS;MACT,aAAa;MACb,QAAQ;MACR,QAAQ;MACR,UAAU;;IAEZ,2BAA2B;IAC3B,wBAAwB;;mBAOT;IACf;IACA;IACA;;mBAGe;IACf;;mBAGe;IACf;IACA;IACA;IACA;IACA;;mBAGe;IACf;IACA;IACA;MACE;;;mBAIa;IACf;IACA;;cAGU,mBACR,mBACA,mBACA,YACA,mBACA;IACE;KAAa;;mBAMF;IACf;IACA;IACA;IACA;IACA;KACC;;mBAOc;IACf;;mBAOe;IACf,UAAU;IACV,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV;IACA;IACA;IACA,QAAQ;IACR;IACA,aAAa;IACb;IACA;IACA;IACA;IACA,WAAW;IACX;IACA;MACE;MASA,UAAU;;IAEZ;MACM;;MACA;QACF,2BACA;MACE;;IACN;IACA;IACA;IACA,iBAAiB;IACjB;IACA;IACA,cAAc;IACd,QAAQ;IACR;IACA;MAAU;;IACV,eAAe;IACf,aAAa;;mBAOE;IACf,eAAe;IACf;IACA,SAAS;IACT,WAAW;;mBAGI;IACf;IACA,SAAS;IACT;IACA;IACA;IACA;IACA,QAAQ;;mBAOO;IACf;IACA;IACA;IACA;IACA,aAAa;IACb,oBAAoB;;mBAGL;IACf,OAAO;IACP,eAAe;IACf;IACA,WAAW;;mBAGI;IACf;MACE;MACA,SAAS;MACT;MACA;MACA;MACA;MACA;QAAU;QAAiB;;MAC3B,QAAQ;;;mBAQK;IACf;MACE;MACA;MACA;MACA"}
@@ -152,7 +152,7 @@ var ChatOpenRouter = class extends _langchain_core_language_models_chat_models.B
152
152
  model: modelOrFields
153
153
  } : modelOrFields;
154
154
  super(fields);
155
- this._addVersion("@langchain/openrouter", "0.4.16");
155
+ this._addVersion("@langchain/openrouter", "0.4.18");
156
156
  const apiKey = fields.apiKey ?? (0, _langchain_core_utils_env.getEnvironmentVariable)("OPENROUTER_API_KEY");
157
157
  if (!apiKey) throw new require_errors.OpenRouterAuthError("OpenRouter API key is required. Get one at https://openrouter.ai/keys and set it via the `apiKey` parameter or the OPENROUTER_API_KEY environment variable.");
158
158
  this.apiKey = apiKey;
@@ -39,7 +39,7 @@ type OpenRouterRequestBody = Omit<OpenRouter.ChatGenerationParams, "messages"> &
39
39
  * available on OpenRouter can be used by passing its identifier (e.g.
40
40
  * `"anthropic/claude-4-sonnet"`) as the `model` param.
41
41
  */
42
- declare class ChatOpenRouter extends BaseChatModel<ChatOpenRouterCallOptions, AIMessageChunk> {
42
+ export declare class ChatOpenRouter extends BaseChatModel<ChatOpenRouterCallOptions, AIMessageChunk> {
43
43
  static lc_name(): string;
44
44
  lc_serializable: boolean;
45
45
  /** Maps secret fields to the environment variable they can be loaded from. */
@@ -184,5 +184,4 @@ declare class ChatOpenRouter extends BaseChatModel<ChatOpenRouterCallOptions, AI
184
184
  }>;
185
185
  }
186
186
  //#endregion
187
- export { ChatOpenRouter };
188
187
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/chat_models/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;KA2CK,wBAAwB,KAC3B,WAAW;EAGX,UAAU,OAAa,KAAK,YAAY;EACxC;EACA;EACA;EACA;EACA;IAAe;IAAiB;;EAChC;;;;;;;;;;cAoCW,uBAAuB,cAClC,2BACA;SAEO;EAIP;;MAGI;KAAiB;;;MAOjB,cAAc;;MAOd;;EAiCJ;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,YAAY;;EAGZ;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,WAAW,WAAW;;EAGtB,UAAU;;EAGV;;EAGA,QAAQ,WAAW;;;;;;;;;EAUnB;;;;;;;;;EAUA;;;;;;;EAQA;;EAGA,cAAc;;EAGd;EAEA,YAAY,eAAe,SAAS,KAAK;EACzC,YAAY,QAAQ;EAuDpB;;MAKI,WAAW;;UAKP;;UAkBA;;;;;EAQC,iBACP,qCACC,KAAK;;EAwCC,YAAY,qCAAqC;;;;;EAgBpD,UACJ,UAAU,eACV,oCACA,aAAa,2BACZ,QAAQ;EAuDJ,uBACL,UAAU,eACV,oCACA,cAAc,2BACb,eAAe;;;;;;EAmDX,sBACL,UAAU,eACV,oCACA,aAAa,2BACZ,eAAe;;;;;EA4FT,UACP,OAAO,kBACP,SAAS,QAAQ,6BAChB,SACD,wBACA,gBACA;;;;;;;;;;;;;;EAqBF,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,uCACR,SAAS,wBAAwB;EAEpC,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,sCACR,SAAS;IAA0B,KAAK;IAAa,QAAQ;;EAEhE,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,yCAEP,SAAS,wBAAwB,aACjC,SAAS;IAA0B,KAAK;IAAa,QAAQ"}
1
+ {"version":3,"file":"index.d.cts","names":["OpenAIClient"],"sources":["../../src/chat_models/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;KA2CK,wBAAwB,KAC3B,WAAW;EAGX,UAAUA,OAAa,KAAK,YAAY;EACxC;EACA;EACA;EACA;EACA;IAAe;IAAiB;;EAChC;;;;;;;;;;qBAoCW,uBAAuB,cAClC,2BACA;SAEO;EAIP;;MAGI;KAAiB;;;MAOjB,cAAc;;MAOd;;EAiCJ;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,YAAY;;EAGZ;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,WAAW,WAAW;;EAGtB,UAAU;;EAGV;;EAGA,QAAQ,WAAW;;;;;;;;;EAUnB;;;;;;;;;EAUA;;;;;;;EAQA;;EAGA,cAAc;;EAGd;EAEA,YAAY,eAAe,SAAS,KAAK;EACzC,YAAY,QAAQ;EAuDpB;;MAKI,WAAW;;UAKP;;UAkBA;;;;;EAQC,iBACP,qCACC,KAAK;;EAwCC,YAAY,qCAAqC;;;;;EAgBpD,UACJ,UAAU,eACV,oCACA,aAAa,2BACZ,QAAQ;EAuDJ,uBACL,UAAU,eACV,oCACA,cAAc,2BACb,eAAe;;;;;;EAmDX,sBACL,UAAU,eACV,oCACA,aAAa,2BACZ,eAAe;;;;;EA4FT,UACP,OAAO,kBACP,SAAS,QAAQ,6BAChB,SACD,wBACA,gBACA;;;;;;;;;;;;;;EAqBF,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,uCACR,SAAS,wBAAwB;EAEpC,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,sCACR,SAAS;IAA0B,KAAK;IAAa,QAAQ;;EAEhE,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,yCAEP,SAAS,wBAAwB,aACjC,SAAS;IAA0B,KAAK;IAAa,QAAQ"}
@@ -39,7 +39,7 @@ type OpenRouterRequestBody = Omit<OpenRouter.ChatGenerationParams, "messages"> &
39
39
  * available on OpenRouter can be used by passing its identifier (e.g.
40
40
  * `"anthropic/claude-4-sonnet"`) as the `model` param.
41
41
  */
42
- declare class ChatOpenRouter extends BaseChatModel<ChatOpenRouterCallOptions, AIMessageChunk> {
42
+ export declare class ChatOpenRouter extends BaseChatModel<ChatOpenRouterCallOptions, AIMessageChunk> {
43
43
  static lc_name(): string;
44
44
  lc_serializable: boolean;
45
45
  /** Maps secret fields to the environment variable they can be loaded from. */
@@ -184,5 +184,4 @@ declare class ChatOpenRouter extends BaseChatModel<ChatOpenRouterCallOptions, AI
184
184
  }>;
185
185
  }
186
186
  //#endregion
187
- export { ChatOpenRouter };
188
187
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/chat_models/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;KA2CK,wBAAwB,KAC3B,WAAW;EAGX,UAAU,OAAa,KAAK,YAAY;EACxC;EACA;EACA;EACA;EACA;IAAe;IAAiB;;EAChC;;;;;;;;;;cAoCW,uBAAuB,cAClC,2BACA;SAEO;EAIP;;MAGI;KAAiB;;;MAOjB,cAAc;;MAOd;;EAiCJ;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,YAAY;;EAGZ;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,WAAW,WAAW;;EAGtB,UAAU;;EAGV;;EAGA,QAAQ,WAAW;;;;;;;;;EAUnB;;;;;;;;;EAUA;;;;;;;EAQA;;EAGA,cAAc;;EAGd;EAEA,YAAY,eAAe,SAAS,KAAK;EACzC,YAAY,QAAQ;EAuDpB;;MAKI,WAAW;;UAKP;;UAkBA;;;;;EAQC,iBACP,qCACC,KAAK;;EAwCC,YAAY,qCAAqC;;;;;EAgBpD,UACJ,UAAU,eACV,oCACA,aAAa,2BACZ,QAAQ;EAuDJ,uBACL,UAAU,eACV,oCACA,cAAc,2BACb,eAAe;;;;;;EAmDX,sBACL,UAAU,eACV,oCACA,aAAa,2BACZ,eAAe;;;;;EA4FT,UACP,OAAO,kBACP,SAAS,QAAQ,6BAChB,SACD,wBACA,gBACA;;;;;;;;;;;;;;EAqBF,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,uCACR,SAAS,wBAAwB;EAEpC,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,sCACR,SAAS;IAA0B,KAAK;IAAa,QAAQ;;EAEhE,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,yCAEP,SAAS,wBAAwB,aACjC,SAAS;IAA0B,KAAK;IAAa,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":["OpenAIClient"],"sources":["../../src/chat_models/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;KA2CK,wBAAwB,KAC3B,WAAW;EAGX,UAAUA,OAAa,KAAK,YAAY;EACxC;EACA;EACA;EACA;EACA;IAAe;IAAiB;;EAChC;;;;;;;;;;qBAoCW,uBAAuB,cAClC,2BACA;SAEO;EAIP;;MAGI;KAAiB;;;MAOjB,cAAc;;MAOd;;EAiCJ;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,YAAY;;EAGZ;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA,WAAW,WAAW;;EAGtB,UAAU;;EAGV;;EAGA,QAAQ,WAAW;;;;;;;;;EAUnB;;;;;;;;;EAUA;;;;;;;EAQA;;EAGA,cAAc;;EAGd;EAEA,YAAY,eAAe,SAAS,KAAK;EACzC,YAAY,QAAQ;EAuDpB;;MAKI,WAAW;;UAKP;;UAkBA;;;;;EAQC,iBACP,qCACC,KAAK;;EAwCC,YAAY,qCAAqC;;;;;EAgBpD,UACJ,UAAU,eACV,oCACA,aAAa,2BACZ,QAAQ;EAuDJ,uBACL,UAAU,eACV,oCACA,cAAc,2BACb,eAAe;;;;;;EAmDX,sBACL,UAAU,eACV,oCACA,aAAa,2BACZ,eAAe;;;;;EA4FT,UACP,OAAO,kBACP,SAAS,QAAQ,6BAChB,SACD,wBACA,gBACA;;;;;;;;;;;;;;EAqBF,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,uCACR,SAAS,wBAAwB;EAEpC,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,sCACR,SAAS;IAA0B,KAAK;IAAa,QAAQ;;EAEhE,qBAEE,kBAAkB,sBAAsB,qBAExC,cACI,eAAe,aACf,mBAAmB,aAEnB,qBACJ,SAAS,yCAEP,SAAS,wBAAwB,aACjC,SAAS;IAA0B,KAAK;IAAa,QAAQ"}
@@ -152,7 +152,7 @@ var ChatOpenRouter = class extends BaseChatModel {
152
152
  model: modelOrFields
153
153
  } : modelOrFields;
154
154
  super(fields);
155
- this._addVersion("@langchain/openrouter", "0.4.16");
155
+ this._addVersion("@langchain/openrouter", "0.4.18");
156
156
  const apiKey = fields.apiKey ?? getEnvironmentVariable("OPENROUTER_API_KEY");
157
157
  if (!apiKey) throw new OpenRouterAuthError("OpenRouter API key is required. Get one at https://openrouter.ai/keys and set it via the `apiKey` parameter or the OPENROUTER_API_KEY environment variable.");
158
158
  this.apiKey = apiKey;
@@ -1,18 +1,18 @@
1
1
  import { OpenRouter } from "../api-types.cjs";
2
2
  import { BaseChatModelCallOptions, BaseChatModelParams, BindToolsInput } from "@langchain/core/language_models/chat_models";
3
3
  //#region src/chat_models/types.d.ts
4
- type OpenRouterResponseFormat = OpenRouter.ChatGenerationParams["response_format"];
4
+ export type OpenRouterResponseFormat = OpenRouter.ChatGenerationParams["response_format"];
5
5
  /**
6
6
  * Plugin configuration for OpenRouter plugins (e.g. web search).
7
7
  */
8
- interface OpenRouterPlugin {
8
+ export interface OpenRouterPlugin {
9
9
  id: string;
10
10
  [key: string]: any;
11
11
  }
12
12
  /**
13
13
  * Shared fields that can be set at construction time or overridden per-call.
14
14
  */
15
- interface ChatOpenRouterFields {
15
+ export interface ChatOpenRouterFields {
16
16
  /** Sampling temperature (0–2). */
17
17
  temperature?: number;
18
18
  /** Maximum number of tokens to generate. */
@@ -57,7 +57,7 @@ interface ChatOpenRouterFields {
57
57
  /**
58
58
  * Constructor parameters for `ChatOpenRouter`.
59
59
  */
60
- interface ChatOpenRouterParams extends BaseChatModelParams, ChatOpenRouterFields {
60
+ export interface ChatOpenRouterParams extends BaseChatModelParams, ChatOpenRouterFields {
61
61
  /** Model identifier, e.g. "anthropic/claude-4-sonnet". */
62
62
  model?: string;
63
63
  /** OpenRouter API key. Falls back to `OPENROUTER_API_KEY` env var. */
@@ -101,7 +101,7 @@ interface ChatOpenRouterParams extends BaseChatModelParams, ChatOpenRouterFields
101
101
  /**
102
102
  * Per-call options for `ChatOpenRouter`.
103
103
  */
104
- interface ChatOpenRouterCallOptions extends BaseChatModelCallOptions, ChatOpenRouterFields {
104
+ export interface ChatOpenRouterCallOptions extends BaseChatModelCallOptions, ChatOpenRouterFields {
105
105
  /** Tool definitions to bind for this call. */
106
106
  tools?: BindToolsInput[];
107
107
  /** Response format constraint (text, JSON object, or JSON schema). */
@@ -119,5 +119,4 @@ interface ChatOpenRouterCallOptions extends BaseChatModelCallOptions, ChatOpenRo
119
119
  signal?: AbortSignal;
120
120
  }
121
121
  //#endregion
122
- export { ChatOpenRouterCallOptions, ChatOpenRouterFields, ChatOpenRouterParams, OpenRouterPlugin, OpenRouterResponseFormat };
123
122
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/chat_models/types.ts"],"mappings":";;;KAOY,2BACV,WAAW;;;;UAKI;EACf;GAEC;;;;;UAMc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,YAAY;;EAEZ;;EAEA;;EAEA;;EAEA;;EAEA,WAAW,WAAW;;EAEtB,UAAU;;EAEV;;EAEA,QAAQ,WAAW;;;;;UAMJ,6BACP,qBAAqB;;EAE7B;;EAEA;;EAEA;;;;;;;EAOA;;;;;;;;EAQA;;;;;;;;;;;;EAYA;;EAEA;;EAEA,cAAc;;EAEd;;;;;UAMe,kCACP,0BAA0B;;EAElC,QAAQ;;EAER,kBAAkB;;EAElB;;EAEA;IAAe;IAAiB;;;EAEhC;;EAEA,SAAS"}
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/chat_models/types.ts"],"mappings":";;;YAOY,2BACV,WAAW;;;;iBAKI;EACf;GAEC;;;;;iBAMc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,YAAY;;EAEZ;;EAEA;;EAEA;;EAEA;;EAEA,WAAW,WAAW;;EAEtB,UAAU;;EAEV;;EAEA,QAAQ,WAAW;;;;;iBAMJ,6BACP,qBAAqB;;EAE7B;;EAEA;;EAEA;;;;;;;EAOA;;;;;;;;EAQA;;;;;;;;;;;;EAYA;;EAEA;;EAEA,cAAc;;EAEd;;;;;iBAMe,kCACP,0BAA0B;;EAElC,QAAQ;;EAER,kBAAkB;;EAElB;;EAEA;IAAe;IAAiB;;;EAEhC;;EAEA,SAAS"}
@@ -1,18 +1,18 @@
1
1
  import { OpenRouter } from "../api-types.js";
2
2
  import { BaseChatModelCallOptions, BaseChatModelParams, BindToolsInput } from "@langchain/core/language_models/chat_models";
3
3
  //#region src/chat_models/types.d.ts
4
- type OpenRouterResponseFormat = OpenRouter.ChatGenerationParams["response_format"];
4
+ export type OpenRouterResponseFormat = OpenRouter.ChatGenerationParams["response_format"];
5
5
  /**
6
6
  * Plugin configuration for OpenRouter plugins (e.g. web search).
7
7
  */
8
- interface OpenRouterPlugin {
8
+ export interface OpenRouterPlugin {
9
9
  id: string;
10
10
  [key: string]: any;
11
11
  }
12
12
  /**
13
13
  * Shared fields that can be set at construction time or overridden per-call.
14
14
  */
15
- interface ChatOpenRouterFields {
15
+ export interface ChatOpenRouterFields {
16
16
  /** Sampling temperature (0–2). */
17
17
  temperature?: number;
18
18
  /** Maximum number of tokens to generate. */
@@ -57,7 +57,7 @@ interface ChatOpenRouterFields {
57
57
  /**
58
58
  * Constructor parameters for `ChatOpenRouter`.
59
59
  */
60
- interface ChatOpenRouterParams extends BaseChatModelParams, ChatOpenRouterFields {
60
+ export interface ChatOpenRouterParams extends BaseChatModelParams, ChatOpenRouterFields {
61
61
  /** Model identifier, e.g. "anthropic/claude-4-sonnet". */
62
62
  model?: string;
63
63
  /** OpenRouter API key. Falls back to `OPENROUTER_API_KEY` env var. */
@@ -101,7 +101,7 @@ interface ChatOpenRouterParams extends BaseChatModelParams, ChatOpenRouterFields
101
101
  /**
102
102
  * Per-call options for `ChatOpenRouter`.
103
103
  */
104
- interface ChatOpenRouterCallOptions extends BaseChatModelCallOptions, ChatOpenRouterFields {
104
+ export interface ChatOpenRouterCallOptions extends BaseChatModelCallOptions, ChatOpenRouterFields {
105
105
  /** Tool definitions to bind for this call. */
106
106
  tools?: BindToolsInput[];
107
107
  /** Response format constraint (text, JSON object, or JSON schema). */
@@ -119,5 +119,4 @@ interface ChatOpenRouterCallOptions extends BaseChatModelCallOptions, ChatOpenRo
119
119
  signal?: AbortSignal;
120
120
  }
121
121
  //#endregion
122
- export { ChatOpenRouterCallOptions, ChatOpenRouterFields, ChatOpenRouterParams, OpenRouterPlugin, OpenRouterResponseFormat };
123
122
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/chat_models/types.ts"],"mappings":";;;KAOY,2BACV,WAAW;;;;UAKI;EACf;GAEC;;;;;UAMc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,YAAY;;EAEZ;;EAEA;;EAEA;;EAEA;;EAEA,WAAW,WAAW;;EAEtB,UAAU;;EAEV;;EAEA,QAAQ,WAAW;;;;;UAMJ,6BACP,qBAAqB;;EAE7B;;EAEA;;EAEA;;;;;;;EAOA;;;;;;;;EAQA;;;;;;;;;;;;EAYA;;EAEA;;EAEA,cAAc;;EAEd;;;;;UAMe,kCACP,0BAA0B;;EAElC,QAAQ;;EAER,kBAAkB;;EAElB;;EAEA;IAAe;IAAiB;;;EAEhC;;EAEA,SAAS"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../src/chat_models/types.ts"],"mappings":";;;YAOY,2BACV,WAAW;;;;iBAKI;EACf;GAEC;;;;;iBAMc;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,YAAY;;EAEZ;;EAEA;;EAEA;;EAEA;;EAEA,WAAW,WAAW;;EAEtB,UAAU;;EAEV;;EAEA,QAAQ,WAAW;;;;;iBAMJ,6BACP,qBAAqB;;EAE7B;;EAEA;;EAEA;;;;;;;EAOA;;;;;;;;EAQA;;;;;;;;;;;;EAYA;;EAEA;;EAEA,cAAc;;EAEd;;;;;iBAMe,kCACP,0BAA0B;;EAElC,QAAQ;;EAER,kBAAkB;;EAElB;;EAEA;IAAe;IAAiB;;;EAEhC;;EAEA,SAAS"}
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import { ChatOpenRouterCallOptions, ChatOpenRouterFields, ChatOpenRouterParams,
3
3
  import { ChatOpenRouter } from "./chat_models/index.cjs";
4
4
  import { OpenRouterAuthError, OpenRouterError, OpenRouterRateLimitError } from "./utils/errors.cjs";
5
5
  //#region src/index.d.ts
6
- declare const OPENROUTER_MODEL_PROFILES: Record<string, import("@langchain/core/language_models/profile").ModelProfile>;
6
+ export declare const OPENROUTER_MODEL_PROFILES: Record<string, import("@langchain/core/language_models/profile").ModelProfile>;
7
7
  //#endregion
8
- export { ChatOpenRouter, type ChatOpenRouterCallOptions, type ChatOpenRouterFields, type ChatOpenRouterParams as ChatOpenRouterInput, OPENROUTER_MODEL_PROFILES, type OpenRouter, OpenRouterAuthError, OpenRouterError, type OpenRouterPlugin, OpenRouterRateLimitError, type OpenRouterResponseFormat };
8
+ export { ChatOpenRouter, type ChatOpenRouterCallOptions, type ChatOpenRouterFields, type ChatOpenRouterParams as ChatOpenRouterInput, type OpenRouter, OpenRouterAuthError, OpenRouterError, type OpenRouterPlugin, OpenRouterRateLimitError, type OpenRouterResponseFormat };
9
9
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;cAgBa,2BAAyB,iEAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;qBAgBa,2BAAyB,iEAAA"}
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ChatOpenRouterCallOptions, ChatOpenRouterFields, ChatOpenRouterParams,
3
3
  import { ChatOpenRouter } from "./chat_models/index.js";
4
4
  import { OpenRouterAuthError, OpenRouterError, OpenRouterRateLimitError } from "./utils/errors.js";
5
5
  //#region src/index.d.ts
6
- declare const OPENROUTER_MODEL_PROFILES: Record<string, import("@langchain/core/language_models/profile").ModelProfile>;
6
+ export declare const OPENROUTER_MODEL_PROFILES: Record<string, import("@langchain/core/language_models/profile").ModelProfile>;
7
7
  //#endregion
8
- export { ChatOpenRouter, type ChatOpenRouterCallOptions, type ChatOpenRouterFields, type ChatOpenRouterParams as ChatOpenRouterInput, OPENROUTER_MODEL_PROFILES, type OpenRouter, OpenRouterAuthError, OpenRouterError, type OpenRouterPlugin, OpenRouterRateLimitError, type OpenRouterResponseFormat };
8
+ export { ChatOpenRouter, type ChatOpenRouterCallOptions, type ChatOpenRouterFields, type ChatOpenRouterParams as ChatOpenRouterInput, type OpenRouter, OpenRouterAuthError, OpenRouterError, type OpenRouterPlugin, OpenRouterRateLimitError, type OpenRouterResponseFormat };
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;cAgBa,2BAAyB,iEAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;qBAgBa,2BAAyB,iEAAA"}
@@ -1,8 +1,6 @@
1
1
  import { LangChainError } from "@langchain/core/errors";
2
2
  //#region src/utils/errors.d.ts
3
- declare const OpenRouterError_base: typeof LangChainError & {
4
- isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
5
- };
3
+ declare const OpenRouterError_base: import("@langchain/core/errors").BrandedClass<typeof LangChainError>;
6
4
  /**
7
5
  * Base error for all OpenRouter API errors.
8
6
  *
@@ -14,7 +12,7 @@ declare const OpenRouterError_base: typeof LangChainError & {
14
12
  * Type-check errors with `OpenRouterError.isInstance(err)` rather than
15
13
  * `instanceof` — this avoids cross-realm / duplicate-package pitfalls.
16
14
  */
17
- declare class OpenRouterError extends OpenRouterError_base {
15
+ export declare class OpenRouterError extends OpenRouterError_base {
18
16
  readonly name: string;
19
17
  /** HTTP status code, if available. */
20
18
  statusCode?: number;
@@ -39,9 +37,7 @@ declare class OpenRouterError extends OpenRouterError_base {
39
37
  */
40
38
  static fromResponse(response: Response): Promise<OpenRouterError>;
41
39
  }
42
- declare const OpenRouterAuthError_base: typeof OpenRouterError & {
43
- isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
44
- };
40
+ declare const OpenRouterAuthError_base: import("@langchain/core/errors").BrandedClass<typeof OpenRouterError>;
45
41
  /**
46
42
  * Thrown on authentication or authorization failures.
47
43
  *
@@ -49,23 +45,20 @@ declare const OpenRouterAuthError_base: typeof OpenRouterError & {
49
45
  * HTTP 401/403 responses, and thrown directly by the constructor when
50
46
  * no API key is provided.
51
47
  */
52
- declare class OpenRouterAuthError extends OpenRouterAuthError_base {
48
+ export declare class OpenRouterAuthError extends OpenRouterAuthError_base {
53
49
  readonly name = "OpenRouterAuthError";
54
50
  constructor(message: string, statusCode?: number, code?: number, metadata?: Record<string, unknown>, headers?: Record<string, string>);
55
51
  }
56
- declare const OpenRouterRateLimitError_base: typeof OpenRouterError & {
57
- isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
58
- };
52
+ declare const OpenRouterRateLimitError_base: import("@langchain/core/errors").BrandedClass<typeof OpenRouterError>;
59
53
  /**
60
54
  * Thrown when the API returns HTTP 429 (Too Many Requests).
61
55
  *
62
56
  * Callers can catch this specifically to implement back-off / retry
63
57
  * logic without catching unrelated API errors.
64
58
  */
65
- declare class OpenRouterRateLimitError extends OpenRouterRateLimitError_base {
59
+ export declare class OpenRouterRateLimitError extends OpenRouterRateLimitError_base {
66
60
  readonly name = "OpenRouterRateLimitError";
67
61
  constructor(message: string, statusCode?: number, code?: number, metadata?: Record<string, unknown>, headers?: Record<string, string>);
68
62
  }
69
63
  //#endregion
70
- export { OpenRouterAuthError, OpenRouterError, OpenRouterRateLimitError };
71
64
  //# sourceMappingURL=errors.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.cts","names":[],"sources":["../../src/utils/errors.ts"],"mappings":";;;;;;;;;;;;;;;;cAea,wBAAwB;WAC1B;;EAGT;;EAGA;;EAGA,WAAW;;EAGX,UAAU;EAEV,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU;;;;;;;;;;;;;SAqBC,aAAa,UAAU,WAAW,QAAQ;;;;;;;;;;;;cA8D5C,4BAA4B;WAC9B;EAET,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU;;;;;;;;;;;cAYD,iCAAiC;WAInC;EAET,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU"}
1
+ {"version":3,"file":"errors.d.cts","names":[],"sources":["../../src/utils/errors.ts"],"mappings":";;;;;;;;;;;;;;qBAea,wBAAwB;WAC1B;;EAGT;;EAGA;;EAGA,WAAW;;EAGX,UAAU;EAEV,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU;;;;;;;;;;;;;SAqBC,aAAa,UAAU,WAAW,QAAQ;;;;;;;;;;qBA8D5C,4BAA4B;WAC9B;EAET,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU;;;;;;;;;qBAYD,iCAAiC;WAInC;EAET,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU"}
@@ -1,8 +1,6 @@
1
1
  import { LangChainError } from "@langchain/core/errors";
2
2
  //#region src/utils/errors.d.ts
3
- declare const OpenRouterError_base: typeof LangChainError & {
4
- isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
5
- };
3
+ declare const OpenRouterError_base: import("@langchain/core/errors").BrandedClass<typeof LangChainError>;
6
4
  /**
7
5
  * Base error for all OpenRouter API errors.
8
6
  *
@@ -14,7 +12,7 @@ declare const OpenRouterError_base: typeof LangChainError & {
14
12
  * Type-check errors with `OpenRouterError.isInstance(err)` rather than
15
13
  * `instanceof` — this avoids cross-realm / duplicate-package pitfalls.
16
14
  */
17
- declare class OpenRouterError extends OpenRouterError_base {
15
+ export declare class OpenRouterError extends OpenRouterError_base {
18
16
  readonly name: string;
19
17
  /** HTTP status code, if available. */
20
18
  statusCode?: number;
@@ -39,9 +37,7 @@ declare class OpenRouterError extends OpenRouterError_base {
39
37
  */
40
38
  static fromResponse(response: Response): Promise<OpenRouterError>;
41
39
  }
42
- declare const OpenRouterAuthError_base: typeof OpenRouterError & {
43
- isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
44
- };
40
+ declare const OpenRouterAuthError_base: import("@langchain/core/errors").BrandedClass<typeof OpenRouterError>;
45
41
  /**
46
42
  * Thrown on authentication or authorization failures.
47
43
  *
@@ -49,23 +45,20 @@ declare const OpenRouterAuthError_base: typeof OpenRouterError & {
49
45
  * HTTP 401/403 responses, and thrown directly by the constructor when
50
46
  * no API key is provided.
51
47
  */
52
- declare class OpenRouterAuthError extends OpenRouterAuthError_base {
48
+ export declare class OpenRouterAuthError extends OpenRouterAuthError_base {
53
49
  readonly name = "OpenRouterAuthError";
54
50
  constructor(message: string, statusCode?: number, code?: number, metadata?: Record<string, unknown>, headers?: Record<string, string>);
55
51
  }
56
- declare const OpenRouterRateLimitError_base: typeof OpenRouterError & {
57
- isInstance: <T extends abstract new (...args: any[]) => any>(this: T, obj: unknown) => obj is InstanceType<T>;
58
- };
52
+ declare const OpenRouterRateLimitError_base: import("@langchain/core/errors").BrandedClass<typeof OpenRouterError>;
59
53
  /**
60
54
  * Thrown when the API returns HTTP 429 (Too Many Requests).
61
55
  *
62
56
  * Callers can catch this specifically to implement back-off / retry
63
57
  * logic without catching unrelated API errors.
64
58
  */
65
- declare class OpenRouterRateLimitError extends OpenRouterRateLimitError_base {
59
+ export declare class OpenRouterRateLimitError extends OpenRouterRateLimitError_base {
66
60
  readonly name = "OpenRouterRateLimitError";
67
61
  constructor(message: string, statusCode?: number, code?: number, metadata?: Record<string, unknown>, headers?: Record<string, string>);
68
62
  }
69
63
  //#endregion
70
- export { OpenRouterAuthError, OpenRouterError, OpenRouterRateLimitError };
71
64
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","names":[],"sources":["../../src/utils/errors.ts"],"mappings":";;;;;;;;;;;;;;;;cAea,wBAAwB;WAC1B;;EAGT;;EAGA;;EAGA,WAAW;;EAGX,UAAU;EAEV,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU;;;;;;;;;;;;;SAqBC,aAAa,UAAU,WAAW,QAAQ;;;;;;;;;;;;cA8D5C,4BAA4B;WAC9B;EAET,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU;;;;;;;;;;;cAYD,iCAAiC;WAInC;EAET,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU"}
1
+ {"version":3,"file":"errors.d.ts","names":[],"sources":["../../src/utils/errors.ts"],"mappings":";;;;;;;;;;;;;;qBAea,wBAAwB;WAC1B;;EAGT;;EAGA;;EAGA,WAAW;;EAGX,UAAU;EAEV,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU;;;;;;;;;;;;;SAqBC,aAAa,UAAU,WAAW,QAAQ;;;;;;;;;;qBA8D5C,4BAA4B;WAC9B;EAET,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU;;;;;;;;;qBAYD,iCAAiC;WAInC;EAET,YACE,iBACA,qBACA,eACA,WAAW,yBACX,UAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/openrouter",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "description": "OpenRouter integration for LangChain.js",
5
5
  "author": "LangChain",
6
6
  "license": "MIT",
@@ -14,9 +14,9 @@
14
14
  "directory": "libs/providers/langchain-openrouter"
15
15
  },
16
16
  "dependencies": {
17
- "eventsource-parser": "^4.1.0",
18
- "openai": "^7.8.0",
19
- "@langchain/openai": "1.6.1"
17
+ "eventsource-parser": "^4.1.1",
18
+ "openai": "^7.23.0",
19
+ "@langchain/openai": "1.6.3"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@langchain/core": "^1.0.0"
@@ -26,11 +26,11 @@
26
26
  "dpdm": "^4.3.0",
27
27
  "sparktype": "^0.1.3",
28
28
  "typescript": "~7.0.2",
29
- "vitest": "^4.1.11",
29
+ "vitest": "^5.0.2",
30
30
  "zod": "^3.25.76 || ^4",
31
31
  "zod-to-json-schema": "^3.25.2",
32
- "@langchain/core": "^1.2.14",
33
- "@langchain/openai": "^1.6.1",
32
+ "@langchain/core": "^1.2.20",
33
+ "@langchain/openai": "^1.6.3",
34
34
  "@langchain/standard-tests": "0.0.23"
35
35
  },
36
36
  "publishConfig": {