/fourier

Interface and interact with Anthropic/OpenAI API:s in a universal way

Primary LanguageTypeScriptMIT LicenseMIT

fourier

To install dependencies:

bun install

Prompt the API

Example:

const model = new Fourier({ model: "gpt-3.5-turbo" });
const prompt = "Tell me a fun fact about Fourier!";

const res = await model.call(prompt)

Stream the response

Example:

const queue = []
const model = new Fourier({ model: "gpt-3.5-turbo" });
const prompt = "Tell me a fun fact about Fourier!";

for await (const delta of model.stream(prompt)) {
    queue.push(delta)
}