Personalizing Your Tutor with System Prompts in PHP
Personalizing Your Tutor with System Prompts
Welcome to the next step in your journey of creating a personal tutor with DeepSeek! In the previous lessons, you learned how to send messages to DeepSeek's language model, explored model parameters, and understood the importance of maintaining tutoring session history. Now, we will focus on personalizing your AI tutor by using system prompts. System prompts allow you to define the tutor's personality and expertise, enabling you to customize the behavior and tone of the AI's responses. This lesson will guide you through creating a specialized math and science tutor, demonstrating how system prompts can shape the tutor's interactions.
Creating a System Prompt
A system prompt is a key tool for customizing the AI tutor's behavior, setting the stage for how it interacts with students. It acts as a directive that defines the tutor's personality and expertise, guiding its responses to align with a specific teaching style or subject focus. We call it a "system prompt" because it serves as an overarching instruction to the AI, distinct from user or assistant messages, which are part of the ongoing tutoring session. While user messages are inputs from the student interacting with the tutor, and assistant messages are the tutor's responses, the system prompt is a one-time setup that influences all subsequent interactions within a session.
The system prompt does not persist across multiple sessions; it is reset each time a new session begins. If you change the system prompt mid-session, the AI will immediately adopt the new personality and expertise as defined by the updated prompt. However, for consistency and to avoid confusion, it's generally recommended to set the system prompt at the beginning of a session and maintain it throughout. Let's see a practical example of setting system prompts:
In this example, the system prompt is set first, establishing the AI as an experienced math and science tutor. This setup ensures that when the student asks a question, the AI responds in a manner consistent with its defined role. By placing the system prompt at the start, you create a cohesive and educational interaction, allowing the AI to maintain its teaching approach throughout the tutoring session.
