Skip to content

Commit d0e611c

Browse files
jsonbaileyclaude
andcommitted
feat: Publish openai provider API reference via RTD subproject
Moves the existing server-ai Sphinx docs setup (previously at the repo root) into packages/sdk/server-ai/ so each package's docs live next to its code, and adds an equivalent docs setup for the openai provider package at packages/ai-providers/server-ai-openai/. Two Read the Docs features make this work: - Monorepo support via per-package .readthedocs.yaml files, selected in the RTD admin UI's "Build configuration file" field. - Subprojects: the new openai RTD project will be linked under the existing launchdarkly-python-sdk-ai parent, served at /projects/openai/. Follow-up RTD dashboard work is required (outside this PR): create the new openai RTD project, point the existing parent project at the new config path, add an automation rule for openai version tags, and attach the openai project as a subproject of the parent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 20df94b commit d0e611c

18 files changed

Lines changed: 185 additions & 24 deletions

File tree

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
PYTEST_FLAGS=-W error::SyntaxWarning
22

3-
SPHINXOPTS = -W --keep-going
4-
SPHINXBUILD = sphinx-build
5-
SPHINXPROJ = launchdarkly-server-sdk
6-
SOURCEDIR = docs
7-
BUILDDIR = $(SOURCEDIR)/build
8-
93
# Package paths
104
SERVER_AI_PKG = packages/sdk/server-ai
115
LANGCHAIN_PKG = packages/ai-providers/server-ai-langchain
@@ -105,5 +99,12 @@ build-openai: #! Build openai provider package
10599
#
106100

107101
.PHONY: docs
108-
docs: #! Generate sphinx-based documentation
109-
$(MAKE) -C $(SERVER_AI_PKG) docs DOCS_DIR=../../../$(SOURCEDIR) DOCS_BUILD_DIR=../../../$(BUILDDIR)
102+
docs: docs-server-ai docs-openai #! Generate sphinx docs for all documented packages
103+
104+
.PHONY: docs-server-ai
105+
docs-server-ai: #! Generate sphinx docs for server-ai package
106+
$(MAKE) -C $(SERVER_AI_PKG) docs
107+
108+
.PHONY: docs-openai
109+
docs-openai: #! Generate sphinx docs for openai provider package
110+
$(MAKE) -C $(OPENAI_PKG) docs
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
3+
sphinx:
4+
builder: html
5+
configuration: packages/ai-providers/server-ai-openai/docs/conf.py
6+
fail_on_warning: true
7+
8+
build:
9+
os: ubuntu-24.04
10+
tools:
11+
python: "3.12"
12+
jobs:
13+
pre_create_environment:
14+
- asdf plugin add uv
15+
- asdf install uv latest
16+
- asdf global uv latest
17+
create_environment:
18+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
19+
install:
20+
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --project packages/ai-providers/server-ai-openai --group docs

packages/ai-providers/server-ai-openai/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@ lint: install
2727
build: #! Build distribution files
2828
build: install
2929
uv build --out-dir dist
30+
31+
.PHONY: docs
32+
docs: #! Generate sphinx-based documentation
33+
uv sync --group docs
34+
uv run sphinx-build -W --keep-going -M html docs docs/build

docs/_static/.gitkeep renamed to packages/ai-providers/server-ai-openai/docs/_static/.gitkeep

File renamed without changes.

docs/_templates/.gitkeep renamed to packages/ai-providers/server-ai-openai/docs/_templates/.gitkeep

