langchainjs icon indicating copy to clipboard operation
langchainjs copied to clipboard

TavilySearch construct args act incorrectly when invoked

Open fantasy-lotus opened this issue 7 months ago • 1 comments

Checked other resources

  • [x] I added a very descriptive title to this issue.
  • [x] I searched the LangChain.js documentation with the integrated search.
  • [x] I used the GitHub search to find a similar question and didn't find it.
  • [x] I am sure that this is a bug in LangChain.js rather than my code.
  • [x] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

const tool = new TavilySearch({
  maxResults: 3,
  includeAnswer: true,
});
console.log(tool.includeAnswer);//true

(async () => {
  const res = await tool.invoke({
    query: search,
  });
  console.log("result:", res.answer);//❌null
})();

Error Message and Stack Trace (if applicable)

No response

Description

The parameters I entered during construction did not work,not only the includeAnswer, the maxResults is also default(5) when response back but i set it 3

System Info

"@langchain/community": "^0.3.41", "@langchain/core": "^0.3.47", "@langchain/langgraph": "^0.2.64", "@langchain/openai": "^0.5.5", "@langchain/tavily": "^0.1.1", node:22.x

fantasy-lotus avatar Apr 24 '25 07:04 fantasy-lotus

Image

fantasy-lotus avatar Apr 24 '25 07:04 fantasy-lotus

Hi @benjamincburns I think latest changes for this package are not published to npm. Can you please check??

anadi45 avatar May 10 '25 21:05 anadi45

@anadi45 my apologies for the oversight - you're correct - will try to get it out today!

benjamincburns avatar May 23 '25 00:05 benjamincburns

Hi everyone, is this issue closed, or should I start working on it?

dobleuber avatar Jun 23 '25 23:06 dobleuber

I think this issue has been solved.

0xobedient avatar Aug 25 '25 10:08 0xobedient

I think this issue has been solved.

Thanks for confirming! Happy to re-open if folks still encounter problems here.

christian-bromann avatar Sep 12 '25 16:09 christian-bromann