OmniAssist

A comprehensive collection of AI-powered tools for automating your workflow

Watch the demo above to see the AI Tools Suite in action. Discover how these powerful tools can transform your workflow and boost productivity.

Project Overview

The AI Tools Suite is an integrated collection of AI-powered tools designed to automate various tasks using OpenAI's models, LangChain, and other powerful APIs. This project combines multiple functionalities into a single interface, allowing users to perform complex tasks with simple commands.

📝

Content Generation

Automatically create notes from videos, generate code, and more.

🔍

Information Retrieval

Aggregate news articles and access internet information.

🎨

Design to Code

Convert Figma designs into functional HTML/CSS code.

📧

Communication

Send emails with PDF attachments directly from the application.

Tool Components

1. Video to Notes Converter

This tool extracts audio from video files, transcribes it using OpenAI's Whisper model, and generates detailed notes from the transcript using GPT-4o-mini.

Code Snippet:

def video_to_notes(video_path):
    # Extract audio from video
    def extract_audio(video_path, audio_path):
        video = VideoFileClip(video_path)
        video.audio.write_audiofile(audio_path)

    audio_path = "output_audio.wav"
    extract_audio(video_path, audio_path)

    # Transcribe audio chunks
    def transcribe_audio_chunk(audio_chunk, chunk_number):
        chunk_path = f"chunk{chunk_number}.wav"
        audio_chunk.export(chunk_path, format="wav")
        with open(chunk_path, 'rb') as audio_file:
            response = openai.Audio.transcribe("whisper-1", audio_file)
        os.remove(chunk_path)  # Clean up the chunk file after transcribing
        return response['text']

    # Generate notes from transcribed text
    def generate_notes(text, temperature=0.5):
        response = openai.ChatCompletion.create(
            model="gpt-4o-mini",
            messages=[
                {"role": "system", "content": "You are a helpful assistant."},
                {"role": "user", "content": f"Create detailed notes from the following text: {text}"}
            ],
            temperature=temperature
        )
        return response.choices[0].message['content']

    notes = generate_notes(transcript)
    return notes

This component works by:

  1. Extracting audio from the video file using MoviePy
  2. Breaking the audio into smaller chunks for better processing
  3. Transcribing each chunk using OpenAI's Whisper model
  4. Generating comprehensive notes from the transcript with GPT-4o-mini

Use Cases:

  • Converting lecture videos into study notes
  • Extracting key points from conference presentations
  • Creating meeting minutes from recorded sessions
  • Transcribing and summarizing interviews

2. News Aggregator

This tool extracts keywords from user queries, fetches relevant news articles using the News API, and processes the content to provide concise answers.

Code Snippet:

def news_aggregator(question):
    def extract_keywords(query):
        vectorizer = CountVectorizer(stop_words='english')
        X = vectorizer.fit_transform([query])
        return vectorizer.get_feature_names_out()

    def fetch_news(keywords, language='en', limit=3):
        base_url = 'https://api.thenewsapi.com/v1/news/all'
        query = ' '.join(keywords)  # Join keywords to form a search query
        params = {
            'api_token': NEWS_API_KEY,
            'language': language,
            'limit': limit,
            'search': query
        }
        response = requests.get(base_url, params=params)
        if response.status_code == 200:
            return response.json().get('data', [])
        else:
            print(f"Error: {response.status_code}")
            return []

    # Generate response using the LLM
    return generate_llm_response(question, article_contents)

This component operates by:

  1. Analyzing the user's question with NLP techniques to extract important keywords
  2. Using these keywords to search for relevant news articles
  3. Scraping and processing the content of these articles
  4. Generating a concise answer to the original question based on the collected information

Use Cases:

  • Researching current events and trending topics
  • Gathering information for reports and presentations
  • Staying updated on specific industries or technologies
  • Monitoring news related to competitors or market trends

3. Figma to HTML/CSS Converter

This tool connects to the Figma API, extracts design elements from a specified file, and generates corresponding HTML and CSS code.

Code Snippet:

def figma_to_html_css(figma_file_id):
    def fetch_figma_design(figma_file_id):
        headers = {'X-Figma-Token': FIGMA_API_KEY}
        url = f'https://api.figma.com/v1/files/{figma_file_id}'
        response = requests.get(url, headers=headers)
        if response.status_code == 200:
            return response.json()
        else:
            raise Exception(f"Failed to fetch data: {response.status_code}")

    def extract_design_elements(design_data):
        elements = []
        for page in design_data['document']['children']:
            for frame in page['children']:
                element = {
                    'name': frame['name'],
                    'width': frame['absoluteBoundingBox']['width'],
                    'height': frame['absoluteBoundingBox']['height'],
                    'color': frame.get('backgroundColor', {}),
                    'font': frame.get('style', {}).get('fontFamily'),
                    'font_size': frame.get('style', {}).get('fontSize'),
                }
                elements.append(element)
        return elements

    def generate_code_from_design(design_element):
        prompt = f"""
        Convert the following design element into HTML and CSS:
        Name: {design_element['name']}
        Width: {design_element['width']}px
        Height: {design_element['height']}px
        Background Color: {design_element['color']}
        Font: {design_element['font']}
        Font Size: {design_element['font_size']}px
        """
        response = openai.ChatCompletion.create(
            model="gpt-4o-mini",
            messages=[
                {"role": "system", "content": "You are a helpful assistant."},
                {"role": "user", "content": prompt}
            ]
        )
        return response.choices[0].message['content'].strip()

