Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc generation workflow #862

Merged
merged 42 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
66d69bf
Update doc generation workflow
keepingitneil Oct 7, 2024
817135d
PR on branch so GH is aware of it
keepingitneil Oct 7, 2024
8182969
update name
keepingitneil Oct 7, 2024
5bab673
try something else
keepingitneil Oct 7, 2024
5140560
udpate plugins
keepingitneil Oct 7, 2024
1c6a125
pybind
keepingitneil Oct 7, 2024
142ed1d
wayland
keepingitneil Oct 7, 2024
8cf88fa
wayland
keepingitneil Oct 7, 2024
459cbf5
more deps
keepingitneil Oct 7, 2024
c09985b
try something else
keepingitneil Oct 7, 2024
7e7a80a
remove browser
keepingitneil Oct 7, 2024
68a2898
use venv
keepingitneil Oct 7, 2024
1f2dd9e
tweaks
keepingitneil Oct 7, 2024
49c8495
python 3.12
keepingitneil Oct 7, 2024
06ed469
download ffi
keepingitneil Oct 7, 2024
b64c138
download from installed package
keepingitneil Oct 7, 2024
fa49d7b
site packages
keepingitneil Oct 7, 2024
eb58003
download ffi
keepingitneil Oct 7, 2024
310f285
ffi
keepingitneil Oct 7, 2024
a34df7c
ffi from rust clone
keepingitneil Oct 8, 2024
4c93d6b
livekit isntall
keepingitneil Oct 8, 2024
35dd34c
download ffi'
keepingitneil Oct 8, 2024
fe8f107
livekit-protocol
keepingitneil Oct 8, 2024
40e099f
exlude the ffi
keepingitneil Oct 8, 2024
be7498a
skip
keepingitneil Oct 8, 2024
7f7717a
exclude non exported modules
keepingitneil Oct 8, 2024
5b1bb5a
remove unused
keepingitneil Oct 8, 2024
2ff345c
send to test dir to prevent cache
keepingitneil Oct 8, 2024
90648db
remove ffi step
keepingitneil Oct 8, 2024
01a8e7c
fix modules
keepingitneil Oct 8, 2024
e2e78e7
test dir
keepingitneil Oct 8, 2024
0e5d286
Merge branch 'main' into neil/docs
keepingitneil Oct 8, 2024
2d023be
Fix voice pipeline agent
keepingitneil Oct 8, 2024
04f8f0e
back to python
keepingitneil Oct 8, 2024
c745e89
remove on PR
keepingitneil Oct 8, 2024
6e216c7
publish docs workflow
keepingitneil Oct 8, 2024
4700169
fix ruff
keepingitneil Oct 8, 2024
76659ce
proper path
keepingitneil Oct 8, 2024
302f9a4
Create tame-cows-listen.md
keepingitneil Oct 8, 2024
e55edec
Delete .changeset/tame-cows-listen.md
keepingitneil Oct 9, 2024
0a96b2a
Update livekit-plugins/livekit-plugins-nltk/livekit/plugins/nltk/__in…
keepingitneil Oct 9, 2024
501d114
module -> _module
keepingitneil Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/tame-cows-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"livekit-agents": patch
"livekit-plugins-anthropic": patch
"livekit-plugins-azure": patch
"livekit-plugins-browser": patch
"livekit-plugins-cartesia": patch
"livekit-plugins-deepgram": patch
"livekit-plugins-elevenlabs": patch
"livekit-plugins-google": patch
"livekit-plugins-nltk": patch
"livekit-plugins-openai": patch
"livekit-plugins-playht": patch
"livekit-plugins-rag": patch
"livekit-plugins-silero": patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to patch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to be noisy otherwise

---

Update doc generation workflow
59 changes: 59 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish docs

on:
workflow_dispatch:
workflow_call:
secrets:
DOCS_DEPLOY_AWS_ACCESS_KEY: {}
DOCS_DEPLOY_AWS_API_SECRET: {}

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
lfs: true

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # Specify the Python version you want to use

- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate

- name: Install pdoc and other dependencies
run: |
source venv/bin/activate
python -m pip install pdoc3 setuptools

