Git Product home page Git Product logo

garussell / aiartistassist Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 2.13 MB

This project uses OpenAI to furnish some ideas and an image for getting started on user's next creative project. For example, if you want to learn to paint this app will give you ideas and resources on what to do next as well as provide an image to associate with that particular idea.

Home Page: https://www.loom.com/share/2a21a2152b024118bf7d3df30188410d

Ruby 71.84% JavaScript 1.98% CSS 2.67% HTML 23.51%
monolyth motivational-messages openai-api

aiartistassist's Introduction

Artist Assist

UI Video Walkthrough

Overview

The Artist Prompts API is a Rails application that leverages OpenAI's GPT-3.5 Turbo model to generate prompts and suggestions for artists. It allows artists to receive personalized recommendations for their goals, action steps, and resources based on their input.

Features

  • Generate Artist Prompts: Utilize the OpenAI GPT-3.5 Turbo model to generate prompts for artists based on their specified goals.
  • Save Prompts to Database: Save the generated prompts, along with associated information, to the database for future reference.
  • Handle Errors Gracefully: Implement error handling to gracefully manage scenarios such as artist not found, invalid parameters, and other potential issues.

Getting Started

Prerequisites

  • Ruby 3.2.2
  • Rails 7.0.8
  • OpenAI API Key: Obtain an API key from OpenAI to enable communication with the GPT-3.5 Turbo model, or GPT-4 model.

Installation

  1. Clone the repository:

[email protected]:garussell/artist_assist.git

  1. Install dependencies:

bundle install

  1. Setup database:

rails db:create rails db:migrate

  1. Configure OpenAi API Key:

$ EDITOR="code --wait" rails credentials:edit

open_ai: api_key: your_openai_api_key

  • Save by closing the credentials.yml file

Usage

  1. Start the Rails server:

rails server

  1. Make API requests to /api/v1/:id/post_idea
  • Artist ID is part of the URL
  • The prompt is passed into the body of the request (see endpoints)

Endpoints

POST /api/v1/post_idea

  • Generate a prompt from OpenAI based on the artist's specified goals:

Request Body:

  {
    "goals": "I want to learn to play the drums"
  }

Response

  1. Status Code: 200
  • Body:
  {
    "data": {
        "id": null,
        "type": "response",
        "attributes": {
            "id": null,
            "action_steps": "Stuf about drumming:,
            "resources": "Resources with links",
            "goals": "I want to learn to play the drums",
            "image_url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-DUWm0ko8w9epxLgtftuHr2ZP/user-C3kDGpQ319mqmHmO4pjG7bKq/img-7aiQAzBdz1lPJJN2adBKBMSg.png?st=2023-11-20T19%3A35%3A08Z&se=2023-11-20T21%3A35%3A08Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-20T20%3A28%3A47Z&ske=2023-11-21T20%3A28%3A47Z&sks=b&skv=2021-08-06&sig=Qk6szB/AlQ7eUIZnuO4Fdbh0YVl5%2BFluLWuUGJ87Crs%3D"
        }
    }
}
  1. Status Code: 404 :not_found
  • If the artist does not exist:
  {
    "error": "Artist not found"
  }
  1. Status Code: 422 :unprocessable_enity
  • If "goals" were left blank
  {
    "error": "You must provide your creative goals."
  }

Future Iterations / In progress

  1. CRUD functionality for Artist
  2. Authentication for Artist
  3. User Interface

Contributing

If you'd like to contribute to the project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/your-feature
  3. Makes changes and commit: git commit -m "Add your feature"
  4. Push to the branch: git push origin feature/your-feature
  5. Open a pull request

Created by:

  • Allen Russell
    • GitHub: @garussell
    • LinkedIn: @garyallenrusselljr

aiartistassist's People

Contributors

garussell avatar

Stargazers

 avatar  avatar

Watchers

 avatar

aiartistassist's Issues

ActionCable-WebSocket-OpenAi-ChatBot-Service

This is going to happen!

Build the back end first, then separate issues for front-end integration.

(this is also where it starts to make sense to separate the back-end with AI services and deploy them separately (on the cloud), as well as utilize Docker / then build the front-ent using a framework)

AI Prompt Config

The AI prompt has some edge case issues. There is a strange default photo generation which makes me treat it like an error message. It would make more sense to parse out a few different prompts for the user and pass those in as params to limit the "open ended" responses and AI confusion.

"Style" alone might not be the best input prompt for the photo. The goal is to align them with the user's "goals" and "style" together.

Add Artist Files to Artist's show page

  1. there should be a form where artist can add their "goals" and this will hit OpenAI
  2. once the response is saved as an 'artist_file', it will be displayed on the Artist's show page and they will have CRUD

Refactor: Artisan

'Artist' seems to be specific to 'painting'.

I want to change some names in this project.

  1. Artist table to 'Artisan'
  • revisit column names
  • add a reference to the table for 'notes' - has_many
  1. ArtistFiles to ArtisanFiles (or Artison#{...})
  2. Create a new table (see issue for 'notes' table)

Save and fetch new Photo

It seems the photo url provided by OpenAI is temporary, so this is a good place to implement photo storage on the cloud. I also want to add the option to retrieve a new photo.

  • AWS
  • ActiveStorage

scalability

-Google Cloud for file storage
-containerization / horizontal scaling using Docker
-CI/CD pipelines implementation
-optimize API call to OpenAI
-deployment to heroku
-load testing with Locust

Formatting Ideas

  • Artist file can be like a card deck that you can "slide" through
  • Look at bootstrap options
  • Make sure class and id tags are clearly named and setup stylesheet

(for this project is probably better to stick with vanilla JS - a refactor for later could be to expose the backend API with GraphQL and use React to manage the front end)

notes table

  • consider adding a table for notes that can be associated with the artist (artist has many notes) and provide a template (form) for the artist to add notes / journal entries to their profile.

test-coverage

address coverage issue that happened after adding JS event listener re: password fields.

Feature: options for AI prompt

  • select different skill level
  1. option to edit any response bullet point
  2. option to 'refresh' same prompt (caching)
  3. option to refresh the photo

** the artist's "style" field might benefit for some edge case issues. If user puts in something random the response will be a bit wonky vs. if they put in "Jazz" and their goal was to "improve jazz drumming" - because of the consistency, the responses are much high quality

navbar-styling

Navbar styling does not match so need to apply css to navbar

Update Artist Form

Updating a for should require a password, and to update a password needs to be separate function.

artist_files_crud

  1. Complete crud functionality for artist_files
  2. Artist files include the API call to OpenAI

home page

Right now the root path is a partial that renders login or logout depending on session. That is fine, but it could be enhanced with a few ideas:

  • Incorporate login to a chatbot (when implemented)
  • Artwork of photo with a logo and/or description
  • footer tabs with contact info, links, readme, etc

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.