You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched the LangChain.js documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
I am sure that this is a bug in LangChain.js rather than my code.
The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
the following code:
import{BedrockRuntimeClient}from'@aws-sdk/client-bedrock-runtime';import{ChatBedrockConverse}from'@langchain/aws';import{SystemMessage,HumanMessage}from'@langchain/core/messages';constbedrock=newBedrockRuntimeClient({region:"us-east-1"});constchatBedrockConverse=newChatBedrockConverse({model: "us.amazon.nova-lite-v1:0",client: bedrock});constmessages=[newSystemMessage({content:[{type: "text",text: "my system prompt"},{cachePoint: {type: "default"}}]}),newHumanMessage("foo bar")]awaitchatBedrockConverse.invoke(messages);// throws "System message content must be either a string, or a content array containing a single text object."// from https://github.com/langchain-ai/langchainjs/blob/main/libs/langchain-aws/src/common.ts:355
Checked other resources
Example Code
the following code:
Error Message and Stack Trace (if applicable)
"System message content must be either a string, or a content array containing a single text object."
from https://github.com/langchain-ai/langchainjs/blob/main/libs/langchain-aws/src/common.ts:355
Description
I'm trying to use prompt caching, per https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html, with the Converse API. It works with langchain in python.
System Info
[email protected] | MIT | deps: 12 | versions: 319
Typescript bindings for langchain
https://github.com/langchain-ai/langchainjs/tree/main/langchain/
keywords: llm, ai, gpt3, chain, prompt, prompt engineering, chatgpt, machine learning, ml, openai, embeddings, vectorstores
dist
.tarball: https://registry.npmjs.org/langchain/-/langchain-0.3.24.tgz
.shasum: 24c5e16f7a43be8ce54d32079ea8dc8087c56777
.integrity: sha512-BTjiYkUCpWFAmufK8J5zMqc5aUs4eEnAXPWtPe2+R4ZPP+U7bXJSBHAcrB40rQ3VeTdRgMvgDjekOOgCMWut6Q==
.unpackedSize: 4.8 MB
dependencies:
@langchain/openai: >=0.1.0 <0.6.0 js-yaml: ^4.1.0 openapi-types: ^12.1.3 yaml: ^2.2.1
@langchain/textsplitters: >=0.0.0 <0.2.0 jsonpointer: ^5.0.1 p-retry: 4 zod-to-json-schema: ^3.22.3
js-tiktoken: ^1.0.12 langsmith: ^0.3.16 uuid: ^10.0.0 zod: ^3.22.4
maintainers:
dist-tags:
latest: 0.3.24 next: 0.3.2-rc.0 tag-for-publishing-older-releases: 0.2.20
published 2 weeks ago by basproul [email protected]
Using Node.js v22, on Fedora
The text was updated successfully, but these errors were encountered: