@langchain/core 0.0.5 → 0.0.6

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.
@@ -187,7 +187,7 @@ class BaseLanguageModel extends BaseLangChain {
187
187
  console.warn("Failed to calculate number of tokens, falling back to approximate count", error);
188
188
  }
189
189
  }
190
- else {
190
+ if (this._encoding) {
191
191
  try {
192
192
  numTokens = this._encoding.encode(content).length;
193
193
  }
@@ -179,7 +179,7 @@ export class BaseLanguageModel extends BaseLangChain {
179
179
  console.warn("Failed to calculate number of tokens, falling back to approximate count", error);
180
180
  }
181
181
  }
182
- else {
182
+ if (this._encoding) {
183
183
  try {
184
184
  numTokens = this._encoding.encode(content).length;
185
185
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/core",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Core LangChain.js abstractions and schemas",
5
5
  "type": "module",
6
6
  "engines": {