File renamed without changes.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
OpenAI Provider API
2+
====================
3+
4+
ldai_openai.openai_runner_factory
5+
----------------------------------
6+
7+
.. automodule:: ldai_openai.openai_runner_factory
8+
:members:
9+
:special-members: __init__
10+
11+
ldai_openai.openai_model_runner
12+
--------------------------------
13+
14+
.. automodule:: ldai_openai.openai_model_runner
15+
:members:
16+
:special-members: __init__
17+
18+
ldai_openai.openai_agent_runner
19+
--------------------------------
20+
21+
.. automodule:: ldai_openai.openai_agent_runner
22+
:members:
23+
:special-members: __init__
24+
25+
ldai_openai.openai_agent_graph_runner
26+
--------------------------------------
27+
28+
.. automodule:: ldai_openai.openai_agent_graph_runner
29+
:members:
30+
:special-members: __init__
31+
32+
ldai_openai.openai_helper
33+
--------------------------
34+
35+
.. automodule:: ldai_openai.openai_helper
36+
:members:
37+
:special-members: __init__
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# -*- coding: utf-8 -*-
2+
# type: ignore
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
import os
12+
import sys
13+
from importlib.metadata import version as _pkg_version
14+
15+
# Add the openai provider package source to the path
16+
sys.path.insert(0, os.path.abspath('../src'))
17+
18+
import ldai_openai # noqa: F401
19+
20+
# -- Project information -----------------------------------------------------
21+
22+
project = u'launchdarkly-server-sdk-ai-openai'
23+
copyright = u'2026, LaunchDarkly'
24+
author = u'LaunchDarkly'
25+
26+
# The short X.Y version.
27+
version = _pkg_version('launchdarkly-server-sdk-ai-openai')
28+
# The full version, including alpha/beta/rc tags.
29+
release = version
30+
31+
32+
# -- General configuration ---------------------------------------------------
33+
34+
extensions = [
35+
'sphinx.ext.autodoc',
36+
'sphinx.ext.coverage',
37+
'sphinx.ext.viewcode',
38+
'sphinx.ext.intersphinx',
39+
]
40+
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ['_templates']
43+
44+
# The suffix(es) of source filenames.
45+
source_suffix = '.rst'
46+
47+
# The master toctree document.
48+
master_doc = 'index'
49+
50+
# The language for content autogenerated by Sphinx.
51+
language = 'en'
52+
53+
# List of patterns, relative to source directory, that match files and
54+
# directories to ignore when looking for source files.
55+
exclude_patterns = ['build']
56+
57+
# The name of the Pygments (syntax highlighting) style to use.
58+
pygments_style = 'sphinx'
59+
60+
61+
# -- Options for HTML output -------------------------------------------------
62+
63+
# RTD sets html_theme = 'sphinx_rtd_theme' itself
64+
65+
# Add any paths that contain custom static files (such as style sheets) here,
66+
# relative to this directory.
67+
html_static_path = ['_static']
68+
69+
70+
# -- Options for HTMLHelp output ---------------------------------------------
71+
72+
# Output file base name for HTML help builder.
73+
htmlhelp_basename = 'launchdarkly-server-sdk-ai-openai-doc'
74+
75+
76+
# -- Extension configuration -------------------------------------------------
77+
78+
intersphinx_mapping = {
79+
'python': ('https://docs.python.org/3', None),
80+
'ldai': ('https://launchdarkly-python-sdk-ai.readthedocs.io/en/latest/', None),
81+
}
82+
83+
autodoc_default_options = {
84+
'undoc-members': False
85+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
LaunchDarkly Server-Side AI SDK — OpenAI Provider
2+
==================================================
3+
4+
This is the API reference for the OpenAI provider package of the `LaunchDarkly <https://launchdarkly.com/>`_ Server-Side AI SDK for Python.
5+
6+
The latest version of this package is on `PyPI <https://pypi.org/project/launchdarkly-server-sdk-ai-openai/>`_, and the source code is on `GitHub <https://github.com/launchdarkly/python-server-sdk-ai>`_.
7+
8+
This package extends the main `launchdarkly-server-sdk-ai <https://launchdarkly-python-sdk-ai.readthedocs.io/en/latest/>`_ package with OpenAI-specific runners. See that documentation for general usage of the AI SDK.
9+
10+
Any types, functions, or constants that are not specifically described in this API reference should be considered implementation details that are not supported for external use; LaunchDarkly reserves the right to change them at any time and application code should not rely on them.
11+
12+
.. toctree::
13+
:maxdepth: 2
14+
:caption: Contents:
15+
16+
api

packages/ai-providers/server-ai-openai/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ dev = [
4141
"isort>=5.12.0",
4242
"openai-agents>=0.0.1",
4343
]
44+
docs = [
45+
"sphinx>=6,<8",
46+
"sphinx-rtd-theme>=1.3,<4.0",
47+
]
4448

4549
[build-system]
4650
requires = ["hatchling"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22

33
sphinx:
44
builder: html
5-
configuration: docs/conf.py
5+
configuration: packages/sdk/server-ai/docs/conf.py
66
fail_on_warning: true
77

88
build:

0 commit comments

Comments
 (0)