Skip to content

Instantly share code, notes, and snippets.

@wallabyway
wallabyway / simplesearch.js
Created July 10, 2024 20:20 — forked from N8python/simplesearch.js
It's pretty simple to make a half-decent search agent.
import googleIt from 'google-it';
import axios from 'axios';
import cheerio from 'cheerio';
import OpenAI from 'openai';
import readlineSync from 'readline-sync';
const openai = new OpenAI({
baseURL: "http://localhost:1234/v1",
apiKey: 'My API Key'
});