This is a sample demonstrating how to ingest a transcript for a YouTube video and ask questions about it using OpenAI, or local AI models, and .NET.
To run the sample:
- Clone the app locally
- Get an API key for OpenAI and set a local environment variable named OPENAI_API_KEY with that key
- Run the project using your favorite editor, or calling
dotnet run
from a Terminal in the root of your project directory
You could also run this sample using a local AI model, downloaded using Ollama:
- Install Ollama
- Once installed, open a Terminal window and install the following models:
ollama pull llama3.2
ollama pull all-minilm
- Run the project using your favorite editor, or calling
dotnet run
from a Terminal in the root of your project directory
This sample is built using the following technology:
- .NET 9
- Microsoft.Extensions.AI
- The OpenAI library for .NET
- OllamaSharp
- A YouTubeTranscriptAPI package, which is a .NET implementation of the Python youtube-transcript-api module