Skip to content

Commit 02bfed4

Browse files
committed
add sphinx documentation
1 parent 10f8c21 commit 02bfed4

17 files changed

+337
-3
lines changed

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/README.rst

Whitespace-only changes.

docs/_static/custom.css

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* Change the color of deprecated function messages */
2+
.deprecated {
3+
color: red !important;
4+
font-weight: bold;
5+
}

docs/conf.py

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
project = "weaviate-agents-python-client"
10+
copyright = "2025, Weaviate"
11+
author = "Weaviate"
12+
13+
# -- General configuration ---------------------------------------------------
14+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
15+
16+
# Add any Sphinx extension module names here, as strings. They can be
17+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
18+
# ones.
19+
extensions = [
20+
"sphinx.ext.napoleon",
21+
"sphinx.ext.autodoc",
22+
"sphinx.ext.viewcode",
23+
"sphinx.ext.autosectionlabel",
24+
"sphinxcontrib.autodoc_pydantic",
25+
]
26+
27+
# Autodoc settings for pydantic
28+
autodoc_pydantic_model_show_json = False
29+
autodoc_pydantic_model_show_config_summary = False
30+
autodoc_pydantic_model_show_validator_summary = False
31+
autodoc_pydantic_model_show_validator_members = False
32+
autodoc_pydantic_model_show_field_summary = False
33+
autodoc_pydantic_model_undoc_members = False
34+
autodoc_pydantic_model_members = False
35+
36+
autodoc_typehints = "description"
37+
autodoc_member_order = "bysource"
38+
autodoc_dataclass_fields = False
39+
40+
# Make sure the target is unique
41+
autosectionlabel_prefix_document = True
42+
43+
autoclass_content = "both"
44+
45+
# Add any paths that contain templates here, relative to this directory.
46+
templates_path = ["_templates"]
47+
48+
# List of patterns, relative to source directory, that match files and
49+
# directories to ignore when looking for source files.
50+
# This pattern also affects html_static_path and html_extra_path.
51+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "README.rst"]
52+
53+
suppress_warnings = [
54+
"docutils",
55+
"autodoc",
56+
"autosectionlabel",
57+
]
58+
59+
# -- Options for HTML output -------------------------------------------------
60+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
61+
62+
html_theme = "sphinx_rtd_theme"
63+
html_static_path = ["_static"]
64+
65+
66+
import re
67+
68+
69+
def convert_markdown_links(lines):
70+
"""Convert Markdown-style [text](url) links to reST-style `text <url>`_ links."""
71+
md_link_pattern = re.compile(r"\[([^\]]+)\]\((http[^\)]+)\)")
72+
return [md_link_pattern.sub(r"`\1 <\2>`_", line) for line in lines]
73+
74+
75+
def autodoc_process_docstring(app, what, name, obj, options, lines):
76+
"""Apply the conversion to all docstrings."""
77+
lines[:] = convert_markdown_links(lines)
78+
79+
80+
def setup(app):
81+
app.add_css_file("custom.css")
82+
app.connect("autodoc-process-docstring", autodoc_process_docstring)

docs/index.rst

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.. weaviate-agents-python-client documentation master file, created by
2+
sphinx-quickstart on Thu Apr 10 10:53:19 2025.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
weaviate-agents-python-client documentation
7+
===========================================
8+
9+
Add your content using ``reStructuredText`` syntax. See the
10+
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
11+
documentation for details.
12+
13+
14+
.. toctree::
15+
:maxdepth: 2
16+
:caption: Contents:
17+
18+
weaviate_agents
19+

docs/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/modules.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
weaviate_agents
2+
===============
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
weaviate_agents

docs/requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Sphinx>=7.0.0
2+
sphinx-rtd-theme==3.0.2
3+
sphinx-autodoc-napoleon-typehints==2.1.6
4+
autodoc-pydantic==2.2.0

