Skip to content

Latest commit

 

History

History
155 lines (116 loc) · 4.13 KB

File metadata and controls

155 lines (116 loc) · 4.13 KB

Example Usage Guide

This document provides examples of how to use the FAQ Generator application.

Prerequisites

Before using the FAQ Generator, ensure you have:

  1. GitHub CLI installed and authenticated (gh auth login)
  2. GitHub Copilot CLI extension installed (npm install -g @github/copilot)
  3. Active GitHub Copilot subscription

Starting the Server

Development Mode (with hot-reload)

npm run dev

Production Mode

npm run build
npm start

The server will start at http://localhost:3000

Usage Examples

1. Generate FAQ from URL

Example URLs to try:

Steps:

  1. Open http://localhost:3000
  2. Click the "From URL" tab (default)
  3. Enter a webpage URL
  4. Click "Generate FAQ from URL"
  5. Wait for the AI to analyze the content and generate FAQs

2. Generate FAQ from Excel File

Excel file formats supported:

  • .xlsx (Excel 2007+)
  • .xls (Excel 97-2003)

Example scenarios:

  • Upload an Excel file with existing FAQ data (columns: Question, Answer) to format and enhance it
  • Upload any data spreadsheet to generate FAQs about the data

Steps:

  1. Click the "From Excel" tab
  2. Click "Choose File" and select your Excel file
  3. Click "Generate FAQ from Excel"
  4. The AI will either format existing FAQs or create new ones based on the data

3. Generate FAQ from Image

Image formats supported:

  • .jpg / .jpeg
  • .png
  • .gif
  • .bmp

Example scenarios:

  • Screenshot of a product page
  • Diagram or flowchart
  • Photo of a document
  • Chart or graph

Steps:

  1. Click the "From Image" tab
  2. Click "Choose File" and select your image
  3. Click "Generate FAQ from Image"
  4. The AI will analyze the image content and generate relevant FAQs

Sample FAQ Output Format

The generated FAQs will be formatted like this:

Q: What is GitHub Copilot SDK?
A: GitHub Copilot SDK is a toolkit that allows developers to integrate GitHub Copilot's AI capabilities into their own applications...

Q: How do I install the SDK?
A: You can install the SDK using npm: npm install @github/copilot-sdk...

Q: What programming languages are supported?
A: The SDK supports TypeScript, JavaScript, Python, Go, and .NET...

Troubleshooting

Error: "Could not process URL"

  • Check that the URL is valid and accessible
  • Ensure the website doesn't block automated access
  • Try a different webpage

Error: "Could not process Excel file"

  • Verify the file is a valid Excel format (.xlsx or .xls)
  • Check that the file size is under 10MB
  • Ensure the spreadsheet contains readable data

Error: "Could not process image"

  • Verify the image format is supported
  • Check that the file size is under 10MB
  • Ensure the image is not corrupted

SDK Connection Issues

If you see errors about the Copilot SDK:

  1. Ensure GitHub CLI is installed: gh --version
  2. Check authentication: gh auth status
  3. Verify Copilot CLI extension: gh extension list
  4. Test Copilot access: gh copilot suggest "hello world"

API Usage

You can also use the API directly:

Generate from URL

curl -X POST http://localhost:3000/api/generate-from-url \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Generate from Excel

curl -X POST http://localhost:3000/api/generate-from-excel \
  -F "file=@path/to/file.xlsx"

Generate from Image

curl -X POST http://localhost:3000/api/generate-from-image \
  -F "file=@path/to/image.jpg"

Tips for Best Results

  1. URLs: Use pages with clear, structured content for better FAQ generation
  2. Excel: Include headers in your spreadsheet for better context
  3. Images: Use high-quality, clear images with readable text
  4. Wait time: Complex content may take 10-30 seconds to process
  5. Model selection: The application uses GPT-4 for text and GPT-4o for images

Next Steps

  • Try different types of content to see how the AI adapts
  • Compare results from similar content in different formats
  • Use the generated FAQs as a starting point and refine them
  • Experiment with different websites and data sources