Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/docsv1 #554

Merged
merged 23 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ To enforce this we use [`pre-commit`](https://pre-commit.com/) to run [`black`](
```bash
$ pip install -e .

# For docs building, install doc dependencies too

$ pip install -e .[doc]

# And then install the `pre-commit` hooks with:

$ pre-commit install
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

github: [antonosika]
patreon: gpt-engineer
patreon: user?u=2497970

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this legit?

19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,22 @@ benchmark
!benchmark/*/prompt

.gpte_consent

.gpte_consent

# docs

docs/_build
docs/__init__
docs/ai
docs/chat_to_files
docs/collect
docs/learning
docs/main
docs/steps/
docs/db
docs/db/

# poetry

poetry.lock
32 changes: 32 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ With an OpenAI API key (preferably with GPT-4 access) run:

- `export OPENAI_API_KEY=[your api key]`

To set API key on windows check the [Windows README](.github/WINDOWS_README.md).
To set API key on windows check the [Windows README](./WINDOWS_README.md).

**Run**:

Expand Down
66 changes: 66 additions & 0 deletions docs/DOCS_BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Building Docs with Sphinx
=========================

This example shows a basic Sphinx docs project with Read the Docs. This project is using `sphinx` with `readthedocs`
project template.

Some useful links are given below to lear and contribute in the project.

📚 [docs/](https://www.sphinx-doc.org/en/master/usage/quickstart.html)<br>
A basic Sphinx project lives in `docs/`, it was generated using Sphinx defaults. All the `*.rst` & `*.md` make up sections in the documentation. Both `.rst` and `.md` formats are supported in this project

⚙️ [.readthedocs.yaml](https://docs.readthedocs.io/en/stable/config-file/v2.html)<br>
Read the Docs Build configuration is stored in `.readthedocs.yaml`.


📍 [docs/requirements.txt](https://docs.readthedocs.io/en/stable/config-file/v2.html)<br>
Python dependencies are [pinned](https://docs.readthedocs.io/en/latest/guides/reproducible-builds.html) (uses [pip-tools](https://pip-tools.readthedocs.io/en/latest/)) here. Make sure to add your Python dependencies to `requirements.txt` or if you choose [pip-tools](https://pip-tools.readthedocs.io/en/latest/), edit `docs/requirements.txt`.



Example Project usage
---------------------

`Poetry` is the package manager for `gpt-engineer`. In order to build documentation, we have to add docs requirements in
development environment.

This project has a standard readthedocs layout which is built by Read the Docs almost the same way that you would build it
locally (on your own laptop!).

You can build and view this documentation project locally - we recommend that you activate a `poetry` or your choice of `venv`
and dependency management tool.

Update `repository_stats.md` file under `docs/intro`

```console
# Install required Python dependencies (MkDocs etc.)
pip install -e .[doc]
cd docs/
# Create the `api_reference.rst`
python create_api_rst.py

# Build the docs
make html
```

Project Docs Structure
----------------------
If you are new to Read the Docs, you may want to refer to the [Read the Docs User documentation](https://docs.readthedocs.io/).

Below is the rundown of documentation structure for `pandasai`, you need to know:

1. place your `docs/` folder alongside your Python project.
2. copy `.readthedocs.yaml` and the `docs/` folder into your project root.
3. `docs/api_reference.rst` contains the API documentation created using `docstring`. Run the `create_api_rst.py` to update the API reference file.
4. Project is using standard Google Docstring Style.
5. Rebuild the documenation locally to see that it works.
6. Documentation are hosted on [Read the Docs tutorial](https://docs.readthedocs.io/en/stable/tutorial/)


Read the Docs tutorial
----------------------

To get started with Read the Docs, you may also refer to the
[Read the Docs tutorial](https://docs.readthedocs.io/en/stable/tutorial/). I

With every release, build the documentation manually.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = gpt_engineer
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
79 changes: 79 additions & 0 deletions docs/RESULTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Benchmarks

```bash
python scripts/benchmark.py
```

## 2023-06-21

| Benchmark | Ran | Works | Perfect |
|--------------------|-----|-------|---------|
| currency_converter ||||
| image_resizer ||||
| pomodoro_timer ||||
| url_shortener ||||
| file_explorer ||||
| markdown_editor ||||
| timer_app ||||
| weather_app ||||
| file_organizer ||||
| password_generator ||||
| todo_list ||||

## Notes on the errors

Most errors come from that the "generate entrypoint" are incorrect. Ignoring
those, we get 8/11 fully correct.

All errors are very easy to fix.

One error was trying to modify a constant.
One error was that the html template was not fully filled in.
One error is that a dependency was used incorrectly and easy to fix

## 2023-06-19

| Benchmark | Ran | Works | Perfect |
|--------------------|-----|-------|---------|
| currency_converter ||||
| image_resizer ||||
| pomodoro_timer ||||
| url_shortener ||||
| file_explorer ||||
| markdown_editor ||||
| timer_app ||||
| weather_app ||||
| file_organizer ||||
| password_generator ||||
| todo_list ||||

## Notes on the errors

**timer_app** almost works with unit tests config

- failure mode: undefined import/conflicting names

**file_explorer** works

**file organiser**: works

**image_resizer** almost works with unit tests config

- failure mode: undefined import

**todo_list** runs. doesn't really work with unit tests config
Uncaught ReferenceError: module is not defined

- failure mode: placeholder text

url_shortener starts but gets the error:
SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 8636125824 and this is thread id 13021003776.

markdown_editor:
failing tests, 'WebDriver' object has no attribute 'find_element_by_id'

pomodoro: doesn't run it only tests

currency_converter: backend doesn't return anything

weather_app only runs test, no code existed
Loading
Loading