-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Typing issue with langchain, @langchain/core, and @langchain/openai #5736
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
Comments
The issue you're encountering with type mismatches in
If these steps do not resolve the issue, consider downgrading to the versions that worked previously until a more permanent fix is available. For more details on similar issues, you can refer to the discussions and issues in the LangChain.js repository:
|
Hey @AumeshMisra, sorry you're running into this - can you try setting your resolutions field like this to ensure that only one version of https://js.langchain.com/v0.2/docs/how_to/installation/#installing-integration-packages CC @bracesproul |
Hi, const examplePrompt = ChatPromptTemplate.fromMessages([
['human', '{input}'],
['ai', '{output}'],
]);
const fewShotPrompt = new FewShotChatMessagePromptTemplate({
examplePrompt,
examples: examplesFewShot,
inputVariables: [],
});
const finalPrompt = ChatPromptTemplate.fromMessages([
['system', systemTemplateTaskClassificationFewShot],
fewShotPrompt,
['human', '{input}'],
]); My package.json looks like this:
I get the following TS error for using
I would be very grateful for any input. I don't see where the usage is different from the tutorial. Thank you very much! |
@ik4Rus can you try without the So:
|
This should be resolved in 0.3.0 - core is now a peer dep: https://js.langchain.com/docs/how_to/installation/#installing-integration-packages If this arises again after updating, please reopen! |
Checked other resources
Example Code
const prompt = PromptTemplate.fromTemplate(myPrompt);
const model = new AzureOpenAI({
modelName: "gpt-4o",
temperature: 0.0,
});
Error Message and Stack Trace (if applicable)
No response
Description
I am trying to use createStuffDocumentsChain but it's unable to resolve types.
For the llm param, I get:
for the prompt param, I get:
The expected type comes from property 'prompt' which is declared here on type '{ llm: LanguageModelLike; prompt: BasePromptTemplate<any, BasePromptValueInterface, any>; outputParser?: BaseOutputParser<...> | undefined; documentPrompt?: BasePromptTemplate<...> | undefined; documentSeparator?: string | undefined; }'
This was fine when I had:
"@langchain/community": "^0.2.4",
"@langchain/core": "^0.2.2",
"@langchain/openai": "^0.0.34",
But now there's an error when I have:
"@langchain/community": "^0.2.4",
"@langchain/core": "^0.2.6",
"@langchain/openai": "^0.1.2",
I even made sure to add:
"langchain": "^0.2.5",
but I'm still getting issues there.
System Info
"@langchain/core": "^0.2.6",
"@langchain/openai": "^0.1.2",
"@langchain/pinecone": "0.0.6",
"@pinecone-database/pinecone": "^2.2.2",
"@prisma/client": "^5.14.0",
"axios": "^1.6.8",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"langchain": "^0.2.5",
The text was updated successfully, but these errors were encountered: