diff --git a/.github/workflows/docs-build.yaml b/.github/workflows/docs-build.yaml index 1d09b610f..65beffc64 100644 --- a/.github/workflows/docs-build.yaml +++ b/.github/workflows/docs-build.yaml @@ -45,7 +45,7 @@ jobs: - name: Configure poetry run: poetry config virtualenvs.in-project true - name: Install dependencies - run: poetry install --only docs + run: poetry install --with docs - name: Build documentation run: make docs - name: Delete unnecessary files diff --git a/docs/conf.py b/docs/conf.py index ec3f73374..d6ef22860 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,6 +33,7 @@ "sphinx.ext.intersphinx", "sphinx_copybutton", "sphinx_reredirects", + "sphinxcontrib.autodoc_pydantic", ] redirects = { diff --git a/docs/configuration.rst b/docs/configuration.rst new file mode 100644 index 000000000..f69247ca8 --- /dev/null +++ b/docs/configuration.rst @@ -0,0 +1,10 @@ +.. + SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + SPDX-License-Identifier: Apache-2.0 + +############################ +Configuration File Reference +############################ + +.. automodule:: nemoguardrails.rails.llm.config + :members: diff --git a/docs/index.md b/docs/index.md index 9f8339f6c..754e1e24b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -112,6 +112,7 @@ user-guides/advanced/safeguarding-ai-virtual-assistant-blueprint :hidden: architecture/index +configuration glossary faqs ``` diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 0cdb28b6c..000000000 --- a/docs/index.rst +++ /dev/null @@ -1,102 +0,0 @@ -NVIDIA NeMo Guardrails -==================================================== - -.. toctree:: - :caption: NVIDIA NeMo Guardrails - :name: NVIDIA NeMo Guardrails - :maxdepth: 1 - - introduction.md - documentation.md - getting-started/installation-guide - -.. toctree:: - :caption: Getting Started - :name: Getting Started - :maxdepth: 2 - - getting-started/1-hello-world/README - getting-started/2-core-colang-concepts/README - getting-started/3-demo-use-case/README - getting-started/4-input-rails/README - getting-started/5-output-rails/README - getting-started/6-topical-rails/README - getting-started/7-rag/README - -.. toctree:: - :caption: Colang 2.0 - :name: Colang 2.0 - :maxdepth: 2 - - colang-2/overview - colang-2/whats-changed - colang-2/getting-started/index - colang-2/language-reference/index - -.. toctree:: - :caption: User Guides - :name: User Guides - :maxdepth: 2 - - user-guides/configuration-guide - user-guides/guardrails-library - user-guides/guardrails-process - user-guides/colang-language-syntax-guide - user-guides/llm-support - user-guides/python-api - user-guides/cli - user-guides/server-guide - user-guides/langchain/index - user-guides/detailed-logging/index - user-guides/jailbreak-detection-heuristics/index - user-guides/llm/index - user-guides/multi-config-api/index - user-guides/migration-guide - -.. toctree:: - :caption: Security - :name: Security - :maxdepth: 2 - - security/guidelines - security/red-teaming - -.. toctree:: - :caption: Evaluation - :name: Evaluation - :maxdepth: 2 - - evaluation/README - evaluation/llm-vulnerability-scanning - -.. toctree:: - :caption: Advanced User Guides - :name: Advanced User Guides - :maxdepth: 2 - - user-guides/advanced/generation-options - user-guides/advanced/prompt-customization - user-guides/advanced/embedding-search-providers - user-guides/advanced/using-docker - user-guides/advanced/streaming - user-guides/advanced/align-score-deployment - user-guides/advanced/extract-user-provided-values - user-guides/advanced/bot-message-instructions - user-guides/advanced/event-based-api - user-guides/advanced/llama-guard-deployment - user-guides/advanced/nested-async-loop - user-guides/advanced/vertexai-setup - user-guides/advanced/nemoguard-contentsafety-deployment - user-guides/advanced/nemoguard-topiccontrol-deployment - user-guides/advanced/jailbreak-detection-heuristics-deployment - user-guides/advanced/safeguarding-ai-virtual-assistant-blueprint - -.. toctree:: - :caption: Other - :name: Other - :maxdepth: 2 - - architecture/index - glossary - faqs - changes diff --git a/poetry.lock b/poetry.lock index 975ec9a7d..87df023b1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "accessible-pygments" @@ -290,6 +290,29 @@ docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphi tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] +[[package]] +name = "autodoc-pydantic" +version = "2.2.0" +description = "Seamlessly integrate pydantic models in your Sphinx documentation." +optional = false +python-versions = "<4.0.0,>=3.8.1" +files = [ + {file = "autodoc_pydantic-2.2.0-py3-none-any.whl", hash = "sha256:8c6a36fbf6ed2700ea9c6d21ea76ad541b621fbdf16b5a80ee04673548af4d95"}, +] + +[package.dependencies] +pydantic = ">=2.0,<3.0.0" +pydantic-settings = ">=2.0,<3.0.0" +Sphinx = ">=4.0" + +[package.extras] +docs = ["myst-parser (>=3.0.0,<4.0.0)", "sphinx-copybutton (>=0.5.0,<0.6.0)", "sphinx-rtd-theme (>=2.0.0,<3.0.0)", "sphinx-tabs (>=3,<4)", "sphinxcontrib-mermaid (>=0.9.0,<0.10.0)"] +erdantic = ["erdantic (<2.0)"] +linting = ["ruff (>=0.4.0,<0.5.0)"] +security = ["pip-audit (>=2.7.2,<3.0.0)"] +test = ["coverage (>=7,<8)", "defusedxml (>=0.7.1)", "pytest (>=8.0.0,<9.0.0)", "pytest-sugar (>=1.0.0,<2.0.0)"] +type-checking = ["mypy (>=1.9,<2.0)", "types-docutils (>=0.20,<0.21)", "typing-extensions (>=4.11,<5.0)"] + [[package]] name = "azure-core" version = "1.32.0" @@ -5932,4 +5955,4 @@ tracing = ["aiofiles", "opentelemetry-api", "opentelemetry-sdk"] [metadata] lock-version = "2.0" python-versions = ">=3.9,!=3.9.7,<3.12" -content-hash = "bdfaa9bc818141fb4306445fb3650d3371bab53decf3971978e2f86e4775a95e" +content-hash = "9edcaa4f532315e065b5c91f7aa908d5c470b3e8d23171696683e809cb2b28f1" diff --git a/pyproject.toml b/pyproject.toml index 112f3317b..3185f06e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,6 +148,7 @@ sphinx = "<=7.5" myst-parser = "<=5" sphinx-copybutton = "<=0.6" nvidia-sphinx-theme = "*" +autodoc-pydantic = "^2.2.0" [tool.pytest.ini_options]