chatgpt-api/bin/scratch.ts

95 wiersze
2.7 KiB
TypeScript
Czysty Zwykły widok Historia

2024-05-21 13:52:06 +00:00
#!/usr/bin/env node
import 'dotenv/config'
import restoreCursor from 'restore-cursor'
2024-05-27 01:15:17 +00:00
// import { SearxngClient } from '../src/services/searxng-client.js'
2024-05-22 08:11:36 +00:00
// import { ClearbitClient } from '../src/index.js'
2024-05-26 23:11:56 +00:00
// import { ProxycurlClient } from '../src/services/proxycurl-client.js'
2024-06-03 05:03:01 +00:00
// import { WikipediaClient } from '../src/index.js'
2024-06-03 06:19:10 +00:00
// import { PerigonClient } from '../src/index.js'
2024-06-03 07:19:25 +00:00
// import { FirecrawlClient } from '../src/index.js'
2024-06-03 08:46:05 +00:00
// import { ExaClient } from '../src/index.js'
2024-06-04 23:59:44 +00:00
// import { DiffbotClient } from '../src/index.js'
import { WolframClient } from '../src/index.js'
2024-05-21 13:52:06 +00:00
/**
2024-05-22 08:15:09 +00:00
* Scratch pad for testing.
2024-05-21 13:52:06 +00:00
*/
async function main() {
restoreCursor()
2024-05-22 08:11:36 +00:00
// const clearbit = new ClearbitClient()
// const res = await clearbit.companyEnrichment({
// domain: 'https://clay.com'
// })
// console.log(JSON.stringify(res, null, 2))
2024-05-26 23:11:56 +00:00
// const proxycurl = new ProxycurlClient()
// const res = await proxycurl.getLinkedInPerson({
// linkedin_profile_url: 'https://linkedin.com/in/fisch2'
// })
// console.log(JSON.stringify(res, null, 2))
2024-06-03 05:03:01 +00:00
// const wikipedia = new WikipediaClient()
// const res = await wikipedia.getPageSummary({
// // title: 'Naruto_(TV_series)'
// title: 'SpaceX'
// })
// console.log(JSON.stringify(res, null, 2))
2024-05-27 00:51:11 +00:00
2024-05-27 01:15:17 +00:00
// const searxng = new SearxngClient()
// const res = await searxng.search({
// query: 'golden gate bridge',
// engines: ['reddit']
// })
// console.log(JSON.stringify(res, null, 2))
2024-05-22 08:11:36 +00:00
2024-06-03 06:19:10 +00:00
// const perigon = new PerigonClient()
// const res = await perigon.searchArticles({
// q: 'AI agents AND startup',
// sourceGroup: 'top50tech'
// })
// console.log(JSON.stringify(res, null, 2))
2024-06-03 05:03:01 +00:00
2024-06-03 07:19:25 +00:00
// const firecrawl = new FirecrawlClient()
// const res = await firecrawl.scrapeUrl({
// // url: 'https://www.bbc.com/news/articles/cp4475gwny1o'
// url: 'https://www.firecrawl.dev'
// })
// console.log(JSON.stringify(res, null, 2))
2024-06-03 08:46:05 +00:00
// const exa = new ExaClient()
// const res = await exa.search({
// query: 'OpenAI',
// contents: { text: true }
// })
// console.log(JSON.stringify(res, null, 2))
2024-06-04 23:59:44 +00:00
// const diffbot = new DiffbotClient()
// // const res = await diffbot.analyzeUrl({
// // url: 'https://www.bbc.com/news/articles/cp4475gwny1o'
// // })
// const res = await diffbot.enhanceEntity({
// type: 'Person',
// name: 'Kevin Raheja'
// })
// console.log(JSON.stringify(res, null, 2))
const wolfram = new WolframClient()
2024-06-03 08:46:05 +00:00
// const res = await diffbot.analyzeUrl({
// url: 'https://www.bbc.com/news/articles/cp4475gwny1o'
// })
2024-06-04 23:59:44 +00:00
const res = await wolfram.ask({
input: 'population of new york city'
2024-06-03 06:19:10 +00:00
})
2024-06-04 23:59:44 +00:00
console.log(res)
2024-05-21 13:52:06 +00:00
}
try {
await main()
} catch (err) {
2024-06-03 06:19:10 +00:00
console.error('error', err)
2024-06-03 05:03:01 +00:00
process.exit(1)
2024-05-21 13:52:06 +00:00
}