docs/weaviate_agents.classes.rst

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
weaviate\_agents.classes
2+
========================
3+
4+
.. automodule:: weaviate_agents.classes
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
9+
Subpackages
10+
^^^^^^^^^^^
11+
12+
weaviate\_agents.classes.personalization
13+
----------------------------------------
14+
15+
.. automodule:: weaviate_agents.classes.personalization
16+
:members:
17+
:show-inheritance:
18+
:undoc-members:
19+
20+
weaviate\_agents.classes.query
21+
------------------------------
22+
23+
.. automodule:: weaviate_agents.classes.query
24+
:members:
25+
:show-inheritance:
26+
:undoc-members:
27+
28+
weaviate\_agents.classes.transformation
29+
---------------------------------------
30+
31+
.. automodule:: weaviate_agents.classes.transformation
32+
:members:
33+
:show-inheritance:
34+
:undoc-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
weaviate\_agents.personalization.classes package
2+
================================================
3+
4+
.. automodule:: weaviate_agents.personalization.classes
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
weaviate\_agents.personalization
2+
================================
3+
4+
.. automodule:: weaviate_agents.personalization
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
9+
Subpackages
10+
-----------
11+
12+
.. toctree::
13+
:maxdepth: 4
14+
15+
weaviate_agents.personalization.classes
16+
17+
18+
weaviate\_agents.personalization.personalization\_agent
19+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+
21+
.. automodule:: weaviate_agents.personalization.personalization_agent
22+
:members:
23+
:show-inheritance:
24+
:undoc-members:
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
weaviate\_agents.query.classes
2+
==============================
3+
4+
.. automodule:: weaviate_agents.query.classes
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:

docs/weaviate_agents.query.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
weaviate\_agents.query
2+
======================
3+
4+
.. automodule:: weaviate_agents.query
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
9+
Subpackages
10+
-----------
11+
12+
.. toctree::
13+
:maxdepth: 4
14+
15+
weaviate_agents.query.classes
16+
17+
weaviate\_agents.query.query\_agent
18+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
20+
.. automodule:: weaviate_agents.query.query_agent
21+
:members:
22+
:show-inheritance:
23+
:undoc-members:

docs/weaviate_agents.rst

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
weaviate\_agents
2+
================
3+
4+
.. automodule:: weaviate_agents
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
9+
Subpackages
10+
-----------
11+
12+
.. toctree::
13+
:maxdepth: 2
14+
15+
weaviate_agents.classes
16+
weaviate_agents.personalization
17+
weaviate_agents.query
18+
weaviate_agents.transformation
19+
20+
21+
weaviate\_agents.utils
22+
----------------------
23+
24+
.. automodule:: weaviate_agents.utils
25+
:members:
26+
:show-inheritance:
27+
:undoc-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
weaviate\_agents.transformation.classes
2+
=======================================
3+
4+
.. automodule:: weaviate_agents.transformation.classes
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
weaviate\_agents.transformation
2+
===============================
3+
4+
.. automodule:: weaviate_agents.transformation
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
9+
Subpackages
10+
-----------
11+
12+
.. toctree::
13+
:maxdepth: 4
14+
15+
weaviate_agents.transformation.classes
16+
17+
weaviate\_agents.transformation.transformation\_agent
18+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
20+
.. automodule:: weaviate_agents.transformation.transformation_agent
21+
:members:
22+
:show-inheritance:
23+
:undoc-members:

pyproject.toml

+12-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,18 @@ exclude = [
4040
[tool.setuptools]
4141
license-files = []
4242

43-
[tool.ruff.lint]
44-
select = ["E", "F", "I", "D"]
45-
ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D107", "E501"]
43+
[tool.ruff]
44+
lint.select = ["E", "F", "I", "D"]
45+
lint.ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D107", "E501"]
46+
exclude = [
47+
"tests",
48+
"docs",
49+
"scripts",
50+
"bash",
51+
".venv",
52+
".git",
53+
"__pycache__",
54+
]
4655

4756
# D100: Missing docstring in a public module
4857
# D101: Missing docstring in a public class

0 commit comments

Comments
 (0)