This component works by:

  1. Accessing the Figma API with your authentication token
  2. Retrieving design data for the specified file
  3. Extracting key design elements like dimensions, colors, and typography
  4. Using GPT-4o-mini to generate corresponding HTML and CSS code
  5. Saving the generated code to files for immediate use

Use Cases:

  • Accelerating the design-to-development workflow
  • Prototyping web interfaces from design mockups
  • Learning HTML/CSS by seeing code generated from visual designs
  • Creating quick landing pages based on design comps

4. Python Code Generator

This tool uses GPT-4o-mini to generate Python code based on natural language descriptions of the desired functionality.

Code Snippet:

def generate_code(prompt):
    """
    Generates Python code based on the given prompt using GPT-4o-mini.

    Parameters:
    prompt (str): The prompt describing the task or code to be generated.

    Returns:
    str: The generated Python code as a string.
    """
    try:
        response = openai.ChatCompletion.create(
            model="gpt-4o-mini",
            messages=[
                {"role": "system", "content": "You are a helpful assistant."},
                {"role": "user", "content": prompt}
            ]
        )
        generated_code = response.choices[0].message['content'].strip()
        if generated_code:
            # Optionally, save the generated code to a file
            save_option = input("\nDo you want to save the generated code to a file? (y/n): ").lower()
            if save_option == "y":
                file_name = input("Enter the file name (e.g., generated_code.py): ")
                with open(file_name, "w") as file:
                    file.write(generated_code)
                print(f"Code saved to {file_name}")

        return generated_code
    except Exception as e:
        return f"Error generating code: {str(e)}"

This component operates by:

  1. Taking a natural language description of the desired code
  2. Sending this prompt to OpenAI's GPT-4o-mini model
  3. Receiving the generated Python code
  4. Optionally saving the code to a file for immediate use

Use Cases:

  • Quickly prototyping functions or scripts
  • Learning programming concepts through generated examples
  • Automating repetitive coding tasks
  • Helping non-programmers create simple scripts

5. Email with PDF Attachment Tool

This tool creates PDF documents from text content and sends them as email attachments to specified recipients.

Code Snippet:

def send_email_with_pdf(subject, body, recipients, text_for_pdf):
    pdf_filename = "attachment.pdf"
    create_pdf(text_for_pdf, pdf_filename)

    msg = MIMEMultipart()
    msg['From'] = EMAIL_ADDRESS
    msg['Subject'] = subject
    msg.attach(MIMEText(body, 'plain'))

    with open(pdf_filename, "rb") as attachment:
        part = MIMEBase('application', 'octet-stream')
        part.set_payload(attachment.read())
        encoders.encode_base64(part)
        part.add_header('Content-Disposition', f"attachment; filename={pdf_filename}")
        msg.attach(part)

    try:
        server = smtplib.SMTP('smtp.hostinger.com', 587)
        server.starttls()
        server.login(EMAIL_ADDRESS, EMAIL_PASSWORD)

        for recipient in recipients:
            msg['To'] = recipient
            text = msg.as_string()
            server.sendmail(EMAIL_ADDRESS, recipient, text)

        server.quit()
        os.remove(pdf_filename)  # Clean up the PDF file
        return "Email sent successfully!"
    except Exception as e:
        return f"Failed to send email: {e}"

This component works by:

  1. Converting provided text into a formatted PDF document
  2. Constructing an email with the generated PDF as an attachment
  3. Connecting to an SMTP server and authenticating
  4. Sending the email to specified recipients
  5. Cleaning up temporary files after sending

Use Cases:

  • Sending automated reports to clients or team members
  • Distributing generated content in a professional format
  • Creating and sending documentation or guides
  • Automating email-based workflows that require attachments

6. Internet Access Tool

This tool leverages LangChain and SerpAPI to retrieve and process information from the internet based on user queries.

Code Snippet:

def internet_access_tool_function(query):
    """
    Function to run the agent with the provided query.

    Parameters:
    query (str): The input query for the agent.

    Returns:
    str: The response from the agent.
    """
    return agent.run(query)

# Initialize the agent
tools = load_tools(["serpapi", "llm-math"], llm=llm_i) + [
    save_to_directory_tool, video_to_notes_tool, news_aggregator_tool,
    figma_to_html_css_tool, generate_code_tool, email_tool
]

agent = initialize_agent(tools, llm_i, agent="zero-shot-react-description", verbose=True)

This component operates by:

  1. Taking a user query about information needed from the internet
  2. Using LangChain's agent framework to determine the best approach
  3. Leveraging SerpAPI to perform search queries
  4. Processing and formatting the retrieved information
  5. Returning a concise and relevant response

Use Cases:

  • Researching topics without leaving the application
  • Gathering data for reports or analysis
  • Answering factual questions based on current internet information
  • Automating information retrieval tasks

Future Use Cases & Expansion

The AI Tools Suite has significant potential for expansion and advanced use cases:

Integration with Workflows

The modular nature of this suite allows for easy integration with existing workflows and systems:

Advanced Features

Future versions could include:

Industry-Specific Applications

The AI Tools Suite can be tailored to specific industries:

-->