Giter Site home page Giter Site logo

stream-gal's Introduction

すとり〜むぎゃる

これは、OpenAIの技術に触れるためにテスト用に開発したAIチャットボットです。

https://stream-gal.vercel.app/

なぜ すとりーむ なのか?

API 呼び出しで返却される値の全ての結果がそろうのを待つのではなく、

ストリーム形式で利用可能になったものから返却される細かい値をリアルタイムで表示できるようにしている。

詳しくはこちら

はじめに

まずプロジェクトをクローンします。

git clone https://github.com/Yohei-Shiina/stream-gal.git

ルートディレクトリに .env ファイルを作成し、環境変数 OPENAI_API_KEY を以下のように追加します。

OPENAI_APY_KEY=<Your OpenAI API key here>

まだ持っていない場合は、ここで OpenAI の API key を生成できます。

開発サーバーを起動します:

npm run dev
# または
yarn dev
# または
pnpm dev

ブラウザで http://localhost:3000 を開いて結果を確認します。

pages/index.tsxpages/api/stream-chat.tsxを編集することでページを編集できます。ファイルを編集するとページが自動更新されます。

リポジトリで使用している OpenAI API については、以下のリソースをご覧ください:

このプロジェクトでは以下のものを使用しています:

Next.js React Typescript

Vercel にデプロイしています。

Stream Gal

This is an AI chatbot that I developed for testing to get in touch with OpenAI’s technology.

https://stream-gal.vercel.app/

Why stream?

Because it calls the api and receives the result in a stream format instead of waiting for the completion, so the users can see the AI's response in real time.

Getting Started

First, create a .env file in the root directory and add the environment variable OPENAI_API_KEY as follows.

OPENAI_APY_KEY=<Your OpenAI API key here>

You can generate your OpenAI API key here in case you don't have one yet.

Run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx or pages/api/stream-chat.tsx . The page auto-updates as you edit the file.

To learn more about OpenAI API, take a look at the following respirces:

This project uses the following :

  • Next.js
  • React
  • Typescript

Deployed on Vercel

stream-gal's People

Contributors

yohei-shiina avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.