Skip to content

Commit

Permalink
Deploying to gh-pages from @ 8ae2f57 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Feb 11, 2024
1 parent 6fbc007 commit b46d23f
Show file tree
Hide file tree
Showing 17 changed files with 487 additions and 5 deletions.
162 changes: 162 additions & 0 deletions _sources/developer.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
.. _developer-docs:

Developer Documentation
========================

This section contains documentation for developers who want to contribute or extend the functionality of the project.

.. _codergpt-cli:

Command Line Interface for CoderGPT
===================================

Overview
--------

This module provides a command line interface (CLI) for CoderGPT, a powerful code generation tool that facilitates various operations on code files such as inspection, explanation, commenting, and optimization.

Usage
-----

To use the CLI, run the following command with the desired options and commands:

.. code-block:: shell
python codergpt_cli.py [OPTIONS] COMMAND [ARGS]...
Options
-------

-v, --verbose INTEGER
Verbosity level (0, 1 or 2).

-q, --quiet
Run in quiet mode.

--version
Show the version and exit.

Commands
--------

inspect
Inspect package to show file-language-map.

explain
Explain the contents of a code file.

comment
Add comments to a code file.

Details
-------

The CLI is built using the Click library and provides a user-friendly way to interact with the CoderGPT functionalities from the terminal.

Examples
--------

Inspecting a package:

.. code-block:: shell
python codergpt_cli.py inspect src/
Explaining a function within a file:

.. code-block:: shell
python codergpt_cli.py explain src/main.py --function my_function
Adding comments to a file:

.. code-block:: shell
python codergpt_cli.py comment src/main.py --overwrite
Optimizing a class within a file:

.. code-block:: shell
python codergpt_cli.py optimize src/main.py --classname MyClass --overwrite
Environment Variables
---------------------

- ``OPENAI_API_KEY``: The API key for OpenAI services required by CoderGPT.

Dependencies
------------

- click
- logging
- pathlib.Path
- typing.TextIO, typing.Union
- codergpt.__version__
- codergpt.main.CoderGPT

.. _main-python-file:

Main Python File
================

This is the main Python file for the CoderGPT project.

Classes
-------

.. autoclass:: CoderGPT
:members:
:undoc-members:
:show-inheritance:

.. automethod:: __init__
.. automethod:: inspect_package
.. automethod:: get_code
.. automethod:: explainer
.. automethod:: commenter
.. automethod:: optimizer
.. automethod:: tester

Description
-----------

The ``CoderGPT`` class provides a suite of methods to interact with code files, including inspection, explanation, commenting, optimization, and testing. It utilizes language models to perform these tasks.

Dependencies
------------

- os
- pathlib.Path
- typing.Optional, typing.Union
- yaml
- langchain_core.prompts.ChatPromptTemplate
- langchain_openai.ChatOpenAI
- tabulate.tabulate
- codergpt.commenter.commenter.CodeCommenter
- codergpt.constants.EXTENSION_MAP_FILE, codergpt.constants.GPT_3_5_TURBO, codergpt.constants.INSPECTION_HEADERS
- codergpt.explainer.explainer.CodeExplainer
- codergpt.optimizer.optimizer.CodeOptimizer

Usage
-----

To use the ``CoderGPT`` class, initialize it with an optional model parameter. Then call its methods with appropriate arguments to perform various operations on code files.

Example:

.. code-block:: python
if __name__ == "__main__":
coder = CoderGPT()
coder.inspect_package("src")
Environment Variables
---------------------

- ``OPENAI_API_KEY``: The API key for OpenAI services.

Files
-----

- ``EXTENSION_MAP_FILE``: YAML file mapping file extensions to programming languages.
1 change: 1 addition & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Welcome to CoderGPT's documentation!
:name: start

description
developer
modules

Indices and tables
Expand Down
3 changes: 3 additions & 0 deletions codergpt.commenter.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<p class="caption" role="heading"><span class="caption-text">Getting Started</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="description.html">CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#command-line-interface-for-codergpt">Command Line Interface for CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#main-python-file">Main Python File</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">codergpt</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="codergpt.html">codergpt package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="codergpt.html#subpackages">Subpackages</a><ul class="current">
Expand Down
3 changes: 3 additions & 0 deletions codergpt.explainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<p class="caption" role="heading"><span class="caption-text">Getting Started</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="description.html">CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#command-line-interface-for-codergpt">Command Line Interface for CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#main-python-file">Main Python File</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">codergpt</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="codergpt.html">codergpt package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="codergpt.html#subpackages">Subpackages</a><ul class="current">
Expand Down
3 changes: 3 additions & 0 deletions codergpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<p class="caption" role="heading"><span class="caption-text">Getting Started</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="description.html">CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#command-line-interface-for-codergpt">Command Line Interface for CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#main-python-file">Main Python File</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">codergpt</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">codergpt package</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#subpackages">Subpackages</a><ul>
Expand Down
3 changes: 3 additions & 0 deletions codergpt.optimizer.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<p class="caption" role="heading"><span class="caption-text">Getting Started</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="description.html">CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#command-line-interface-for-codergpt">Command Line Interface for CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#main-python-file">Main Python File</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">codergpt</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="codergpt.html">codergpt package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="codergpt.html#subpackages">Subpackages</a><ul class="current">
Expand Down
3 changes: 3 additions & 0 deletions codergpt.test_writer.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<p class="caption" role="heading"><span class="caption-text">Getting Started</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="description.html">CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#command-line-interface-for-codergpt">Command Line Interface for CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#main-python-file">Main Python File</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">codergpt</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="codergpt.html">codergpt package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="codergpt.html#subpackages">Subpackages</a><ul class="current">
Expand Down
3 changes: 3 additions & 0 deletions codergpt.utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
<p class="caption" role="heading"><span class="caption-text">Getting Started</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="description.html">CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#command-line-interface-for-codergpt">Command Line Interface for CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#main-python-file">Main Python File</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">codergpt</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="codergpt.html">codergpt package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="codergpt.html#subpackages">Subpackages</a><ul class="current">
Expand Down
7 changes: 5 additions & 2 deletions description.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="codergpt" href="modules.html" />
<link rel="next" title="Developer Documentation" href="developer.html" />
<link rel="prev" title="Welcome to CoderGPT’s documentation!" href="index.html" />
</head>

Expand Down Expand Up @@ -57,6 +57,9 @@
<li class="toctree-l2"><a class="reference internal" href="#development">Development</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer Documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#command-line-interface-for-codergpt">Command Line Interface for CoderGPT</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html#main-python-file">Main Python File</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">codergpt</a></li>
</ul>

Expand Down Expand Up @@ -238,7 +241,7 @@ <h2>Development<a class="headerlink" href="#development" title="Link to this hea
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="index.html" class="btn btn-neutral float-left" title="Welcome to CoderGPT’s documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="modules.html" class="btn btn-neutral float-right" title="codergpt" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="developer.html" class="btn btn-neutral float-right" title="Developer Documentation" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

<hr/>
Expand Down
Loading

0 comments on commit b46d23f

Please sign in to comment.