A structured collection of Prompt Engineering strategies implemented using Large Language Models (LLMs).
This repository demonstrates foundational to advanced prompting patterns including reasoning-based approaches and automation workflows.
This repo explores different prompting strategies used to improve LLM performance and reasoning capability.
The repository includes:
- One-Shot Prompting
- Few-Shot Prompting
- Chain-of-Thought (CoT) Prompting
- Chain-of-Thought Automation Agent
Each technique is implemented with practical examples and structured outputs.
prompt-engineering-techniques/
│
├── one_shot_prompting.py
├── few_shot_prompting.py
├── cot_prompting.py
└── cot_automation_agent.py
Provides a single example to guide the model’s response.
Use case:
- Simple pattern learning
- Controlled output structure
Provides multiple examples before the actual query.
Use case:
- Better context learning
- Improved consistency
- Format control
Encourages the model to reason step-by-step before producing the final answer.
Workflow: START → PLAN → OUTPUT
Use case:
- Mathematical problems
- Logical reasoning
- Multi-step queries
An advanced reasoning agent that:
- Breaks problems into steps
- Calls external tools
- Maintains structured JSON output
- Automates reasoning cycles
Includes:
- Tool calling
- Pydantic structured parsing
- Iterative reasoning loop
- Python
- OpenAI SDK
- Pydantic
- Requests
- JSON-based structured outputs
- Clone the repository:
git clone https://github.com/your-username/prompt-engineering-techniques.git
- Create virtual environment:
python -m venv .venv
- Activate environment:
.venv\Scripts\activate (Windows)
- Install dependencies:
pip install -r requirements.txt
- Create a .env file (IMPORTANT)
In the root folder of the project, create a file named:
.env
Add your Google API key inside it:
GOOGLE_API_KEY=your_api_key_here
- Run any file:
python one_shot_prompting.py
This repository demonstrates:
- Prompt design patterns
- Reasoning enhancement techniques
- Structured output parsing
- Tool-calling agents
- Iterative LLM workflows