Skip to content

OpenAI Assistants API Interface, can use custom functions to perform actions on private networks.

License

Notifications You must be signed in to change notification settings

IsJustJason/openai-assistants-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI Assistant Interface

This project is a web-based chat interface that allows users to interact with OpenAI's assistant API. It features a modern, responsive UI and includes functionalities like function calling, creating new chat threads, sending messages, and displaying AI responses. It was created to put the assistant function calling into practice and to provide a simple interface for users to interact with the API.

openai-assistants-ui.mp4

Features

  • Function calling.
  • Create new chat threads.
  • Send messages and receive assistant responses.
  • Display conversation history.
  • Modern and responsive user interface.

TODO/Wishlist

  • Asssitants picker
  • Thread viewer/save with summary title
  • File attachment to assistant
  • Function calls get displayed in chat history
  • Potential confirmation from user when running functions
  • Secrets functionality for better authenication
  • Microphone voice input(Work in Progress)
  • Voice playback

Technology Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Python Flask
  • API: OpenAI's Assistant API

Getting Started

Prerequisites

  • Python 3
  • Flask
  • Paramiko
  • OpenAI API key

Installation

Note

The current repo contains a function that runs a command on a remote device. Your assistant must have this function in order for it to use it. The username and password environment vars are also needed only if you intend to use this function.

  1. Clone the Repository

    git clone https://github.com/IsJustJason/openai-assistants-ui.git
    cd openai-assistants-ui
    
  2. Set Up a Virtual Environment (Optional but recommended)

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    
  3. Install Dependencies

    pip install Flask openai paramiko
    
  4. Set Up Environment Variables

    export OPENAI_API_KEY=your_api_key_here
    
    export OPENAI_ASSISTANT_ID=your_assistant_id_here
    
    export USERNAME_ENV_VAR=your_username_here
    
    export PASSWORD_ENV_VAR=your_password_here
    
  5. Setup Assistant and Functions

    Build your assistant on the OpenAI website https://platform.openai.com/assistants

    Add Functions to it and then update the switch case in app.py to include your functions.

  6. Run the Application

    python app.py
    

Usage

Enter your prompt to your assistant and hit enter or click Send button.

Your prompt will be sent to the AI and the AI's response will be displayed in the chat history.

Any functions that are called will be ran and the AI response will be displayed in the chat history.

Click the "New Chat" button to start a new chat thread and wipe history.

Any errors or logs will be displayed in the browser console or field at the bottom of the page.

Contributing

Contributions to this project are welcome! Please fork the repository and submit a pull request with your changes.

License

This project is licensed under the MIT License.

Acknowledgments

OpenAI for providing the Assistants API. All contributors who participate in this project.

About

OpenAI Assistants API Interface, can use custom functions to perform actions on private networks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published