Coder Social home page Coder Social logo

gptsanoekakidesuyo's Introduction

GPTさんお絵かきですよ

OpenAI Chat(gpt3.5)に対して「0と1で構成された32*32の文字列 0は白、1は黒」というルールでプロンプトを発行し、描かれた絵を言い当てることができるかを試すゲーム

demo.git


期待できる活用方法

OpenAI APIをターゲットに、リクエストを送信するためのProxyサーバーとして機能するサービスである。
本プロジェクトをベースとして用いることで、以下の機能を実現することが可能になる。

  • ユーザーインターフェイスが自由に選択可能。(例えば、本プロジェクトフロントエンドのお絵かき画面、Slack、Line)
  • ユーザーのやり取りを保持・分析が可能。
  • 機密情報などの送信を防ぐためのマスク処理機能を持たせることが可能。

設定方法

Frontend (vue-cli/Vite)

  • (初回のみ)/frontend-vue3ディレクトリ内で、npm ciを実行
  • npm run devを実行

Frontend (SDKバージョン)

  • npm i -g http-server を実行してhttp-serverをインストール。
  • /frontend ディレクトリ内で http-server を実行。

Backend

  • Docker Desktop をインストール。
  • /backend ディレクトリ内で docker compose up -d を実行。
  • (初回のみ)/backend/server/.env.exampleから.envをコピー。
  • (初回のみ)/backend/server/.env内部に適切なクレデンシャル情報を入力する。
  • (初回のみ)docker exec -it server sh でコンテナ内に入る。
  • (初回のみ)データベースセットアップのため、npx prisma migrate npx prisma generate dev npm run seed を実行。
  • OpenAI Chat のシステム設定を変更したい場合は、/backend/server/.env ファイルの OPENAI_CHAT_SYSTEM_MESSAGE を変更する。

Frontend Disign (frontend-vue3)

コンポーネント

コンポーネント分割 概要


Database Design

ER図

データベース ER図


Backend Design

API概要

API名 概要
HealthCheck API状態確認用エンドポイント(兼マルチプロセス検証用)
Themes 出題されるお題に関するAPI
Sessions 過去のゲーム一覧に関するAPI
Session 一回のゲームに関するAPI

エンドポイント一覧

HealthCheck

エンドポイント リクエストタイプ パラメーター レスポンス
/ GET - "OK"
/fibonacci/:n GET - "{
"result": number
}"
エンドポイント リクエストタイプ パラメーター レスポンス
/sessions GET - {
"sessions": {
"id": number,
"name": string,
"created_at": Date,
"updated_at": Date | null
} []
}

Sessions

エンドポイント リクエストタイプ パラメーター レスポンス
/sessions GET - {
"sessions": {
"id": number,
"name": string,
"created_at": Date,
"updated_at": Date | null
} []
}

Session

エンドポイント リクエストタイプ パラメーター レスポンス
/session/:id GET PathParam=id {
"session": {
"id": number,
"name": string,
"messages": {
"id": number,
"message": string,
},
"created_at": Date,
"updated_at": Date | null
}
}
/session POST {
"id": number | undefined,
"message": string
}
{
"session": {
"id": number,
"name": string,
"response": string,
}
}

Themes

エンドポイント リクエストタイプ パラメーター レスポンス
/themes GET - {
"getThemes" : [
"id": number,
"theme": string,
"created_at": Date,
"updated_at": Date,
]
}

GetSessions

GetSessions シーケンス図


GetSession

GetSession シーケンス図


PostSession

PostSession シーケンス図


GetTheme

GetTheme シーケンス図

gptsanoekakidesuyo's People

Contributors

yamd1 avatar

Watchers

 avatar

gptsanoekakidesuyo's Issues

バックエンド|ベース

  • Application Server Container
    • TsED
    • Prisma
    • ajv
    • Logger(本バージョンでは作成しない)
  • DB Server Container
    • MySQL

Epic|v0.2.0

■ 概要

  • Frontend実装|プロジェクトベース構築
  • Frontend実装|AtomicDesignベース構築
  • Frontend実装|詳細実装

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.