@emergentmethods/asknews-typescript-sdk
v0.2.21
Published
Typescript SDK for AskNews API
Downloads
2,172
Readme
@emergentmethods/[email protected]
Typescript SDK for the AskNews API. This SDK utilizes Fetch API. The generated Node module can be used in the following environments:
Environment
- Node.js
- Webpack
- Browserify
Language level
- ES5 - you must have a Promises/A+ library installed
- ES6
Module system
- CommonJS
- ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via package.json
. (Reference)
Installation
npm install @emergentmethods/[email protected] --save
Usage
import { AskNewsSDK } from "@emergentmethods/asknews-typescript-sdk";
const ask = new AskNewsSDK({
clientId: "YOUR-CLIENT-ID",
clientSecret: "YOUR-CLIENT-SECRET",
scopes: ["news"],
});
// prompt-optimized string ready to go for any LLM:
const newsContext = (
await ask.news.searchNews({
query: "Effect of fed policy on tech sector",
returnType: "string",
})
).asString;
console.log(newsContext);
And you will have a prompt-optimized string ready to go for any LLM.
Find full details at the AskNews API documentation.
Support
Join our Discord to see what other people are building, and to get support with your projects.