Spaces:
Runtime error
Runtime error
russkiyximik commited on
Commit ·
8f54b3b
1
Parent(s): b054d3f
lil test
Browse files- .gitattributes +0 -35
- Dockerfile +0 -20
- README.md +0 -19
- mycoder/.gitignore +191 -0
- mycoder/README.md +58 -0
- mycoder/app.py +23 -0
- mycoder/data/pml-testing.csv +21 -0
- mycoder/knowledge/user_preference.txt +4 -0
- mycoder/output/code_and_output.txt +27 -0
- mycoder/output/plot.png +0 -0
- mycoder/pyproject.toml +24 -0
- mycoder/src/mycoder/__init__.py +0 -0
- mycoder/src/mycoder/config/agents.yaml +11 -0
- mycoder/src/mycoder/config/tasks.yaml +11 -0
- mycoder/src/mycoder/crew.py +53 -0
- mycoder/src/mycoder/main.py +36 -0
- mycoder/src/mycoder/tools/__init__.py +0 -0
- mycoder/src/mycoder/tools/custom_tool.py +34 -0
- mycoder/uv.lock +0 -0
- requirements.txt +0 -3
- src/streamlit_app.py +0 -40
.gitattributes
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dockerfile
DELETED
|
@@ -1,20 +0,0 @@
|
|
| 1 |
-
FROM python:3.13.5-slim
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
RUN apt-get update && apt-get install -y \
|
| 6 |
-
build-essential \
|
| 7 |
-
curl \
|
| 8 |
-
git \
|
| 9 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
-
|
| 11 |
-
COPY requirements.txt ./
|
| 12 |
-
COPY src/ ./src/
|
| 13 |
-
|
| 14 |
-
RUN pip3 install -r requirements.txt
|
| 15 |
-
|
| 16 |
-
EXPOSE 8501
|
| 17 |
-
|
| 18 |
-
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 19 |
-
|
| 20 |
-
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Omicsfuserx Demo
|
| 3 |
-
emoji: 🚀
|
| 4 |
-
colorFrom: red
|
| 5 |
-
colorTo: red
|
| 6 |
-
sdk: docker
|
| 7 |
-
app_port: 8501
|
| 8 |
-
tags:
|
| 9 |
-
- streamlit
|
| 10 |
-
pinned: false
|
| 11 |
-
short_description: Streamlit template space
|
| 12 |
-
---
|
| 13 |
-
|
| 14 |
-
# Welcome to Streamlit!
|
| 15 |
-
|
| 16 |
-
Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
|
| 17 |
-
|
| 18 |
-
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
|
| 19 |
-
forums](https://discuss.streamlit.io).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mycoder/.gitignore
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Byte-compiled / optimized / DLL files
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
|
| 6 |
+
# C extensions
|
| 7 |
+
*.so
|
| 8 |
+
|
| 9 |
+
# Distribution / packaging
|
| 10 |
+
.Python
|
| 11 |
+
build/
|
| 12 |
+
develop-eggs/
|
| 13 |
+
dist/
|
| 14 |
+
downloads/
|
| 15 |
+
eggs/
|
| 16 |
+
.eggs/
|
| 17 |
+
lib/
|
| 18 |
+
lib64/
|
| 19 |
+
parts/
|
| 20 |
+
sdist/
|
| 21 |
+
var/
|
| 22 |
+
wheels/
|
| 23 |
+
share/python-wheels/
|
| 24 |
+
*.egg-info/
|
| 25 |
+
.installed.cfg
|
| 26 |
+
*.egg
|
| 27 |
+
MANIFEST
|
| 28 |
+
|
| 29 |
+
# PyInstaller
|
| 30 |
+
# Usually these files are written by a python script from a template
|
| 31 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 32 |
+
*.manifest
|
| 33 |
+
*.spec
|
| 34 |
+
|
| 35 |
+
# Installer logs
|
| 36 |
+
pip-log.txt
|
| 37 |
+
pip-delete-this-directory.txt
|
| 38 |
+
|
| 39 |
+
# Unit test / coverage reports
|
| 40 |
+
htmlcov/
|
| 41 |
+
.tox/
|
| 42 |
+
.nox/
|
| 43 |
+
.coverage
|
| 44 |
+
.coverage.*
|
| 45 |
+
.cache
|
| 46 |
+
nosetests.xml
|
| 47 |
+
coverage.xml
|
| 48 |
+
*.cover
|
| 49 |
+
*.py,cover
|
| 50 |
+
.hypothesis/
|
| 51 |
+
.pytest_cache/
|
| 52 |
+
cover/
|
| 53 |
+
|
| 54 |
+
# Translations
|
| 55 |
+
*.mo
|
| 56 |
+
*.pot
|
| 57 |
+
|
| 58 |
+
# Django stuff:
|
| 59 |
+
*.log
|
| 60 |
+
local_settings.py
|
| 61 |
+
db.sqlite3
|
| 62 |
+
db.sqlite3-journal
|
| 63 |
+
|
| 64 |
+
# Flask stuff:
|
| 65 |
+
instance/
|
| 66 |
+
.webassets-cache
|
| 67 |
+
|
| 68 |
+
# Scrapy stuff:
|
| 69 |
+
.scrapy
|
| 70 |
+
|
| 71 |
+
# Sphinx documentation
|
| 72 |
+
docs/_build/
|
| 73 |
+
|
| 74 |
+
# PyBuilder
|
| 75 |
+
.pybuilder/
|
| 76 |
+
target/
|
| 77 |
+
|
| 78 |
+
# Jupyter Notebook
|
| 79 |
+
.ipynb_checkpoints
|
| 80 |
+
|
| 81 |
+
# IPython
|
| 82 |
+
profile_default/
|
| 83 |
+
ipython_config.py
|
| 84 |
+
|
| 85 |
+
# pyenv
|
| 86 |
+
# For a library or package, you might want to ignore these files since the code is
|
| 87 |
+
# intended to run in multiple environments; otherwise, check them in:
|
| 88 |
+
# .python-version
|
| 89 |
+
|
| 90 |
+
# pipenv
|
| 91 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 92 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 93 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 94 |
+
# install all needed dependencies.
|
| 95 |
+
#Pipfile.lock
|
| 96 |
+
|
| 97 |
+
# UV
|
| 98 |
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
| 99 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
| 100 |
+
# commonly ignored for libraries.
|
| 101 |
+
#uv.lock
|
| 102 |
+
|
| 103 |
+
# poetry
|
| 104 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
| 105 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
| 106 |
+
# commonly ignored for libraries.
|
| 107 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
| 108 |
+
#poetry.lock
|
| 109 |
+
|
| 110 |
+
# pdm
|
| 111 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
| 112 |
+
#pdm.lock
|
| 113 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
| 114 |
+
# in version control.
|
| 115 |
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
| 116 |
+
.pdm.toml
|
| 117 |
+
.pdm-python
|
| 118 |
+
.pdm-build/
|
| 119 |
+
|
| 120 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
| 121 |
+
__pypackages__/
|
| 122 |
+
|
| 123 |
+
# Celery stuff
|
| 124 |
+
celerybeat-schedule
|
| 125 |
+
celerybeat.pid
|
| 126 |
+
|
| 127 |
+
# SageMath parsed files
|
| 128 |
+
*.sage.py
|
| 129 |
+
|
| 130 |
+
# Environments
|
| 131 |
+
.env
|
| 132 |
+
.venv
|
| 133 |
+
env/
|
| 134 |
+
venv/
|
| 135 |
+
ENV/
|
| 136 |
+
env.bak/
|
| 137 |
+
venv.bak/
|
| 138 |
+
|
| 139 |
+
# Spyder project settings
|
| 140 |
+
.spyderproject
|
| 141 |
+
.spyproject
|
| 142 |
+
|
| 143 |
+
# Rope project settings
|
| 144 |
+
.ropeproject
|
| 145 |
+
|
| 146 |
+
# mkdocs documentation
|
| 147 |
+
/site
|
| 148 |
+
|
| 149 |
+
# mypy
|
| 150 |
+
.mypy_cache/
|
| 151 |
+
.dmypy.json
|
| 152 |
+
dmypy.json
|
| 153 |
+
|
| 154 |
+
# Pyre type checker
|
| 155 |
+
.pyre/
|
| 156 |
+
|
| 157 |
+
# pytype static type analyzer
|
| 158 |
+
.pytype/
|
| 159 |
+
|
| 160 |
+
# Cython debug symbols
|
| 161 |
+
cython_debug/
|
| 162 |
+
|
| 163 |
+
# PyCharm
|
| 164 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
| 165 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
| 166 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
| 167 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 168 |
+
#.idea/
|
| 169 |
+
|
| 170 |
+
# Ruff stuff:
|
| 171 |
+
.ruff_cache/
|
| 172 |
+
|
| 173 |
+
# PyPI configuration file
|
| 174 |
+
.pypirc
|
| 175 |
+
|
| 176 |
+
.DS_Store
|
| 177 |
+
|
| 178 |
+
# Ignore Crew engineering team output
|
| 179 |
+
3_crew/engineering_team/output/
|
| 180 |
+
|
| 181 |
+
# Ignore memory in sidekick
|
| 182 |
+
memory.db-shm
|
| 183 |
+
memory.db-wal
|
| 184 |
+
memory.db
|
| 185 |
+
|
| 186 |
+
# Ignore Accounts database in capstone project
|
| 187 |
+
6_mcp/accounts.db
|
| 188 |
+
6_mcp/memory/*.db
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
|
mycoder/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Mycoder Crew
|
| 2 |
+
|
| 3 |
+
Welcome to the Mycoder Crew project, powered by [crewAI](https://crewai.com). This template is designed to help you set up a multi-agent AI system with ease, leveraging the powerful and flexible framework provided by crewAI. Our goal is to enable your agents to collaborate effectively on complex tasks, maximizing their collective intelligence and capabilities.
|
| 4 |
+
|
| 5 |
+
## Installation
|
| 6 |
+
|
| 7 |
+
Ensure you have Python >=3.10 <3.14 installed on your system. This project uses [UV](https://docs.astral.sh/uv/) for dependency management and package handling, offering a seamless setup and execution experience.
|
| 8 |
+
|
| 9 |
+
First, if you haven't already, install uv:
|
| 10 |
+
|
| 11 |
+
```bash
|
| 12 |
+
pip install uv
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
Next, navigate to your project directory and install the dependencies:
|
| 16 |
+
|
| 17 |
+
(Optional) Lock the dependencies and install them by using the CLI command:
|
| 18 |
+
```bash
|
| 19 |
+
crewai install
|
| 20 |
+
```
|
| 21 |
+
### Customizing
|
| 22 |
+
|
| 23 |
+
**Add your `OPENAI_API_KEY` into the `.env` file**
|
| 24 |
+
|
| 25 |
+
- Modify `src/mycoder/config/agents.yaml` to define your agents
|
| 26 |
+
- Modify `src/mycoder/config/tasks.yaml` to define your tasks
|
| 27 |
+
- Modify `src/mycoder/crew.py` to add your own logic, tools and specific args
|
| 28 |
+
- Modify `src/mycoder/main.py` to add custom inputs for your agents and tasks
|
| 29 |
+
|
| 30 |
+
## Running the Project
|
| 31 |
+
|
| 32 |
+
To kickstart your crew of AI agents and begin task execution, run this from the root folder of your project:
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
$ crewai run
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
This command initializes the mycoder Crew, assembling the agents and assigning them tasks as defined in your configuration.
|
| 39 |
+
|
| 40 |
+
This example, unmodified, will run the create a `report.md` file with the output of a research on LLMs in the root folder.
|
| 41 |
+
|
| 42 |
+
## Understanding Your Crew
|
| 43 |
+
|
| 44 |
+
The mycoder Crew is composed of multiple AI agents, each with unique roles, goals, and tools. These agents collaborate on a series of tasks, defined in `config/tasks.yaml`, leveraging their collective skills to achieve complex objectives. The `config/agents.yaml` file outlines the capabilities and configurations of each agent in your crew.
|
| 45 |
+
|
| 46 |
+
## Support
|
| 47 |
+
|
| 48 |
+
For support, questions, or feedback regarding the Mycoder Crew or crewAI.
|
| 49 |
+
- Visit our [documentation](https://docs.crewai.com)
|
| 50 |
+
- Reach out to us through our [GitHub repository](https://github.com/joaomdmoura/crewai)
|
| 51 |
+
- [Join our Discord](https://discord.com/invite/X4JWnZnxPb)
|
| 52 |
+
- [Chat with our docs](https://chatg.pt/DWjSBZn)
|
| 53 |
+
|
| 54 |
+
Let's create wonders together with the power and simplicity of crewAI.
|
| 55 |
+
|
| 56 |
+
## Startup
|
| 57 |
+
|
| 58 |
+
To use this implementation, you MUST query with the name of the database, e.g. data/Iris.csv
|
mycoder/app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from src.mycoder.main import run
|
| 4 |
+
|
| 5 |
+
st.title("MyCoder Demo")
|
| 6 |
+
st.write("This is a demo application for the MyCoder crew.")
|
| 7 |
+
|
| 8 |
+
uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"])
|
| 9 |
+
if uploaded_file is not None:
|
| 10 |
+
uploaded_path = os.path.join("data", uploaded_file.name)
|
| 11 |
+
with open(uploaded_path, "wb") as f:
|
| 12 |
+
f.write(uploaded_file.getbuffer())
|
| 13 |
+
st.success(f"File uploaded and saved as {uploaded_path}")
|
| 14 |
+
|
| 15 |
+
st.write("Make sure to specify the correct file name in your query, e.g. 'data/Iris.csv'.")
|
| 16 |
+
question = st.text_input("Enter your query:")
|
| 17 |
+
|
| 18 |
+
if st.button("Run MyCoder Crew"):
|
| 19 |
+
with st.spinner("Running the crew..."):
|
| 20 |
+
result = run(question)
|
| 21 |
+
st.text(result.raw)
|
| 22 |
+
|
| 23 |
+
st.image("output/plot.png", caption="Generated Figure")
|
mycoder/data/pml-testing.csv
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"","user_name","raw_timestamp_part_1","raw_timestamp_part_2","cvtd_timestamp","new_window","num_window","roll_belt","pitch_belt","yaw_belt","total_accel_belt","kurtosis_roll_belt","kurtosis_picth_belt","kurtosis_yaw_belt","skewness_roll_belt","skewness_roll_belt.1","skewness_yaw_belt","max_roll_belt","max_picth_belt","max_yaw_belt","min_roll_belt","min_pitch_belt","min_yaw_belt","amplitude_roll_belt","amplitude_pitch_belt","amplitude_yaw_belt","var_total_accel_belt","avg_roll_belt","stddev_roll_belt","var_roll_belt","avg_pitch_belt","stddev_pitch_belt","var_pitch_belt","avg_yaw_belt","stddev_yaw_belt","var_yaw_belt","gyros_belt_x","gyros_belt_y","gyros_belt_z","accel_belt_x","accel_belt_y","accel_belt_z","magnet_belt_x","magnet_belt_y","magnet_belt_z","roll_arm","pitch_arm","yaw_arm","total_accel_arm","var_accel_arm","avg_roll_arm","stddev_roll_arm","var_roll_arm","avg_pitch_arm","stddev_pitch_arm","var_pitch_arm","avg_yaw_arm","stddev_yaw_arm","var_yaw_arm","gyros_arm_x","gyros_arm_y","gyros_arm_z","accel_arm_x","accel_arm_y","accel_arm_z","magnet_arm_x","magnet_arm_y","magnet_arm_z","kurtosis_roll_arm","kurtosis_picth_arm","kurtosis_yaw_arm","skewness_roll_arm","skewness_pitch_arm","skewness_yaw_arm","max_roll_arm","max_picth_arm","max_yaw_arm","min_roll_arm","min_pitch_arm","min_yaw_arm","amplitude_roll_arm","amplitude_pitch_arm","amplitude_yaw_arm","roll_dumbbell","pitch_dumbbell","yaw_dumbbell","kurtosis_roll_dumbbell","kurtosis_picth_dumbbell","kurtosis_yaw_dumbbell","skewness_roll_dumbbell","skewness_pitch_dumbbell","skewness_yaw_dumbbell","max_roll_dumbbell","max_picth_dumbbell","max_yaw_dumbbell","min_roll_dumbbell","min_pitch_dumbbell","min_yaw_dumbbell","amplitude_roll_dumbbell","amplitude_pitch_dumbbell","amplitude_yaw_dumbbell","total_accel_dumbbell","var_accel_dumbbell","avg_roll_dumbbell","stddev_roll_dumbbell","var_roll_dumbbell","avg_pitch_dumbbell","stddev_pitch_dumbbell","var_pitch_dumbbell","avg_yaw_dumbbell","stddev_yaw_dumbbell","var_yaw_dumbbell","gyros_dumbbell_x","gyros_dumbbell_y","gyros_dumbbell_z","accel_dumbbell_x","accel_dumbbell_y","accel_dumbbell_z","magnet_dumbbell_x","magnet_dumbbell_y","magnet_dumbbell_z","roll_forearm","pitch_forearm","yaw_forearm","kurtosis_roll_forearm","kurtosis_picth_forearm","kurtosis_yaw_forearm","skewness_roll_forearm","skewness_pitch_forearm","skewness_yaw_forearm","max_roll_forearm","max_picth_forearm","max_yaw_forearm","min_roll_forearm","min_pitch_forearm","min_yaw_forearm","amplitude_roll_forearm","amplitude_pitch_forearm","amplitude_yaw_forearm","total_accel_forearm","var_accel_forearm","avg_roll_forearm","stddev_roll_forearm","var_roll_forearm","avg_pitch_forearm","stddev_pitch_forearm","var_pitch_forearm","avg_yaw_forearm","stddev_yaw_forearm","var_yaw_forearm","gyros_forearm_x","gyros_forearm_y","gyros_forearm_z","accel_forearm_x","accel_forearm_y","accel_forearm_z","magnet_forearm_x","magnet_forearm_y","magnet_forearm_z","problem_id"
|
| 2 |
+
"1","pedro",1323095002,868349,"05/12/2011 14:23","no",74,123,27,-4.75,20,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.5,-0.02,-0.46,-38,69,-179,-13,581,-382,40.7,-27.8,178,10,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-1.65,0.48,-0.18,16,38,93,-326,385,481,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,-17.73747952,24.96085253,126.2359642,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",9,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.64,0.06,-0.61,21,-15,81,523,-528,-56,141,49.3,156,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",33,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.74,-3.34,-0.59,-110,267,-149,-714,419,617,1
|
| 3 |
+
"2","jeremy",1322673067,778725,"30/11/2011 17:11","no",431,1.02,4.87,-88.9,4,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.06,-0.02,-0.07,-13,11,39,43,636,-309,0,0,0,38,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-1.17,0.85,-0.43,-290,215,-90,-325,447,434,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,54.47760516,-53.69758195,-75.51479864,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",31,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.34,0.05,-0.71,-153,155,-205,-502,388,-36,109,-17.6,106,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",39,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1.12,-2.78,-0.18,212,297,-118,-237,791,873,2
|
| 4 |
+
"3","jeremy",1322673075,342967,"30/11/2011 17:11","no",439,0.87,1.82,-88.5,5,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.05,0.02,0.03,1,-1,49,29,631,-312,0,0,0,44,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,2.1,-1.36,1.13,-341,245,-87,-264,474,413,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,57.07030753,-51.37302799,-75.20287263,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",29,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.39,0.14,-0.34,-141,155,-196,-506,349,41,131,-32.6,93,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",34,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.18,-0.79,0.28,154,271,-129,-51,698,783,3
|
| 5 |
+
"4","adelmo",1322832789,560311,"02/12/2011 13:33","no",194,125,-41.6,162,17,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.11,0.11,-0.16,46,45,-156,169,608,-304,-109,55,-142,25,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.22,-0.51,0.92,-238,-57,6,-173,257,633,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,43.10926817,-30.04884783,-103.3200319,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",18,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.1,-0.02,0.05,-51,72,-148,-576,238,53,0,0,0,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",43,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1.38,0.69,1.8,-92,406,-39,-233,783,521,4
|
| 6 |
+
"5","eurico",1322489635,814776,"28/11/2011 14:13","no",235,1.35,3.33,-88.6,3,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.03,0.02,0,-8,4,27,33,566,-418,76.1,2.76,102,29,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-1.96,0.79,-0.54,-197,200,-30,-170,275,617,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,-101.3839643,-53.4395195,-14.1954232,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",4,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.29,-0.47,-0.46,-18,-30,-5,-424,252,312,-176,-2.16,-47.9,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",24,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.75,3.1,0.8,131,-93,172,375,-787,91,5
|
| 7 |
+
"6","jeremy",1322673149,510661,"30/11/2011 17:12","no",504,-5.92,1.59,-87.7,4,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.1,0.05,-0.13,-11,-16,38,31,638,-291,0,0,0,14,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.02,0.05,-0.07,-26,130,-19,396,176,516,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,62.18749825,-50.55594592,-71.12063095,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",29,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.59,0.8,1.1,-138,166,-186,-543,262,96,150,1.46,89.7,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",43,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.88,4.26,1.35,230,322,-144,-300,800,884,6
|
| 8 |
+
"7","jeremy",1322673128,766645,"30/11/2011 17:12","no",485,1.2,4.44,-87.3,4,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.06,0,0,-14,2,35,50,622,-315,0,0,0,15,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,2.36,-1.01,0.89,99,79,-67,702,15,217,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,56.04618357,-53.96761388,-73.87055229,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",29,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.34,0.16,-0.23,-145,150,-190,-484,354,97,155,34.5,152,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",32,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.53,1.8,0.75,-192,170,-175,-678,284,585,7
|
| 9 |
+
"8","jeremy",1322673076,54671,"30/11/2011 17:11","no",440,0.43,4.15,-88.5,4,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.18,-0.02,-0.03,-10,-2,42,39,635,-305,0,0,0,22,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-3.71,1.85,-0.69,-98,175,-78,535,215,385,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,59.12808038,-51.30241524,-73.36848661,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",29,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.37,0.14,-0.39,-140,159,-191,-515,350,53,-161,43.6,-89.5,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",47,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.63,-0.74,0.49,-151,-331,-282,-109,-619,-32,8
|
| 10 |
+
"9","carlitos",1323084240,916313,"05/12/2011 11:24","no",323,0.93,6.72,-93.7,4,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.1,0,-0.02,-15,1,32,-6,600,-302,-137,11.2,-167,34,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.03,-0.02,-0.02,-287,111,-122,-367,335,520,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,122.5240746,0,34.55555806,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.03,-0.21,-0.21,0,25,9,-519,348,-32,15.5,-63.5,-139,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",36,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.03,0.02,-0.02,195,204,-217,0,652,469,9
|
| 11 |
+
"10","charles",1322837822,384285,"02/12/2011 14:57","no",664,114,22.4,-13.1,18,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.14,0.11,-0.16,-25,63,-158,10,601,-330,-82.4,-63.8,-75.3,32,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.26,-0.5,0.79,-301,-42,-80,-420,294,493,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,-111.1176996,-31.90635386,31.90635386,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",2,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.42,0.51,-0.03,-7,-20,7,-531,321,-164,13.2,19.4,-105,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",24,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.02,0.13,-0.07,-212,98,-7,-403,723,512,10
|
| 12 |
+
"11","carlitos",1323084277,36553,"05/12/2011 11:24","no",859,0.92,5.94,-92.7,3,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.05,0,0,-18,4,27,6,599,-312,70,15.1,113,33,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.08,0.02,0,-277,113,-112,-320,350,514,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,123.9841439,-32.07139242,7.889285443,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",1,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.18,-0.47,-0.23,-4,12,1,-556,280,-23,137,-9.41,104,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",46,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.05,0.05,0.11,-3,405,-203,-248,720,438,11
|
| 13 |
+
"12","jeremy",1322673101,442731,"30/11/2011 17:11","no",461,1.01,4.96,-87.8,5,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.1,0,0.02,-22,8,40,51,632,-308,0,0,0,30,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,2.57,-1.06,0.79,-192,204,-75,194,280,555,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,45.50730046,-53.70900561,-83.05011649,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",30,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.39,-0.1,-0.56,-149,128,-215,-539,293,67,138,-19.9,70.5,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",36,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.02,0.83,0.38,182,263,-148,32,648,702,12
|
| 14 |
+
"13","eurico",1322489661,298656,"28/11/2011 14:14","no",257,0.54,2.45,-88.6,3,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.06,0,-0.13,-8,5,24,34,571,-426,110,-31.7,-13.6,23,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-3.44,1.08,-0.15,106,97,-168,697,-184,-175,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,12.47996762,34.27571307,120.4247464,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",8,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1.06,-1.11,-1,27,10,75,-328,271,363,176,16.7,-38.5,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",23,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0,-4.69,-1.26,149,46,167,456,-677,29,13
|
| 15 |
+
"14","jeremy",1322673043,178652,"30/11/2011 17:10","no",408,0.45,5.02,-87.9,5,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.05,0,0,-14,2,49,55,635,-305,0,0,0,37,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.02,-0.02,-0.1,-277,157,-183,-404,416,409,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,56.37077461,-49.97064756,-77.02918844,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",30,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.35,0.11,-0.38,-139,155,-202,-523,337,46,53.1,-46.2,159,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",33,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.02,0,0.03,232,106,-198,123,555,648,14
|
| 16 |
+
"15","jeremy",1322673156,550750,"30/11/2011 17:12","no",779,5.34,-3.09,-80.3,4,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.24,0,0.05,8,19,28,91,584,-398,0,0,0,23,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,3.66,-2.09,0.49,41,85,-204,750,-24,-58,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,46.32750071,-54.97283764,-81.27499013,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",31,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.75,-0.21,-1.18,-159,136,-221,-511,323,85,152,26.5,-168,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",24,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.64,-5.97,-1.05,-18,43,-226,-540,-155,389,15
|
| 17 |
+
"16","eurico",1322489713,706637,"28/11/2011 14:15","no",302,1.65,3.47,-87,2,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.02,0.02,0,-12,5,20,45,566,-425,88.1,5.58,123,33,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.02,-0.06,0.1,-236,163,-148,-398,288,525,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,57.79589112,33.72223165,87.7992825,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",13,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-1.03,0.92,0.13,43,71,100,-284,311,368,-176,16.2,-42.2,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",25,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.31,-3.45,-0.66,161,-61,171,532,-775,114,16
|
| 18 |
+
"17","pedro",1323094971,920315,"05/12/2011 14:22","no",48,129,27.8,1.84,21,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.5,0,-0.48,-47,69,-187,4,566,-400,-1.47,-3.45,-55.1,3,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.19,-0.24,0.13,2,-9,27,-394,321,502,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,-28.49711141,13.6137931,125.3314711,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",11,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.5,-0.11,-0.33,14,-29,98,484,-558,-19,79.4,-2.6,109,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",30,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.1,-0.06,0.18,144,201,-154,-146,756,708,17
|
| 19 |
+
"18","carlitos",1323084285,176314,"05/12/2011 11:24","no",361,0.92,5.31,-93.1,3,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.02,0,-0.05,-13,3,24,0,607,-305,152,-26.4,-85,42,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1,-0.37,-0.03,35,-65,-404,202,-307,-499,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,107.4722233,-49.53989631,-2.377137314,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",4,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.39,1.91,0.52,-20,37,-1,-527,329,-77,-173,49.8,-133,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",25,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.75,4.14,0.95,-129,-29,-202,-500,-232,329,18
|
| 20 |
+
"19","pedro",1323094999,828379,"05/12/2011 14:23","no",72,123,26.7,-2.68,19,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.31,-0.05,-0.44,-48,72,-169,-5,584,-366,30.7,-27,-151,11,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,1.99,-1.2,-0.44,-7,57,89,-266,454,441,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,-7.463022277,23.65339092,132.2337396,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",10,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.45,-0.1,-0.23,22,-7,91,505,-537,-86,-164,59.3,-149,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",23,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-1.06,2.79,0.67,-148,21,-172,-614,-46,471,19
|
| 21 |
+
"20","eurico",1322489658,106658,"28/11/2011 14:14","no",255,1.4,3.2,-88.7,3,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.06,-0.02,0.02,-9,4,23,37,567,-425,90.6,11.5,117,30,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-0.47,0.13,-0.18,-223,166,-105,-428,321,472,"","","","","","",NA,NA,NA,NA,NA,NA,NA,NA,NA,36.91667833,96.86772811,45.17826318,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",23,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,0.79,-0.79,-0.23,185,81,98,272,403,340,173,19.2,-83.2,"","","","","","",NA,NA,"",NA,NA,"",NA,NA,"",21,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,-1.01,3.18,1.26,41,-100,179,70,-703,74,20
|
mycoder/knowledge/user_preference.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
User name is John Doe.
|
| 2 |
+
User is an AI Engineer.
|
| 3 |
+
User is interested in AI Agents.
|
| 4 |
+
User is based in San Francisco, California.
|
mycoder/output/code_and_output.txt
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
import random
|
| 3 |
+
|
| 4 |
+
# Generate 50 random numbers between 1 and 10000
|
| 5 |
+
random_numbers = [random.randint(1, 10000) for _ in range(50)]
|
| 6 |
+
|
| 7 |
+
# Calculate sum, average, max, and min
|
| 8 |
+
total_sum = sum(random_numbers)
|
| 9 |
+
average = total_sum / len(random_numbers)
|
| 10 |
+
max_number = max(random_numbers)
|
| 11 |
+
min_number = min(random_numbers)
|
| 12 |
+
|
| 13 |
+
# Prepare the results
|
| 14 |
+
results = {
|
| 15 |
+
"Sum": total_sum,
|
| 16 |
+
"Average": average,
|
| 17 |
+
"Max": max_number,
|
| 18 |
+
"Min": min_number
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
print("Random Numbers:", random_numbers)
|
| 22 |
+
print("Results:", results)
|
| 23 |
+
|
| 24 |
+
# Output from the code execution
|
| 25 |
+
# Random Numbers: [567, 5502, 6648, 1019, 3687, 7527, 9895, 2488, 4228, 3228, 4185, 2965, 5290, 2975, 3509, 312, 9270, 8858, 5659, 4897, 3495, 4357, 6567, 5284, 9384, 7233, 3258, 1702, 3636, 6758, 7094, 5406, 754, 4220, 4808, 1039, 2597, 2345, 3733, 9639, 2204, 3728, 3163, 7641, 366, 1759, 9500, 3310, 3761, 8939]
|
| 26 |
+
# Results: {'Sum': 230389, 'Average': 4607.78, 'Max': 9895, 'Min': 312}
|
| 27 |
+
"""
|
mycoder/output/plot.png
ADDED
|
mycoder/pyproject.toml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "mycoder"
|
| 3 |
+
version = "0.1.0"
|
| 4 |
+
description = "mycoder using crewAI"
|
| 5 |
+
authors = [{ name = "Your Name", email = "you@example.com" }]
|
| 6 |
+
requires-python = ">=3.10,<3.14"
|
| 7 |
+
dependencies = [
|
| 8 |
+
"crewai[tools]==1.7.2"
|
| 9 |
+
]
|
| 10 |
+
|
| 11 |
+
[project.scripts]
|
| 12 |
+
mycoder = "mycoder.main:run"
|
| 13 |
+
run_crew = "mycoder.main:run"
|
| 14 |
+
train = "mycoder.main:train"
|
| 15 |
+
replay = "mycoder.main:replay"
|
| 16 |
+
test = "mycoder.main:test"
|
| 17 |
+
run_with_trigger = "mycoder.main:run_with_trigger"
|
| 18 |
+
|
| 19 |
+
[build-system]
|
| 20 |
+
requires = ["hatchling"]
|
| 21 |
+
build-backend = "hatchling.build"
|
| 22 |
+
|
| 23 |
+
[tool.crewai]
|
| 24 |
+
type = "crew"
|
mycoder/src/mycoder/__init__.py
ADDED
|
File without changes
|
mycoder/src/mycoder/config/agents.yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
coder:
|
| 2 |
+
role: >
|
| 3 |
+
Python Developer
|
| 4 |
+
goal: >
|
| 5 |
+
You write python code to achieve this assignment: {assignment}
|
| 6 |
+
First you plan how the code will work, then you write the code, then you run it and check the output.
|
| 7 |
+
You should check schema of uploaded files to understand their structure and proceed with analyses more
|
| 8 |
+
efficiently.
|
| 9 |
+
backstory: >
|
| 10 |
+
You're a seasoned python developer and bioinformatician with a knack for writing clean, efficient code.
|
| 11 |
+
llm: gpt-4o-mini
|
mycoder/src/mycoder/config/tasks.yaml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
coding_task:
|
| 2 |
+
description: >
|
| 3 |
+
Write python code to achieve this: {assignment}. Make sure to format
|
| 4 |
+
the code properly, e.g. avoiding using \\n for new lines.
|
| 5 |
+
|
| 6 |
+
Make sure to save any plots generated by the code as 'output/plot.png'.
|
| 7 |
+
expected_output: >
|
| 8 |
+
A text file that includes the code itself, along with the output of the code.
|
| 9 |
+
output_file: output/code_and_output.txt
|
| 10 |
+
agent: coder
|
| 11 |
+
markdown: true
|
mycoder/src/mycoder/crew.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from crewai import Agent, Crew, Process, Task
|
| 2 |
+
from crewai.project import CrewBase, agent, crew, task
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
@CrewBase
|
| 7 |
+
class Coder():
|
| 8 |
+
"""Coder crew"""
|
| 9 |
+
|
| 10 |
+
agents_config = 'config/agents.yaml'
|
| 11 |
+
tasks_config = 'config/tasks.yaml'
|
| 12 |
+
|
| 13 |
+
# One click install for Docker Desktop:
|
| 14 |
+
#https://docs.docker.com/desktop/
|
| 15 |
+
|
| 16 |
+
@agent
|
| 17 |
+
def coder(self) -> Agent:
|
| 18 |
+
from mycoder.tools.custom_tool import ExtractSchema
|
| 19 |
+
return Agent(
|
| 20 |
+
config=self.agents_config['coder'],
|
| 21 |
+
verbose=True,
|
| 22 |
+
allow_code_execution=True,
|
| 23 |
+
code_execution_mode="safe", # Uses Docker for safety
|
| 24 |
+
max_execution_time=300,
|
| 25 |
+
max_retry_limit=5 ,
|
| 26 |
+
tools=[ExtractSchema()],
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
@task
|
| 31 |
+
def coding_task(self) -> Task:
|
| 32 |
+
return Task(
|
| 33 |
+
config=self.tasks_config['coding_task'],
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
# @task
|
| 37 |
+
# def image_task(self) -> Task:
|
| 38 |
+
# return Task(
|
| 39 |
+
# config=self.tasks_config['image_task'],
|
| 40 |
+
# )
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
@crew
|
| 44 |
+
def crew(self) -> Crew:
|
| 45 |
+
"""Creates the Coder crew"""
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
return Crew(
|
| 49 |
+
agents=self.agents,
|
| 50 |
+
tasks=self.tasks,
|
| 51 |
+
process=Process.sequential,
|
| 52 |
+
verbose=True,
|
| 53 |
+
)
|
mycoder/src/mycoder/main.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
import sys
|
| 3 |
+
import warnings
|
| 4 |
+
import os
|
| 5 |
+
from datetime import datetime
|
| 6 |
+
|
| 7 |
+
from .crew import Coder
|
| 8 |
+
|
| 9 |
+
warnings.filterwarnings("ignore", category=SyntaxWarning, module="pysbd")
|
| 10 |
+
|
| 11 |
+
# Create output directory if it doesn't exist
|
| 12 |
+
os.makedirs('output', exist_ok=True)
|
| 13 |
+
|
| 14 |
+
assignment = 'Perform a simple ANOVA analysis across species in the dataset ' \
|
| 15 |
+
'data/Iris.csv. Then, make a plot of the distribution of SepalLengthCm for each species.'
|
| 16 |
+
|
| 17 |
+
# assignment = 'Make a plot of the distribution of SepalLengthCm for each species in the dataset data/Iris.csv.'
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def run(query: str):
|
| 21 |
+
"""
|
| 22 |
+
Run the crew.
|
| 23 |
+
"""
|
| 24 |
+
inputs = {
|
| 25 |
+
'assignment': query,
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
result = Coder().crew().kickoff(inputs=inputs)
|
| 29 |
+
print(result.raw)
|
| 30 |
+
|
| 31 |
+
return result
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
mycoder/src/mycoder/tools/__init__.py
ADDED
|
File without changes
|
mycoder/src/mycoder/tools/custom_tool.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
from crewai.tools import BaseTool
|
| 5 |
+
from typing import Any, Dict, Type
|
| 6 |
+
from pydantic import BaseModel, Field
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
class ExtractSchemaInput(BaseModel):
|
| 10 |
+
"""Input schema for ExtractSchema."""
|
| 11 |
+
file_path: str = Field(
|
| 12 |
+
..., description="Path to the local file from which to extract the schema, " \
|
| 13 |
+
"relative to the agent's working directory."
|
| 14 |
+
)
|
| 15 |
+
# This file path is relative to ..? (find working dir of agent)
|
| 16 |
+
|
| 17 |
+
class ExtractSchema(BaseTool):
|
| 18 |
+
name: str = "ExtractSchema"
|
| 19 |
+
description: str = (
|
| 20 |
+
"This tool is useful for extracting schema of tabular data, which is important to understand"
|
| 21 |
+
"the structure of a dataset for analysis."
|
| 22 |
+
)
|
| 23 |
+
args_schema: Type[BaseModel] = ExtractSchemaInput
|
| 24 |
+
|
| 25 |
+
def _run(self, file_path: str) -> Dict[str, Any]:
|
| 26 |
+
# Implementation goes here
|
| 27 |
+
df = pd.read_csv(file_path)
|
| 28 |
+
return {
|
| 29 |
+
"shape": df.shape,
|
| 30 |
+
"dtypes": df.dtypes.to_dict(),
|
| 31 |
+
"columns": df.columns.tolist(),
|
| 32 |
+
"numeric_cols": df.select_dtypes(include=[np.number]).columns.tolist(),
|
| 33 |
+
"categorical_cols": df.select_dtypes(include=['object']).columns.tolist()
|
| 34 |
+
}
|
mycoder/uv.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
requirements.txt
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
altair
|
| 2 |
-
pandas
|
| 3 |
-
streamlit
|
|
|
|
|
|
|
|
|
|
|
|
src/streamlit_app.py
DELETED
|
@@ -1,40 +0,0 @@
|
|
| 1 |
-
import altair as alt
|
| 2 |
-
import numpy as np
|
| 3 |
-
import pandas as pd
|
| 4 |
-
import streamlit as st
|
| 5 |
-
|
| 6 |
-
"""
|
| 7 |
-
# Welcome to Streamlit!
|
| 8 |
-
|
| 9 |
-
Edit `/streamlit_app.py` to customize this app to your heart's desire :heart:.
|
| 10 |
-
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
|
| 11 |
-
forums](https://discuss.streamlit.io).
|
| 12 |
-
|
| 13 |
-
In the meantime, below is an example of what you can do with just a few lines of code:
|
| 14 |
-
"""
|
| 15 |
-
|
| 16 |
-
num_points = st.slider("Number of points in spiral", 1, 10000, 1100)
|
| 17 |
-
num_turns = st.slider("Number of turns in spiral", 1, 300, 31)
|
| 18 |
-
|
| 19 |
-
indices = np.linspace(0, 1, num_points)
|
| 20 |
-
theta = 2 * np.pi * num_turns * indices
|
| 21 |
-
radius = indices
|
| 22 |
-
|
| 23 |
-
x = radius * np.cos(theta)
|
| 24 |
-
y = radius * np.sin(theta)
|
| 25 |
-
|
| 26 |
-
df = pd.DataFrame({
|
| 27 |
-
"x": x,
|
| 28 |
-
"y": y,
|
| 29 |
-
"idx": indices,
|
| 30 |
-
"rand": np.random.randn(num_points),
|
| 31 |
-
})
|
| 32 |
-
|
| 33 |
-
st.altair_chart(alt.Chart(df, height=700, width=700)
|
| 34 |
-
.mark_point(filled=True)
|
| 35 |
-
.encode(
|
| 36 |
-
x=alt.X("x", axis=None),
|
| 37 |
-
y=alt.Y("y", axis=None),
|
| 38 |
-
color=alt.Color("idx", legend=None, scale=alt.Scale()),
|
| 39 |
-
size=alt.Size("rand", legend=None, scale=alt.Scale(range=[1, 150])),
|
| 40 |
-
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|