/ai_chat

Primary LanguageHTMLMIT LicenseMIT

ai_chat

You can have a conversation with a computer on your terminal.

Usage

create a secret key on OpenAI API

edit .env

OPENAI_API_KEY=****

or set the environment variables

export OPENAI_API_KEY=****

as a server and web app

deno run -A aichat.js

as an API

in Deno

import { fetchChat } from "https://code4fukui.github.io/ai_chat/fetchChat.js"
console.log(await fetchChat("How about you?"));

as a command

deno run -A https://code4fukui.github.io/ai_chat/ai.js "Who are you?"

you can get the response

Robot: I'm a robot.

blog