Skip to content

Commit

Permalink
Sphinx Docs MVP
Browse files Browse the repository at this point in the history
  • Loading branch information
VVoruganti committed Mar 13, 2024
1 parent 880935d commit 53ef28d
Show file tree
Hide file tree
Showing 12 changed files with 808 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
**/docs/_build/

# PyBuilder
.pybuilder/
Expand Down
20 changes: 20 additions & 0 deletions sdk/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, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
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)
41 changes: 41 additions & 0 deletions sdk/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
import os
import sys

project = "Honcho"
copyright = "2024, Plastic Labs"
author = "Plastic Labs"


sys.path.insert(
0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../honcho"))
)

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
]
autodoc_member_order = "bysource"

autosummary_generate = True

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
viewcode_import = "import honcho"


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "furo"
html_static_path = ["_static"]
33 changes: 33 additions & 0 deletions sdk/docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. Honcho documentation master file, created by
sphinx-quickstart on Wed Mar 13 11:35:31 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Honcho's documentation!
==================================

.. .. automodule:: honcho.client
.. :members:
.. .. automodule:: honcho.sync_client
.. :members:
.. .. automodule:: honcho.ext.langchain
.. :members:
.. .. autosummary::
.. :toctree: _autosummary
.. :recursive:
.. toctree::
:maxdepth: 3
:caption: Contents:

source/modules

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions sdk/docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
21 changes: 21 additions & 0 deletions sdk/docs/source/honcho.ext.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
honcho.ext package
==================

Submodules
----------

honcho.ext.langchain module
---------------------------

.. automodule:: honcho.ext.langchain
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: honcho.ext
:members:
:undoc-members:
:show-inheritance:
53 changes: 53 additions & 0 deletions sdk/docs/source/honcho.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
honcho package
==============

Subpackages
-----------

.. toctree::
:maxdepth: 4

honcho.ext

Submodules
----------

honcho.cache module
-------------------

.. automodule:: honcho.cache
:members:
:undoc-members:
:show-inheritance:

honcho.client module
--------------------

.. automodule:: honcho.client
:members:
:undoc-members:
:show-inheritance:

honcho.schemas module
---------------------

.. automodule:: honcho.schemas
:members:
:undoc-members:
:show-inheritance:

honcho.sync\_client module
--------------------------

.. automodule:: honcho.sync_client
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: honcho
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions sdk/docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
honcho
======

.. toctree::
:maxdepth: 4

honcho
8 changes: 6 additions & 2 deletions sdk/honcho/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def __init__(

async def next(self):
"""Get the next page of results
Returns:
AsyncGetSessionPage | None: Next Page of Results or None if there
are no more sessions to retreive from a query
AsyncGetSessionPage | None: Next Page of Results or None if there are no more sessions to retreive from a query
"""
if self.page >= self.pages:
return None
Expand Down Expand Up @@ -141,6 +141,7 @@ def __init__(self, response: dict, session: AsyncSession, reverse: bool):

async def next(self):
"""Get the next page of results
Returns:
AsyncGetMessagePage | None: Next Page of Results or None if there
are no more messages to retreive from a query
Expand Down Expand Up @@ -189,6 +190,7 @@ def __init__(

async def next(self):
"""Get the next page of results
Returns:
AsyncGetMetamessagePage | None: Next Page of Results or None if
there are no more metamessages to retreive from a query
Expand Down Expand Up @@ -232,6 +234,7 @@ def __init__(self, response: dict, collection, reverse: bool) -> None:

async def next(self):
"""Get the next page of results
Returns:
AsyncGetDocumentPage | None: Next Page of Results or None if there
are no more sessions to retreive from a query
Expand Down Expand Up @@ -269,6 +272,7 @@ def __init__(self, response: dict, user: AsyncUser, reverse: bool):

async def next(self):
"""Get the next page of results
Returns:
AsyncGetCollectionPage | None: Next Page of Results or None if
there are no more sessions to retreive from a query
Expand Down
Loading

0 comments on commit 53ef28d

Please sign in to comment.