- name: Install package
run: |
source venv/bin/activate
python -m pip install ./livekit-agents \
./livekit-plugins/livekit-plugins-anthropic \
./livekit-plugins/livekit-plugins-azure \
./livekit-plugins/livekit-plugins-cartesia \
./livekit-plugins/livekit-plugins-deepgram \
./livekit-plugins/livekit-plugins-elevenlabs \
./livekit-plugins/livekit-plugins-google \
./livekit-plugins/livekit-plugins-nltk \
./livekit-plugins/livekit-plugins-openai

- name: Build Docs
run: |
source venv/bin/activate
python -m pdoc --skip-errors --html livekit --output-dir docs

- name: S3 Upload
run: |
source venv/bin/activate
aws s3 cp docs/ s3://livekit-docs/python --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
AWS_DEFAULT_REGION: "us-east-1"
42 changes: 7 additions & 35 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,38 +107,10 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

docs:
if: ${{ fromJson(needs.bump.outputs.packages)[0] != null }}
needs:
- bump
- publish
strategy:
matrix:
package: ${{ fromJSON(needs.bump.outputs.packages) }}

runs-on: ubuntu-latest
env:
package: ${{ matrix.package.name }}
module: $(echo "${{ startsWith(matrix.package.name, 'livekit-plugin') && 'livekit-plugins/' || '' }}${{ matrix.package.name }}" | tr '-' '/')

steps:
- uses: actions/checkout@v4
with:
submodules: true
lfs: true

- name: Install pdoc
run: python -m pip install --upgrade pdoc

- name: Install package
run: python -m pip install $package/

- name: Build Docs
run: python -m pdoc $module --docformat=google --output-dir docs

- name: S3 Upload
run: aws s3 cp docs/ s3://livekit-docs/$package --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
AWS_DEFAULT_REGION: "us-east-1"
trigger-docs-publish:
name: Publish Docs
needs: publish
uses: ./.github/workflows/publish-docs.yaml
secrets:
DOCS_DEPLOY_AWS_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_AWS_ACCESS_KEY }}
DOCS_DEPLOY_AWS_API_SECRET: ${{ secrets.DOCS_DEPLOY_AWS_API_SECRET }}
11 changes: 11 additions & 0 deletions livekit-agents/livekit/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from . import (
cli,
ipc,
llm,
multimodal,
Expand Down Expand Up @@ -57,7 +58,17 @@
"pipeline",
"multimodal",
"voice_assistant",
"cli",
"AssignmentTimeoutError",
"ATTRIBUTE_AGENT_STATE",
"AgentState",
]

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
4 changes: 4 additions & 0 deletions livekit-agents/livekit/agents/pipeline/pipeline_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ class AgentTranscriptionOptions:


class VoicePipelineAgent(utils.EventEmitter[EventTypes]):
"""
A pipeline agent (VAD + STT + LLM + TTS) implementation.
"""

MIN_TIME_PLAYED_FOR_COMMIT = 1.5
"""Minimum time played for the user speech to be committed to the chat context"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@ def __init__(self) -> None:


Plugin.register_plugin(AnthropicPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ def __init__(self):


Plugin.register_plugin(AzurePlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ def __init__(self):


Plugin.register_plugin(BrowserPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like pdoc if a directory has an init.py, pdoc is considering it a submodule. Even if it's not in all. Technically these modules are importable in a normal, non-package setup, so I guess it makes sense as a default behavior.

Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ def __init__(self):


Plugin.register_plugin(CartesiaPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ def download_files(self):


Plugin.register_plugin(ClovaSTTPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,12 @@ def __init__(self):


Plugin.register_plugin(DeepgramPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,12 @@ def __init__(self):


Plugin.register_plugin(ElevenLabsPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ def __init__(self):


Plugin.register_plugin(GooglePlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ def download_files(self):


Plugin.register_plugin(NltkPlugin())

# Cleanup docs of unexported modules
module = dir()
keepingitneil marked this conversation as resolved.
Show resolved Hide resolved
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ def __init__(self) -> None:


Plugin.register_plugin(OpenAIPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ def download_files(self) -> None:


Plugin.register_plugin(PlayHTPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Any, List, Literal

import aiohttp

from livekit.agents import tts, utils

from .log import logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ def download_files(self) -> None:


Plugin.register_plugin(RAGPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ def __init__(self):


Plugin.register_plugin(SileroPlugin())

# Cleanup docs of unexported modules
module = dir()
NOT_IN_ALL = [m for m in module if m not in __all__]

__pdoc__ = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Loading