Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core[patch]: Fix getBufferString method #3423

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion langchain-core/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 3 additions & 1 deletion langchain-core/src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
2 changes: 1 addition & 1 deletion langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on the PR! I've noticed that the dependency for "@langchain/core" has been updated to version 0.0.2, which is a dev dependency change. This comment is to flag the change for maintainers to review.

"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",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down