Skip to content

Latest commit

 

History

History
83 lines (49 loc) · 2.89 KB

File metadata and controls

83 lines (49 loc) · 2.89 KB

GitHub Copilot Extension - Documentation Provider

This service operates as middleware between Notion documentation and GitHub Copilot's AI assistant, enabling the following functions:

  • Fetching documentation from Notion.
  • Identifying the requesting GitHub user.
  • Crafting a tailored system prompt.
  • Communicating with the GitHub Copilot API to generate responses.
  • Streaming AI-generated responses back to the client.

This configuration provides users with personalized assistance, harnessing both internal documentation and sophisticated AI capabilities.

Built on Express for efficient HTTP handling, it utilizes the Octokit library to seamlessly interact with the GitHub API and is set up for deployment on Vercel.

Dependencies

  • @octokit/core: A lightweight GitHub API client for Node.js, used for interacting with GitHub's API to authenticate users and retrieve user information.

  • Readable: A built-in Node.js stream interface for reading data, used in this service for efficiently streaming AI-generated responses back to the client.

  • express: A fast, unopinionated, minimalist web framework for Node.js, used for creating the server and handling HTTP requests and responses.

  • axios: A promise-based HTTP client for making requests to external APIs, used for communicating with the Notion API and GitHub Copilot API.

  • dotenv: A zero-dependency module that loads environment variables from a .env file into process.env, used for managing configuration settings securely.

Installation

  1. Clone the repository:

    git clone <repository-url>
  2. Navigate to the project directory:

    cd notion-documentation-provider
  3. Install the dependencies:

    npm install

Configuration

Create a .env file in the root directory and add the following environment variables:

PORT=3000

Usage

Start the server:

npm start

The server will be running on the port specified in the .env file (default is 3000).

Deployment

This application is configured to be deployed on Vercel. The configuration is specified in the vercel.json file.

Creating a GitHub App

Follow the step-by-step provided by Github:

Using the GitHub Copilot Extension

License

This project is licensed under the ISC License. Feel free to customize this README further based on your specific needs.