<h1 align="center">
<a href="https://prompts.chat">
This repository contains a comprehensive 21-lesson curriculum teaching Generative AI fundamentals and application development. The course is designed for beginners and covers everything from basic concepts to building production-ready applications.
Sign in to like and favorite skills
This repository contains a comprehensive 21-lesson curriculum teaching Generative AI fundamentals and application development. The course is designed for beginners and covers everything from basic concepts to building production-ready applications.
Key Technologies:
openai, python-dotenv, tiktoken, azure-ai-inference, pandas, numpy, matplotlib@azure/openai, @azure-rest/ai-inference, openaiRepository Structure:
.env file (use .env.copy as template)# Clone the repository git clone https://github.com/microsoft/generative-ai-for-beginners.git cd generative-ai-for-beginners # Copy environment template cp .env.copy .env # Edit .env with your API keys and endpoints
# Create virtual environment python3 -m venv venv # Activate virtual environment # On macOS/Linux: source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt
# Install root-level dependencies (for documentation tooling) npm install # For individual lesson TypeScript examples, navigate to the specific lesson: cd 06-text-generation-apps/typescript/recipe-app npm install
The repository includes a
.devcontainer configuration for GitHub Codespaces or VS Code Dev Containers:
requirements.txt.devcontainer/post-create.sh)All lessons requiring API access use environment variables defined in
.env:
OPENAI_API_KEY - For OpenAI APIAZURE_OPENAI_API_KEY - For Azure OpenAI ServiceAZURE_OPENAI_ENDPOINT - Azure OpenAI endpoint URLAZURE_OPENAI_DEPLOYMENT - Chat completion model deployment nameAZURE_OPENAI_EMBEDDINGS_DEPLOYMENT - Embeddings model deployment nameAZURE_OPENAI_API_VERSION - API version (default: 2024-02-01)HUGGING_FACE_API_KEY - For Hugging Face modelsGITHUB_TOKEN - For GitHub Models# Navigate to lesson directory cd 06-text-generation-apps/python # Run a Python script python aoai-app.py
# Navigate to TypeScript app directory cd 06-text-generation-apps/typescript/recipe-app # Build the TypeScript code npm run build # Run the application npm start
# Start Jupyter in the repository root jupyter notebook # Or use VS Code with Jupyter extension
python-dotenv for environment variable managementopenai library for API interactionspylint for linting (some examples include # pylint: disable=all for simplicity).env file, never in codedotenv package for environment variablestsconfig.json for each app@azure/openai or @azure-rest/ai-inference for Azure servicesnodemon for development with auto-reloadnpm run build then npm startaoai- prefix for Azure OpenAI, oai- for OpenAI API, githubmodels- for GitHub Models[text](url) format with no extra spaces./ or ../?WT.mc_id=academic-105485-koreyst/en-us/)./images folder with descriptive namestranslations/ directorytranslated_images/ directoryThis repository uses GitHub Actions for validation. Before submitting PRs:
Check Markdown Links:
# The validate-markdown.yml workflow checks: # - Broken relative paths # - Missing tracking IDs on paths # - Missing tracking IDs on URLs # - URLs with country locale # - Broken external URLs
Manual Testing:
npm install, npm run build, npm startCode Examples:
This is an educational repository focused on tutorials and examples. There are no unit tests or integration tests to run. Validation is primarily:
[Lesson 06] Fix Python example typo or Update README for lesson 08Fixes #123python/ or typescript/ subdirectory{provider}-{example-name}.{py|ts|js}.devcontainer/devcontainer.jsonmcr.microsoft.com/devcontainers/universal:2.11.2This is a learning repository - there is no deployment process. The curriculum is consumed by:
docsifytopdf.js and package.json)# Generate PDF from documentation (if needed) npm run convert
Python Import Errors:
pip install -r requirements.txtTypeScript Build Errors:
npm install in the specific app directorynode_modules and reinstall if neededAPI Authentication Errors:
.env file exists and has correct valuesMissing Environment Variables:
.env.copy to .env.env