The Socratic AI Tutor is a Visual Studio Code extension designed to assist beginner coding students by providing explanations, hints, and interactive exercises in a Socratic manner. This extension leverages the GitHub Copilot Chat architecture and the Language Model API to integrate AI-powered features and natural language processing into your coding environment.
Features
Socratic Teaching Approach: Encourages critical thinking and problem-solving by asking questions and providing hints rather than directly solving problems.
Multi-Provider Support: Compatible with various language model providers, including GitHub Copilot, OpenRouter, Groq, and local tools like Ollama and lmstudio.
Interactive Exercises: Provides quick quizzes and interactive exercises to reinforce key programming concepts.
Code Execution: Runs and analyzes code, providing explanations for the output or errors.
Customizable Settings: Allows users to configure system prompts, model options, and other settings to tailor the tutoring experience.
Supported Providers
GitHub Copilot: Integrates seamlessly with GitHub Copilot for advanced AI-powered coding assistance.
OpenRouter: Supports OpenRouter for flexible and scalable language model interactions.
Groq: Utilizes Groq's powerful AI capabilities for enhanced coding support.
Local Tools: Compatible with local tools like Ollama and lmstudio for offline or self-hosted AI assistance.
Commands
The Socratic AI Tutor provides several commands to interact with the AI tutor:
Run Code: socratic-ai-tutor.run - Runs and analyzes the selected file or code.
Define Problem: socratic-ai-tutor.problem - Sets the current problem for the tutor to focus on.
Ask Question: socratic-ai-tutor.quiz - Provides a quiz or interactive exercise related to the code.
Explain Code: socratic-ai-tutor.explain - Explains the code line by line.
Give Hint: socratic-ai-tutor.hint - Provides a hint to help solve the current problem.
Define Requirements: socratic-ai-tutor.requirements - Helps define the underlying requirements of the problem.
Typical Use Cases
Learning New Concepts: Use the tutor to get explanations and hints while learning new programming concepts.
Debugging Code: Run code and get detailed explanations of errors and how to fix them.
Interactive Learning: Engage with quizzes and exercises to reinforce learning.
Problem-Solving: Define problems and get step-by-step guidance on how to approach and solve them.
Workflow
Install the Extension: Install the Socratic AI Tutor extension from the Visual Studio Code marketplace.
Configure Settings: Adjust the settings to match your preferred language model provider and customize the system prompt.
Interact with the Tutor: Use the provided commands to interact with the AI tutor. Ask questions, run code, get explanations, and more.
Receive Feedback: The tutor will provide feedback, hints, and explanations based on your interactions.
Settings
The Socratic AI Tutor extension offers several configurable settings:
System Prompt: Customize the system prompt for the AI tutor.
OpenAI-Compatible Base URL: Set the base URL for OpenAI-compatible APIs like Ollama or lmstudio.
OpenAI-Compatible API Key: Provide the API key for OpenAI-compatible authentication.
OpenAI-Compatible Model: Specify the OpenAI-compatible model to use.
LLM Provider: Select the language model provider (e.g., GitHub Copilot, OpenRouter, Groq).
Groq API Key: Provide the API key for Groq.
Groq Model: Specify the Groq model to use.
OpenRouter API Key: Provide the API key for OpenRouter.
OpenRouter Model: Specify the OpenRouter model to use.
Max Message History: Set the maximum number of messages to send in the prompt.
Keep Only Assistant History: Option to keep only the assistant's messages in the prompt.
Max Tokens: Set the maximum number of tokens to generate in the completion.
Temperature: Adjust the sampling temperature for the language model.
Early Alpha
Please note that the Socratic AI Tutor is currently in early alpha. Features and functionality are subject to change, and there may be bugs or incomplete features. Your feedback is valuable in helping us improve the extension.