Skip to content

DCS-training/Prompt-Tips-GenAI

Repository files navigation

Effective Prompting for Research

An introduction to the fundamentals of context engineering

This repository accompanies the CDCS workshop "Effective Prompting for Research" and includes the slides, prompt templates from the in-class examples and a python-script to demonstrate an advanced workflow.

Contents

  • prompt_examples.md - Prompt templates from the in class examples covering temperature control, system messages, few-shot learning, and more
  • process_csv_openai.py - Python script to batch process CSV data through OpenAI's API
  • input_guest_data.csv - Sample dataset (wedding guest thank-you notes)
  • output_guest_message.json - Example output showing structured responses

Getting Started

Prerequisites

  • Python 3.7+
  • OpenAI API key

Installation

  1. Clone this repository:
git clone https://github.com/DCS-training/Prompt-Tips-GenAI.git
cd Prompt-Tips-GenAI
  1. Install required dependencies:
pip install openai
  1. Set up your OpenAI API key in process_csv_openai.py

Usage

Learning Prompt Engineering

Start with prompt_examples.md to learn:

  • Example 1-2: Control output variability with temperature/top-p and system messages
  • Example 3: Improve reliability with few-shot learning
  • Example 4: Use variables for programmatic prompts
  • Example 5: Request structured JSON outputs
  • Example 6: Combine structure with reasoning
  • Example 7: Scale with batch processing

Processing Your Data

Run the batch processing script:

python process_csv_openai.py input_guest_data.csv output_guest_message.json

The script will:

  1. Read your CSV file with guest and gift columns
  2. Process each row through OpenAI's API
  3. Extract structured responses (reasoning + message)
  4. Save results to JSON format

Platforms

  • OpenAI API Playground: Recommended for full functionality (pay-as-you-go)
  • ELM Platform: Free university alternative for basic exploration

Best Practices

  1. Start with clear, specific instructions
  2. Use system messages to set consistent behavior
  3. Provide examples for complex tasks
  4. Request structured outputs for programmatic use
  5. Test with small datasets before scaling
  6. Document your prompt iterations

Contributing

This repository is maintained by DCS-training. Contributions and suggestions are welcome.

License

See repository for license details.

Resources

Acknowledgments

Developed for researchers learning to integrate generative AI into their workflows with transparency and reproducibility.

About

This is the Efficient Prompting for Generative AI Tools training course material repository.

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages