diff --git a/langchain-core/package.json b/langchain-core/package.json index 97a1a9082495..a81b5c30a5c7 100644 --- a/langchain-core/package.json +++ b/langchain-core/package.json @@ -1,6 +1,6 @@ { "name": "@langchain/core", - "version": "0.0.1", + "version": "0.0.2", "description": "Core LangChain.js abstractions and schemas", "type": "module", "engines": { diff --git a/langchain-core/src/messages/index.ts b/langchain-core/src/messages/index.ts index 805013f4ba42..9ddc2fd64e06 100644 --- a/langchain-core/src/messages/index.ts +++ b/langchain-core/src/messages/index.ts @@ -661,10 +661,12 @@ export function getBufferString( role = "System"; } else if (m._getType() === "function") { role = "Function"; + } else if (m._getType() === "tool") { + role = "Tool"; } else if (m._getType() === "generic") { role = (m as ChatMessage).role; } else { - throw new Error(`Got unsupported message type: ${m}`); + throw new Error(`Got unsupported message type: ${m._getType()}`); } const nameStr = m.name ? `${m.name}, ` : ""; string_messages.push(`${role}: ${nameStr}${m.content}`); diff --git a/langchain/package.json b/langchain/package.json index 5139b8897168..bceadc817f7b 100644 --- a/langchain/package.json +++ b/langchain/package.json @@ -1398,7 +1398,7 @@ }, "dependencies": { "@anthropic-ai/sdk": "^0.9.1", - "@langchain/core": "^0.0.1", + "@langchain/core": "~0.0.2", "binary-extensions": "^2.2.0", "expr-eval": "^2.0.2", "flat": "^5.0.2", diff --git a/yarn.lock b/yarn.lock index 84d275030a5a..d33ded784176 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7988,7 +7988,7 @@ __metadata: languageName: unknown linkType: soft -"@langchain/core@^0.0.1, @langchain/core@workspace:*, @langchain/core@workspace:langchain-core": +"@langchain/core@workspace:*, @langchain/core@workspace:langchain-core, @langchain/core@~0.0.2": version: 0.0.0-use.local resolution: "@langchain/core@workspace:langchain-core" dependencies: @@ -22597,7 +22597,7 @@ __metadata: "@google-cloud/storage": ^6.10.1 "@huggingface/inference": ^2.6.4 "@jest/globals": ^29.5.0 - "@langchain/core": ^0.0.1 + "@langchain/core": ~0.0.2 "@mozilla/readability": ^0.4.4 "@notionhq/client": ^2.2.10 "@opensearch-project/opensearch": ^2.2.0