Component of Great Prompt Writing
Krishna Kanhaiya
4x Azure | 1x Terraform | .Net | C# | Python | Typescript | Angular | React | Docker | CI | CD | Gen AI
To write effective prompts, it’s essential to structure them. Following is a framework which can be used for writing great Prompts:
Let’s explore this framework through examples.
Example 1: Technical Documentation
Prompt:
You are a technical writer specializing in software documentation. Write API documentation for the /getUserProfile endpoint in a RESTful web service. This endpoint retrieves user profile data based on a given user ID and uses the GET method. Include an overview, a list of parameters with their descriptions, the response schema, and an example request and response in JSON format. Use markdown formatting for the output.
Result:
### API Documentation: `/getUserProfile`
**Overview**
The `/getUserProfile` endpoint retrieves the profile information of a user based on their unique user ID. This endpoint uses the `GET` method and returns data in JSON format.
**Parameters**
| Parameter | Type | Description |
|------------|--------|------------------------------|
| userId | string | The unique identifier of the user. |
**Response Schema**
```json
{
"userId": "string",
"name": "string",
"email": "string",
"profilePicture": "string"
}
Example Request
领英推荐
GET /getUserProfile?userId=12345 HTTP/1.1
Host: api.example.com
Example Response
{
"userId": "12345",
"name": "John Doe",
"email": "[email protected]",
"profilePicture": "https://example.com/johndoe.jpg"
}
Example 2: Customer Support Chatbot
Prompt: You are a friendly and professional customer support chatbot for an e-commerce website. A customer has provided an order ID. Help the customer track their order by providing the order status, estimated delivery date, and a link to view more details. Ensure your response is polite and conversational.
Result:
"Thank you for sharing your order ID! Your order is currently being processed and is estimated to be delivered by January 18, 2025. You can view more details about your order here: [Track My Order](https://example.com/track-order). If you have any further questions, feel free to ask!"
Conclusion
Great prompt writing is a cornerstone of effective AI utilization. By defining the Role, Task, Context, Guideline, and Output, you can significantly enhance the clarity and relevance of AI responses. Mastering these components is essential for professionals aiming to communicate effectively with AI and maximize its potential.
Have you explored Prompt Engineering in your workflows? Share your thoughts and experiences in the comments below!