Metadata-Version: 2.2
Name: econ-llm
Version: 1.2.2
Summary: LLM Agents for Game Theory Experiments
Author-email: Jawand Singh <jawandsingh@gmail.com>
Keywords: game theory,LLM,agents,experiments
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: openai>=1.0
Requires-Dist: matplotlib
Requires-Dist: selenium
Requires-Dist: chromedriver-autoinstaller
Requires-Dist: pandas

# econ-llm
A python package that uses LLM agents to automate experiments using the VEcon Lab Website.

## ToDo 
- [ ] add parser to package

## Installation
To install the package, run the following command:
```bash
pip install econ-llm
```

## Dependencies
### Python Dependeny
```bash
sudo apt install python3
sudo apt install python3-pip
sudo apt install python3-venv
```
### secrets.txt
```text
OpenAI_API_KEY
GitHub_Username GitHub_Access_Token
```

`secrets.txt` should be in the same directory as execution.

### Upload
Assumes git credentials are set
```bash
git config --global user.email "YOUR_EMAIL"
git config --global user.name "YOUR_NAME"
git config pull.rebase true
```

## Commands
### Run
To run an experiment (multi-round ultimatum game), use the following command:
```bash
econ-llm run [experiment_id] [user_id] [(optional) experiment_version]
```
The agent automatically detects if it is a proposer or responder. Versions supported:
- "human_ai_classic": (default) matches instructions given to humans

### Upload
Upload output to `econ-llm-data` using the following command:
```bash
econ-llm upload
```

### Visualize
Visualize the output using the following command:
```bash
econ-llm visualize [filter one] [filter two] ...
```
Filters are used to select the data to visualize. For example, to select logs from a specific user on a specific day, use the following command:
```bash
econ-llm visualize [user_id] [yyyy-mm-dd]
```

### Upgrade
To update the package, use the following command:
```bash
econ-llm upgrade
```

## Output
The output will be saved in the `~/econ-llm-data` directory. File names contains experiment_id, user_id, and timestamp. Metadata includes the previous and the role of the agent.

## Specification
The package is currently using `gpt-4o-2024-08-06` as the model from OpenAI.

## Change Log
### Version 1.X.X

### Version 1.2.X - bug fix with proposer
- 1.2.2
    - Update how context is built/stored
    - Critical fixes to the context for proposer/responder
- 1.2.1
    - Fix bug with the proposer not getting all information
    - Add delays in interactions
    - Add spinner when proposer is waiting on a response

#### Version 1.1.X
- 1.1.3:
    - Add visualizer command
- 1.1.2: 
    - Update logging structure
    - Add log parsing
    - Auality of life improvements 
        - Use aboslute import paths
        - Better argument parsing
- 1.1.1: 
    - Initial stable release
    - Contains working versions of proposer/responder for multi-round ultimatum game.
