Skip to content

stutimahesh/prompt-engineering-techniques

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Prompt Engineering Techniques

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.


🚀 Repository Overview

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.


📂 Project Structure

prompt-engineering-techniques/
│
├── one_shot_prompting.py
├── few_shot_prompting.py
├── cot_prompting.py
└── cot_automation_agent.py

🧠 Techniques Implemented

1️⃣ One-Shot Prompting

Provides a single example to guide the model’s response.

Use case:

  • Simple pattern learning
  • Controlled output structure

2️⃣ Few-Shot Prompting

Provides multiple examples before the actual query.

Use case:

  • Better context learning
  • Improved consistency
  • Format control

3️⃣ Chain-of-Thought Prompting

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

4️⃣ Chain-of-Thought Automation

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

🛠 Tech Stack

  • Python
  • OpenAI SDK
  • Pydantic
  • Requests
  • JSON-based structured outputs

⚙️ Setup & Installation

  1. Clone the repository:
git clone https://github.com/your-username/prompt-engineering-techniques.git
  1. Create virtual environment:
python -m venv .venv
  1. Activate environment:
.venv\Scripts\activate   (Windows)
  1. Install dependencies:
pip install -r requirements.txt
  1. 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
  1. Run any file:
python one_shot_prompting.py

🎯 Learning Objectives

This repository demonstrates:

  • Prompt design patterns
  • Reasoning enhancement techniques
  • Structured output parsing
  • Tool-calling agents
  • Iterative LLM workflows

About

A collection of prompt engineering techniques, including One-Shot, Few-Shot, Chain-of-Thought, and reasoning agents using Large Language Models (LLMs).

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages