0.1.0 • Published 3 years ago

@hikae/gpt v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

gpt

OpenAI API made easy !! now deno support !

https://beta.openai.com/docs

install

yarn add @hikae/gpt

example

import { App, openai } from "@hikae/gpt";

require("dotenv").config();

async function main() {
    const key = process.env.OPENAI_API_KEY;
    if (!key) {
        throw new Error("[OPENAI_API_KEY] not found");
    }

    const app: App = openai.app(key);
    const result = await openai.classification({
        examples: [
            ["幸せ", "Positive"],
            ["私は悲しい、、", "Negative"],
            ["最高の気分だ!", "Positive"],
        ],
        labels: ["Positive", "Negative", "Neutral"],
        query: "今日は晴れの日だ",
        search_model: "ada",
        model: "ada",
    })(app);

    console.log(result.label);
    // result = 'Positive'
}
main();

deno

  • skypack
import { openai } from 'https://cdn.skypack.dev/@hikae/gpt?dts'
  • esm.sh
import { openai } from 'https://esm.sh/@hikae/gpt?bundle'
0.0.10

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago