otree-gemini
Simple oTree app for interfacing a chat with Google's Gemini API.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.7%) to scientific vocabulary
Repository
Simple oTree app for interfacing a chat with Google's Gemini API.
Basic Info
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
oTree Gemini
This is a simple chat app for oTree that is a recreation of the oTree GPT app that I made. Instead of using Open AI's API, this uses Google Gemini.
System Prompt
As of this writing, Gemini does not allow a system prompt thought the API, but I use this clever workaround in the code.
API key
To use this, you will need to acquire a key from Google's API. Add this as an environment variable to your local environment to retrieve it.
Package requirements
This uses Google's Generative AI Python package, which can be installed:
pip install google.generativeai
Model Parameters
Currently, I have this set up to use gemini-1.5-flash. You can adjust this model and the temperature in the _init_.py file:
Data Output
The text logs are saved in participant fields, but I also made a simple custom export function. This can be accessed in the "data" tab in oTree and will show the chat logs as a long-form csv.
Citation
As part of oTree's installation agreement, be sure to cite their paper:
- Chen, D.L., Schonger, M., Wickens, C., 2016. oTree - An open-source platform for laboratory, online and field experiments. Journal of Behavioral and Experimental Finance, vol 9: 88-97.
If this app was helpful, you may consider citing this github repository as well.
- McKenna, C., (2024). oTree Gemini. https://github.com/clintmckenna/oTree-Gemini
Owner
- Name: Clint McKenna
- Login: clintmckenna
- Kind: user
- Location: Ann Arbor, MI
- Company: University of Michigan
- Repositories: 0
- Profile: https://github.com/clintmckenna
Graduate Student in Social Psychology
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: oTree Gemini
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Clint
family-names: McKenna
repository-code: 'https://github.com/clintmckenna/oTree-Gemini'
date-released: '2024-06-15'
GitHub Events
Total
Last Year
Dependencies
- otree >=5.0.0a21
- psycopg2 >=2.8.4