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
// Step 2. Executing a simple search query
const response = await tvly.search("Who is Leo Messi?");
Comment:await gives error since it's not async
2. For RAG Application context:
// Step 2. Executing a context search query
const context = tvly.searchContext("What happened during the Burning Man floods?");
// Step 3. That's it! You now have a context string that you can feed directly into your RAG Application
console.log(response);
Comment: Should be console.log(context) instead. Wrong const.
By the way, I've tried all three (corrected) codes in the documentation and always got this printed in the CLI: Promise { <pending> }
before the script ends.
Is there something that I missed? Sorry, I'm still new with JavaScript because I often use Python and Python API for Tavily works great.
P/S: My system is Windows 10 and I installed it using npm install @tavily/core on my Windows Terminal. I simply copy-paste the 3 codes from the documentation in three separate .js file that I ran separately using node filename.js
Hoping for a reply,
Milah
The text was updated successfully, but these errors were encountered:
I received a strange error (json_decode_error), and thanks to your issue I figured out you're right. I'm surprised it's in the docs, it's common knowledge you can't do that in js. Anyway, here's one quick solution:
I received a strange error (json_decode_error), and thanks to your issue I figured out you're right. I'm surprised it's in the docs, it's common knowledge you can't do that in js. Anyway, here's one quick solution:
Thanks for taking the time to raise the issue @milahlurhahs 👍
This is for searching within a set of given URLs, right? I received this Promise { <pending> } as the only output when running this to search the internet:
// Step 1. Instantiating your Tavily client
const tvly = tavily({ apiKey: APIKEY }); //[REDACTED]
// Step 2. Executing a Q&A search query
const answer = tvly.searchQNA("Who is Leo Messi?");
// Step 3. That's it! Your question has been answered!
console.log(answer);```
1. For full search API response:
Comment:
await
gives error since it's not async2. For RAG Application context:
Comment: Should be
console.log(context)
instead. Wrong const.By the way, I've tried all three (corrected) codes in the documentation and always got this printed in the CLI:
Promise { <pending> }
before the script ends.
Is there something that I missed? Sorry, I'm still new with JavaScript because I often use Python and Python API for Tavily works great.
P/S: My system is Windows 10 and I installed it using
npm install @tavily/core
on my Windows Terminal. I simply copy-paste the 3 codes from the documentation in three separate .js file that I ran separately usingnode filename.js
Hoping for a reply,
Milah
The text was updated successfully, but these errors were encountered: