Files

AI Creative Studio

Project Overview

AI Creative Studio is a web-based application built with Gradio that allows users to generate and refine high-quality written content in real time using OpenAI language models. It is designed as a flexible creative tool for content creation tasks such as writing brochures, blog posts, product comparisons, and brainstorming ideas. The application also supports interactive refinement, enabling users to improve or adapt existing text based on specific instructions.

The core idea is to combine the power of OpenAI models with an intuitive, user-friendly interface that streams responses as they are generated. This provides a fast, engaging, and highly interactive writing experience without waiting for the entire response to complete before it appears.


Whats Happening in the Project

  1. Environment Setup and Model Initialization

    • The application loads the OpenAI API key from a .env file and initializes the OpenAI client for model interactions.
    • Supported models include gpt-4o-mini, gpt-3.5-turbo, and gpt-4, which the user can select from a dropdown menu.
  2. Prompt Construction and Content Generation

    • The build_prompt function constructs a task-specific prompt based on the users choices: content type (brochure, blog post, etc.), topic, tone, and target audience.
    • Once the user provides the inputs and selects a model, the application sends the prompt to the model.
    • The models response is streamed back incrementally, showing text chunk by chunk for a real-time generation experience.
  3. Content Refinement Feature

    • Users can paste existing text and provide a refinement instruction (e.g., “make it more persuasive” or “summarize it”).
    • The application then streams an improved version of the text, following the instruction, allowing users to iterate and polish content efficiently.
  4. Gradio User Interface

    • The app is built using Gradio Blocks, providing an organized and interactive layout.
    • Key UI elements include:
      • Task selection dropdown for choosing the type of content.
      • Text inputs for topic, tone, and target audience.
      • Model selection dropdown for choosing a specific OpenAI model.
      • Real-time markdown display of generated content.
      • A refinement panel for improving existing text.
  5. Streaming Workflow

    • Both generation and refinement use OpenAIs streaming API to display the models response as its produced.
    • This provides an immediate and responsive user experience, allowing users to see results build up in real time rather than waiting for the entire completion.

Key Features

  • Real-time streaming responses for fast and interactive content creation.
  • Multiple content generation modes: brochure, blog post, product comparison, and idea brainstorming.
  • Customization options for tone and audience to tailor the writing style.
  • Interactive refinement tool to enhance or transform existing text.
  • Clean and intuitive web interface powered by Gradio.

AI Creative Studio demonstrates how large language models can be integrated into user-facing applications to support creative workflows and improve productivity in content generation and editing.