Metadata-Version: 2.4
Name: fun-hypothesis
Version: 0.1.1
Summary: Test whether different prompt framings affect LLM output quality
Author-email: "Andrew H. Bond" <andrew.bond@sjsu.edu>
License: MIT
Project-URL: Homepage, https://github.com/ahb-sjsu/fun-hypothesis
Project-URL: Bug Tracker, https://github.com/ahb-sjsu/fun-hypothesis/issues
Keywords: llm,prompt-engineering,hypothesis-testing,anthropic,framing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anthropic>=0.18.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: coverage>=7.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# Fun Hypothesis

[![CI](https://github.com/ahb-sjsu/fun-hypothesis/actions/workflows/ci.yml/badge.svg)](https://github.com/ahb-sjsu/fun-hypothesis/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/fun-hypothesis.svg)](https://pypi.org/project/fun-hypothesis/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Test whether different prompt framings affect LLM output quality.

## Hypothesis

LLM output quality varies based on how prompts are framed. This tool tests that hypothesis with rigorous double-blind methodology.

## Quick Start

```bash
pip install fun-hypothesis

# Run with default "fun" framing
fun-hypothesis --prompt "Explain quantum computing"

# Try different framings
fun-hypothesis --prompt "Explain quantum computing" --framing pirate
fun-hypothesis --prompt "Explain quantum computing" --framing expert
fun-hypothesis --prompt "Explain quantum computing" --framing eli5
```

## Built-in Framings

| Framing | Description |
|---------|-------------|
| `fun` | Make it engaging and playful |
| `pirate` | Like a pirate |
| `expert` | As a senior expert |
| `eli5` | Explain like I'm 5 |
| `formal` | Very formal and professional |
| `socratic` | As questions to explore |

## Methodology

1. **Session A**: Send raw prompt to LLM, collect response
2. **Session B**: Have LLM transform prompt with framing
3. **Session C**: Send framed prompt to LLM, collect response
4. **Session D**: Judge panel evaluates Response A (blind)
5. **Session E**: Judge panel evaluates Response C (blind)
6. Compare scores, iterate, aggregate, analyze

All sessions are independent (no context leakage). Judging is double-blind.

## Requirements

- Python 3.10+
- Anthropic API key (`ANTHROPIC_API_KEY` environment variable)

## Documentation

- [How It Works](framing-hypothesis-how-it-works.md)
- [Statistical Methodology](framing-hypothesis-statistical-methodology.md)

## License

MIT
