Skip to content

Commit

Permalink
Fix getBufferString method (#3423)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 authored Nov 28, 2023
1 parent aef5627 commit 8cb0944
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
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 @@
},
"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

2 comments on commit 8cb0944

@vercel
Copy link

@vercel vercel bot commented on 8cb0944 Nov 28, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 8cb0944 Nov 28, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

langchainjs-docs – ./docs/core_docs/

langchainjs-docs-langchain.vercel.app
langchainjs-docs-ruddy.vercel.app
js.langchain.com
langchainjs-docs-git-main-langchain.vercel.app

Please sign in to comment.