first commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import axios from "axios";
|
||||
import 'dotenv/config';
|
||||
|
||||
const API_KEY = process.env.TAVILY_API_KEY;
|
||||
|
||||
async function webSearch(query) {
|
||||
const response = await axios.post("https://api.tavily.com/search",
|
||||
{ query },
|
||||
{ headers: { Authorization: `Bearer ${API_KEY}` } }
|
||||
);
|
||||
|
||||
console.log(response.data.results);
|
||||
}
|
||||
|
||||
webSearch("who is the current president of united states");
|
||||
Reference in New Issue
Block a user