mirror of
				https://github.com/microsoft/autogen.git
				synced 2025-11-04 11:49:45 +00:00 
			
		
		
		
	Add initial docs site (#15)
* Add initial docs site * add ci and readme * Update checks.yml * Update conf.py
This commit is contained in:
		
							parent
							
								
									d941a0a733
								
							
						
					
					
						commit
						0299009244
					
				
							
								
								
									
										10
									
								
								.github/workflows/checks.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.github/workflows/checks.yml
									
									
									
									
										vendored
									
									
								
							@ -63,3 +63,13 @@ jobs:
 | 
			
		||||
          python-version: ${{ matrix.python-version }}
 | 
			
		||||
      - run: pip install ".[dev]"
 | 
			
		||||
      - run: pytest
 | 
			
		||||
 | 
			
		||||
  docs:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: actions/checkout@v4
 | 
			
		||||
      - uses: actions/setup-python@v5
 | 
			
		||||
        with:
 | 
			
		||||
          python-version: '3.10'
 | 
			
		||||
      - run: pip install ".[docs]"
 | 
			
		||||
      - run: sphinx-build --fail-on-warning docs/src docs/build
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										43
									
								
								.github/workflows/docs.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								.github/workflows/docs.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,43 @@
 | 
			
		||||
# Simple workflow for deploying static content to GitHub Pages
 | 
			
		||||
name: Docs
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  # Runs on pushes targeting the default branch
 | 
			
		||||
  push:
 | 
			
		||||
    branches: ["main"]
 | 
			
		||||
 | 
			
		||||
  # Allows you to run this workflow manually from the Actions tab
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
 | 
			
		||||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
 | 
			
		||||
permissions:
 | 
			
		||||
  contents: read
 | 
			
		||||
  pages: write
 | 
			
		||||
  id-token: write
 | 
			
		||||
 | 
			
		||||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
 | 
			
		||||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
 | 
			
		||||
concurrency:
 | 
			
		||||
  group: "pages"
 | 
			
		||||
  cancel-in-progress: false
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  deploy:
 | 
			
		||||
    environment:
 | 
			
		||||
      name: github-pages
 | 
			
		||||
      url: ${{ steps.deployment.outputs.page_url }}
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Checkout
 | 
			
		||||
        uses: actions/checkout@v4
 | 
			
		||||
      - name: Setup Pages
 | 
			
		||||
        uses: actions/configure-pages@v5
 | 
			
		||||
      - run: pip install ".[docs]"
 | 
			
		||||
      - run: sphinx-build docs/src docs/build
 | 
			
		||||
      - name: Upload artifact
 | 
			
		||||
        uses: actions/upload-pages-artifact@v3
 | 
			
		||||
        with:
 | 
			
		||||
          path: 'docs/build/html'
 | 
			
		||||
      - name: Deploy to GitHub Pages
 | 
			
		||||
        id: deployment
 | 
			
		||||
        uses: actions/deploy-pages@v4
 | 
			
		||||
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -160,3 +160,5 @@ cython_debug/
 | 
			
		||||
#.idea/
 | 
			
		||||
 | 
			
		||||
.ruff_cache/
 | 
			
		||||
 | 
			
		||||
/docs/src/reference
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								README.md
									
									
									
									
									
								
							@ -46,3 +46,14 @@ ruff check
 | 
			
		||||
```sh
 | 
			
		||||
ruff format
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Build docs
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
pip install -e ".[docs]"
 | 
			
		||||
 | 
			
		||||
sphinx-build docs/src docs/build
 | 
			
		||||
 | 
			
		||||
# To view the docs:
 | 
			
		||||
python -m http.server -d docs/build/html
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										8
									
								
								docs/src/_apidoc_templates/module.rst_t
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								docs/src/_apidoc_templates/module.rst_t
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
{%- if show_headings %}
 | 
			
		||||
{{- basename | e | heading }}
 | 
			
		||||
 | 
			
		||||
{% endif -%}
 | 
			
		||||
.. automodule:: {{ qualname }}
 | 
			
		||||
{%- for option in automodule_options %}
 | 
			
		||||
   :{{ option }}:
 | 
			
		||||
{%- endfor %}
 | 
			
		||||
							
								
								
									
										53
									
								
								docs/src/_apidoc_templates/package.rst_t
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								docs/src/_apidoc_templates/package.rst_t
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
			
		||||
{%- macro automodule(modname, options) -%}
 | 
			
		||||
.. automodule:: {{ modname }}
 | 
			
		||||
{%- for option in options %}
 | 
			
		||||
   :{{ option }}:
 | 
			
		||||
{%- endfor %}
 | 
			
		||||
{%- endmacro %}
 | 
			
		||||
 | 
			
		||||
{%- macro toctree(docnames) -%}
 | 
			
		||||
.. toctree::
 | 
			
		||||
   :maxdepth: {{ maxdepth }}
 | 
			
		||||
   :hidden:
 | 
			
		||||
{% for docname in docnames %}
 | 
			
		||||
   {{ docname }}
 | 
			
		||||
{%- endfor %}
 | 
			
		||||
{%- endmacro %}
 | 
			
		||||
 | 
			
		||||
{%- if is_namespace %}
 | 
			
		||||
{{- [pkgname, "namespace"] | join(" ") | e | heading }}
 | 
			
		||||
{% else %}
 | 
			
		||||
{{- pkgname | e | heading }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{%- if is_namespace %}
 | 
			
		||||
.. py:module:: {{ pkgname }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{%- if modulefirst and not is_namespace %}
 | 
			
		||||
{{ automodule(pkgname, automodule_options) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{%- if subpackages %}
 | 
			
		||||
 | 
			
		||||
{{ toctree(subpackages) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 | 
			
		||||
{%- if submodules %}
 | 
			
		||||
 | 
			
		||||
{% if separatemodules %}
 | 
			
		||||
{{ toctree(submodules) }}
 | 
			
		||||
{% else %}
 | 
			
		||||
{%- for submodule in submodules %}
 | 
			
		||||
{% if show_headings %}
 | 
			
		||||
{{- [submodule, "module"] | join(" ") | e | heading(2) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{{ automodule(submodule, automodule_options) }}
 | 
			
		||||
{% endfor %}
 | 
			
		||||
{%- endif %}
 | 
			
		||||
{%- endif %}
 | 
			
		||||
 | 
			
		||||
{%- if not modulefirst and not is_namespace %}
 | 
			
		||||
 | 
			
		||||
{{ automodule(pkgname, automodule_options) }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
							
								
								
									
										48
									
								
								docs/src/conf.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								docs/src/conf.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
			
		||||
# 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
 | 
			
		||||
 | 
			
		||||
project = "agnext"
 | 
			
		||||
copyright = "2024, Microsoft"
 | 
			
		||||
author = "Microsoft"
 | 
			
		||||
 | 
			
		||||
# -- General configuration ---------------------------------------------------
 | 
			
		||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
 | 
			
		||||
 | 
			
		||||
extensions = [
 | 
			
		||||
    "sphinx.ext.autodoc",
 | 
			
		||||
    "sphinx.ext.autosummary",
 | 
			
		||||
    "sphinx.ext.napoleon",
 | 
			
		||||
    "sphinxcontrib.apidoc"
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
apidoc_module_dir = '../../src/agnext'
 | 
			
		||||
apidoc_output_dir = 'reference'
 | 
			
		||||
apidoc_template_dir = '_apidoc_templates'
 | 
			
		||||
apidoc_separate_modules = True
 | 
			
		||||
apidoc_extra_args = ["--no-toc"]
 | 
			
		||||
 | 
			
		||||
templates_path = []
 | 
			
		||||
exclude_patterns = ["reference/agnext.rst"]
 | 
			
		||||
 | 
			
		||||
autoclass_content = "init"
 | 
			
		||||
 | 
			
		||||
# Guides and tutorials must succeed.
 | 
			
		||||
nb_execution_raise_on_error = True
 | 
			
		||||
nb_execution_timeout = 60
 | 
			
		||||
 | 
			
		||||
# -- Options for HTML output -------------------------------------------------
 | 
			
		||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
 | 
			
		||||
 | 
			
		||||
html_theme = "furo"
 | 
			
		||||
html_static_path = []
 | 
			
		||||
 | 
			
		||||
html_theme_options = {
 | 
			
		||||
    "source_repository": "https://github.com/microsoft/agnext",
 | 
			
		||||
    "source_branch": "main",
 | 
			
		||||
    "source_directory": "docs/src/",
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								docs/src/index.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								docs/src/index.rst
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
			
		||||
agnext
 | 
			
		||||
------
 | 
			
		||||
 | 
			
		||||
.. toctree::
 | 
			
		||||
    :caption: Reference
 | 
			
		||||
    :hidden:
 | 
			
		||||
 | 
			
		||||
    reference/agnext.agent_components
 | 
			
		||||
    reference/agnext.application_components
 | 
			
		||||
    reference/agnext.chat
 | 
			
		||||
    reference/agnext.core
 | 
			
		||||
@ -17,6 +17,7 @@ dependencies = ["openai>=1.3", "pillow", "aiohttp", "typing-extensions"]
 | 
			
		||||
 | 
			
		||||
[project.optional-dependencies]
 | 
			
		||||
dev = ["ruff", "pyright", "mypy", "pytest", "pytest-asyncio", "types-Pillow"]
 | 
			
		||||
docs = [ "sphinx", "furo", "sphinxcontrib-apidoc"]
 | 
			
		||||
 | 
			
		||||
[tool.setuptools.package-data]
 | 
			
		||||
agnext = ["py.typed"]
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,3 @@
 | 
			
		||||
"""
 | 
			
		||||
The :mod:`agnext.agent_components` module provides building blocks for creating single agents
 | 
			
		||||
"""
 | 
			
		||||
@ -0,0 +1,3 @@
 | 
			
		||||
"""
 | 
			
		||||
The :mod:`agnext.application_components` module provides implementations of core components that are used to compose an application
 | 
			
		||||
"""
 | 
			
		||||
@ -0,0 +1,3 @@
 | 
			
		||||
"""
 | 
			
		||||
The :mod:`agnext.chat` module is the concrete implementation of multi-agent interaction patterns
 | 
			
		||||
"""
 | 
			
		||||
@ -0,0 +1,3 @@
 | 
			
		||||
"""
 | 
			
		||||
The :mod:`agnext.core` module provides the foundational generic interfaces upon which all else is built. This module must not depend on any other module.
 | 
			
		||||
"""
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user