EconomicAgents
This is an implementation and Python package for the paper Large Language Models as Simulated Economic Agents: What Can We Learn from Homo Silicus?. This Python package enables you to run all four simulations from the paper.
If you like this work, consider joining our .
Installation
pip install economic_agents
Usage
Charness Rabin
from economic_agents import CharnessRabin
charness_rabin = CharnessRabin(api_key="openai_key", model="gpt-3.5-turbo", personality=1, image_path="folder/charness_rabin", logging=True)
results = charness_rabin.play()
charness_rabin.create_plot(results)
The personality argument determines an option from the following personalities from the original paper:
"You only care about fairness between players",
"You only care about your own pay-off",
"You only care about the total pay-off of both players",
" "
Result:
Horton
from economic_agents import Horton
horton = Horton(api_key="openai_key", model="gpt-3.5-turbo", image_path="folder/horton", logging=True)
results = horton.play()
horton.create_plot(results)
Result:
Kahneman
from economic_agents import Kahneman
kahneman = Kahneman(api_key="openai_key", model="gpt-3.5-turbo", image_path="results/kahneman", logging=True)
results = kahneman.play()
kahneman.create_plot(results)
Result:
Zeckhauser
from economic_agents import Zeckhauser
zeckhauser = Zeckhauser(api_key="openai_key", model="gpt-3.5-turbo", image_path="results/zeckhauser", logging=True)
results = zeckhauser.play()
zeckhauser.create_plot(results)
Result:
Todo
- Create a Gradio demo
- Make experiments possible with dynamic inputs
- Improve error handling / code refactoring
- Add support for other models
Citation
@article{horton2023large,
title={Large Language Models as Simulated Economic Agents: What Can We Learn from Homo Silicus?},
author={Horton, John J},
journal={arXiv preprint arXiv:2301.07543},
year={2023}
}
Metadata
Release files for economic-agents 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| economic_agents-0.1.tar.gz | 6.8 kB | Without provenance | Details for economic_agents-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| economic_agents-0.1-py3-none-any.whl | Python 3 | none | any | Details for economic_agents-0.1-py3-none-any.whl |
Total release size: 15.2 kB
Release files / economic_agents-0.1.tar.gz
| Download URL | economic_agents-0.1.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b51dcea8cef62f38a526c87541484ec4927b3c1bae747b4f894aff27099e6ce
|
|
BLAKE2b-256 checksum How to use checksums |
e9b5b187c3e2e14ec177825f1dbc7c118f5d3e2c483f81fabe74261ab2c73984
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / economic_agents-0.1-py3-none-any.whl
| Download URL | economic_agents-0.1-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0246ed2646e6355fa5830390b3974262eb280f66689ebe1c0aef55fdabd4b437
|
|
BLAKE2b-256 checksum How to use checksums |
2c2046125c78f8042097478d443358623657890c98d71abbb1dc49967dae7a68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for economic-agents 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.