Giter VIP home page Giter VIP logo

gpt-cli's Introduction

YouTube Video Analysis and Chat CLI Tool

Table of Contents

Overview

This CLI tool is a TypeScript application that leverages the OpenAI API, HNSWLib, and Langchain to analyze YouTube videos and engage in an AI-driven conversation based on the video's content. Aimed at TypeScript engineers, this README provides an exhaustive guide for understanding, installing, and using this tool.

Application Functionality

  • Prompt for YouTube URL: Asks the user for a YouTube video URL with a default option.
  • Transcript Download: Downloads the transcript of the given YouTube video and splits it into documents.
  • OpenAI Embeddings: Utilizes OpenAI embeddings to create vector embeddings for the downloaded documents.
  • Local Vector Store: Utilizes the HNSWLib library to store embeddings in a local vector store on the filesystem.
  • AI-Driven Chat: Uses the Langchain library to build a chat interface that uses the embeddings as context.
  • Summary Display: Evaluates and displays a summary of the video based on its transcripts.
  • Interactive Q&A: Allows the user to ask follow-up questions, which are answered using the embeddings until the user types "exit".

Screenshot

Screen

Installation

To install the CLI tool, you need to have Node.js and npm installed on your system. Then run:

# Clone the repository
git clone https://github.com/djheru/gpt-cli.git

# Navigate into the directory
cd gpt-cli

# Install dependencies
npm install

Usage

To execute the application, run:

npm run youtube

Follow the on-screen prompts to input a YouTube URL (or use the default) and engage in a conversation based on the video's content.

Codebase

Dependencies

Here are the main libraries and their roles in this project as per package.json:

  • openai: For generating embeddings and AI-related functionalities.
  • hnswlib: Used for efficient similarity search and storage of embeddings.
  • langchain: For building the chat interface.

File Structure

  • index.ts: Entry point for the application.
  • youtube.ts: Contains the logic for handling YouTube video analysis and chat.
  • utils.ts: Utility functions used across the project.
// File: index.ts
// Entry point for the CLI application

// File: youtube.ts
// Main logic for YouTube video analysis and chat functionality

// File: utils.ts
// Contains utility functions for embedding creation, summary, etc.

Contributing

If you're interested in contributing, please follow the standard fork, feature-branch, pull request workflow.

  1. Fork the repository.
  2. Create a new feature branch.
  3. Make your changes.
  4. Create a pull request.

License

This project is licensed under the MIT License.


This README aims to be a thorough guide for TypeScript engineers looking to understand and contribute to this tool. Feel free to submit issues or pull requests to improve it.

gpt-cli's People

Contributors

pdamra avatar

Watchers

Philip Damra avatar  avatar

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.