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.
prompt_examples.md- Prompt templates from the in class examples covering temperature control, system messages, few-shot learning, and moreprocess_csv_openai.py- Python script to batch process CSV data through OpenAI's APIinput_guest_data.csv- Sample dataset (wedding guest thank-you notes)output_guest_message.json- Example output showing structured responses
- Python 3.7+
- OpenAI API key
- Clone this repository:
git clone https://github.com/DCS-training/Prompt-Tips-GenAI.git
cd Prompt-Tips-GenAI- Install required dependencies:
pip install openai- Set up your OpenAI API key in
process_csv_openai.py
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
Run the batch processing script:
python process_csv_openai.py input_guest_data.csv output_guest_message.jsonThe script will:
- Read your CSV file with guest and gift columns
- Process each row through OpenAI's API
- Extract structured responses (reasoning + message)
- Save results to JSON format
- OpenAI API Playground: Recommended for full functionality (pay-as-you-go)
- ELM Platform: Free university alternative for basic exploration
- Start with clear, specific instructions
- Use system messages to set consistent behavior
- Provide examples for complex tasks
- Request structured outputs for programmatic use
- Test with small datasets before scaling
- Document your prompt iterations
This repository is maintained by DCS-training. Contributions and suggestions are welcome.
See repository for license details.
Developed for researchers learning to integrate generative AI into their workflows with transparency and reproducibility.