More fixes for missing packages
This commit is contained in:
@@ -4,12 +4,74 @@ build:
|
|||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
tools:
|
tools:
|
||||||
python: '3.12'
|
python: '3.12'
|
||||||
|
jobs:
|
||||||
|
pre_build:
|
||||||
|
# Commands to run before the build
|
||||||
|
- python -m pip install --upgrade pip
|
||||||
|
- pip install wheel setuptools
|
||||||
|
post_create_environment:
|
||||||
|
# Install system dependencies required by some packages
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y portaudio19-dev python3-pyaudio
|
||||||
|
post_build:
|
||||||
|
# Commands to run after the build
|
||||||
|
- echo "Build completed"
|
||||||
|
|
||||||
sphinx:
|
sphinx:
|
||||||
configuration: docs/api/conf.py
|
configuration: docs/api/conf.py
|
||||||
|
fail_on_warning: false # Set to true if you want builds to fail on warnings
|
||||||
|
|
||||||
python:
|
python:
|
||||||
install:
|
install:
|
||||||
- requirements: docs/api/requirements.txt
|
- requirements: docs/api/requirements-base.txt
|
||||||
|
# Try to install Riva first, fall back to PlayHT if it fails
|
||||||
|
- requirements: docs/api/requirements-riva.txt || true
|
||||||
|
- requirements: docs/api/requirements-playht.txt || true
|
||||||
- method: pip
|
- method: pip
|
||||||
path: .
|
path: .
|
||||||
|
extra_requirements:
|
||||||
|
- anthropic
|
||||||
|
- assemblyai
|
||||||
|
- aws
|
||||||
|
- azure
|
||||||
|
- canonical
|
||||||
|
- cartesia
|
||||||
|
- deepgram
|
||||||
|
- elevenlabs
|
||||||
|
- fal
|
||||||
|
- fireworks
|
||||||
|
- gladia
|
||||||
|
- google
|
||||||
|
- grok
|
||||||
|
- groq
|
||||||
|
- krisp
|
||||||
|
- langchain
|
||||||
|
- livekit
|
||||||
|
- lmnt
|
||||||
|
- moondream
|
||||||
|
- nim
|
||||||
|
- noisereduce
|
||||||
|
- openai
|
||||||
|
- openpipe
|
||||||
|
- silero
|
||||||
|
- simli
|
||||||
|
- soundfile
|
||||||
|
- websocket
|
||||||
|
- whisper
|
||||||
|
|
||||||
|
formats:
|
||||||
|
- pdf
|
||||||
|
- epub
|
||||||
|
- htmlzip
|
||||||
|
|
||||||
|
# Cache dependencies to speed up builds
|
||||||
|
search:
|
||||||
|
ranking:
|
||||||
|
api/*: 5
|
||||||
|
getting-started/*: 4
|
||||||
|
guides/*: 3
|
||||||
|
|
||||||
|
# Configure submodules if needed
|
||||||
|
submodules:
|
||||||
|
include: all
|
||||||
|
recursive: true
|
||||||
|
|||||||
@@ -40,6 +40,31 @@ autodoc_default_options = {
|
|||||||
"show-inheritance": True,
|
"show-inheritance": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Mock imports for optional dependencies
|
||||||
|
autodoc_mock_imports = [
|
||||||
|
"riva",
|
||||||
|
"livekit",
|
||||||
|
"pyht",
|
||||||
|
"anthropic",
|
||||||
|
"assemblyai",
|
||||||
|
"boto3",
|
||||||
|
"azure",
|
||||||
|
"cartesia",
|
||||||
|
"deepgram",
|
||||||
|
"elevenlabs",
|
||||||
|
"fal",
|
||||||
|
"gladia",
|
||||||
|
"google",
|
||||||
|
"krisp",
|
||||||
|
"langchain",
|
||||||
|
"lmnt",
|
||||||
|
"noisereduce",
|
||||||
|
"openai",
|
||||||
|
"openpipe",
|
||||||
|
"simli",
|
||||||
|
"soundfile",
|
||||||
|
]
|
||||||
|
|
||||||
# HTML output settings
|
# HTML output settings
|
||||||
html_theme = "sphinx_rtd_theme"
|
html_theme = "sphinx_rtd_theme"
|
||||||
html_static_path = ["_static"]
|
html_static_path = ["_static"]
|
||||||
@@ -47,6 +72,39 @@ autodoc_typehints = "description"
|
|||||||
html_show_sphinx = False
|
html_show_sphinx = False
|
||||||
|
|
||||||
|
|
||||||
|
def verify_modules():
|
||||||
|
"""Verify that required modules are available."""
|
||||||
|
required_modules = {
|
||||||
|
"services": [
|
||||||
|
"assemblyai",
|
||||||
|
"aws",
|
||||||
|
"cartesia",
|
||||||
|
"deepgram",
|
||||||
|
"google",
|
||||||
|
"lmnt",
|
||||||
|
"riva",
|
||||||
|
"simli",
|
||||||
|
],
|
||||||
|
"serializers": ["livekit"],
|
||||||
|
"vad": ["silero", "vad_analyzer"],
|
||||||
|
}
|
||||||
|
|
||||||
|
missing = []
|
||||||
|
for category, modules in required_modules.items():
|
||||||
|
for module in modules:
|
||||||
|
try:
|
||||||
|
__import__(f"pipecat.{category}.{module}")
|
||||||
|
logger.info(f"Successfully imported pipecat.{category}.{module}")
|
||||||
|
except ImportError as e:
|
||||||
|
missing.append(f"pipecat.{category}.{module}")
|
||||||
|
logger.warning(
|
||||||
|
f"Optional module not available: pipecat.{category}.{module} - {str(e)}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if missing:
|
||||||
|
logger.warning(f"Some optional modules are not available: {missing}")
|
||||||
|
|
||||||
|
|
||||||
def clean_title(title: str) -> str:
|
def clean_title(title: str) -> str:
|
||||||
"""Automatically clean module titles."""
|
"""Automatically clean module titles."""
|
||||||
# Remove everything after space (like 'module', 'processor', etc.)
|
# Remove everything after space (like 'module', 'processor', etc.)
|
||||||
@@ -151,3 +209,7 @@ def setup(app):
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error generating API documentation: {e}", exc_info=True)
|
logger.error(f"Error generating API documentation: {e}", exc_info=True)
|
||||||
|
|
||||||
|
|
||||||
|
# Run module verification
|
||||||
|
verify_modules()
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ Core Components
|
|||||||
* :mod:`Frames <pipecat.frames>`
|
* :mod:`Frames <pipecat.frames>`
|
||||||
* :mod:`Processors <pipecat.processors>`
|
* :mod:`Processors <pipecat.processors>`
|
||||||
* :mod:`Pipeline <pipecat.pipeline>`
|
* :mod:`Pipeline <pipecat.pipeline>`
|
||||||
|
* :mod:`Services <pipecat.services>`
|
||||||
|
|
||||||
Audio Processing
|
Audio Processing
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
36
docs/api/requirements-base.txt
Normal file
36
docs/api/requirements-base.txt
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# Sphinx dependencies
|
||||||
|
sphinx>=8.1.3
|
||||||
|
sphinx-rtd-theme
|
||||||
|
sphinx-markdown-builder
|
||||||
|
sphinx-autodoc-typehints
|
||||||
|
toml
|
||||||
|
|
||||||
|
# Install all extras individually to ensure they're properly resolved
|
||||||
|
pipecat-ai[anthropic]
|
||||||
|
pipecat-ai[assemblyai]
|
||||||
|
pipecat-ai[aws]
|
||||||
|
pipecat-ai[azure]
|
||||||
|
pipecat-ai[canonical]
|
||||||
|
pipecat-ai[cartesia]
|
||||||
|
pipecat-ai[deepgram]
|
||||||
|
pipecat-ai[elevenlabs]
|
||||||
|
pipecat-ai[fal]
|
||||||
|
pipecat-ai[fireworks]
|
||||||
|
pipecat-ai[gladia]
|
||||||
|
pipecat-ai[google]
|
||||||
|
pipecat-ai[grok]
|
||||||
|
pipecat-ai[groq]
|
||||||
|
pipecat-ai[krisp]
|
||||||
|
pipecat-ai[langchain]
|
||||||
|
pipecat-ai[livekit]
|
||||||
|
pipecat-ai[lmnt]
|
||||||
|
pipecat-ai[moondream]
|
||||||
|
pipecat-ai[nim]
|
||||||
|
pipecat-ai[noisereduce]
|
||||||
|
pipecat-ai[openai]
|
||||||
|
pipecat-ai[openpipe]
|
||||||
|
pipecat-ai[silero]
|
||||||
|
pipecat-ai[simli]
|
||||||
|
pipecat-ai[soundfile]
|
||||||
|
pipecat-ai[websocket]
|
||||||
|
pipecat-ai[whisper]
|
||||||
3
docs/api/requirements-playht.txt
Normal file
3
docs/api/requirements-playht.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Force specific grpcio version for PlayHT
|
||||||
|
grpcio>=1.68.0
|
||||||
|
pipecat-ai[playht]
|
||||||
3
docs/api/requirements-riva.txt
Normal file
3
docs/api/requirements-riva.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Force specific grpcio version for Riva
|
||||||
|
grpcio==1.65.4
|
||||||
|
pipecat-ai[riva]
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
sphinx>=8.1.3
|
|
||||||
sphinx-rtd-theme
|
|
||||||
sphinx-markdown-builder
|
|
||||||
sphinx-autodoc-typehints
|
|
||||||
toml
|
|
||||||
pipecat-ai[anthropic,assemblyai,aws,azure,canonical,cartesia,deepgram,elevenlabs,fal,fireworks,gladia,google,grok,groq,krisp,langchain,lmnt,moondream,nim,noisereduce,openai,openpipe,playht,riva,silero,simli,soundfile,websocket,whisper]
|
|
||||||
36
docs/api/rtd-test.sh
Executable file
36
docs/api/rtd-test.sh
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
DOCS_DIR=$(pwd)
|
||||||
|
PROJECT_ROOT=$(cd ../../ && pwd)
|
||||||
|
TEST_DIR="/tmp/rtd-test-$(date +%Y%m%d_%H%M%S)"
|
||||||
|
|
||||||
|
echo "Creating test directory: $TEST_DIR"
|
||||||
|
mkdir -p "$TEST_DIR"
|
||||||
|
cd "$TEST_DIR"
|
||||||
|
|
||||||
|
# Create single virtual environment
|
||||||
|
python -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
|
echo "Installing base dependencies..."
|
||||||
|
pip install --upgrade pip wheel setuptools
|
||||||
|
pip install -r "$DOCS_DIR/requirements-base.txt"
|
||||||
|
|
||||||
|
# Try to install optional dependencies, but don't fail if they don't work
|
||||||
|
echo "Installing Riva dependencies..."
|
||||||
|
pip install -r "$DOCS_DIR/requirements-riva.txt" || echo "Failed to install Riva dependencies"
|
||||||
|
|
||||||
|
echo "Installing PlayHT dependencies..."
|
||||||
|
pip install -r "$DOCS_DIR/requirements-playht.txt" || echo "Failed to install PlayHT dependencies"
|
||||||
|
|
||||||
|
echo "Building documentation..."
|
||||||
|
cd "$DOCS_DIR"
|
||||||
|
sphinx-build -b html . "_build/html"
|
||||||
|
|
||||||
|
echo "Build complete. Check _build/html directory for output."
|
||||||
|
|
||||||
|
# Print installed packages for verification
|
||||||
|
echo "Installed packages:"
|
||||||
|
pip freeze
|
||||||
@@ -66,11 +66,11 @@ openpipe = [ "openpipe~=4.38.0" ]
|
|||||||
playht = [ "pyht~=0.1.8", "websockets~=13.1" ]
|
playht = [ "pyht~=0.1.8", "websockets~=13.1" ]
|
||||||
riva = [ "nvidia-riva-client~=2.17.0" ]
|
riva = [ "nvidia-riva-client~=2.17.0" ]
|
||||||
silero = [ "onnxruntime~=1.20.1" ]
|
silero = [ "onnxruntime~=1.20.1" ]
|
||||||
|
simli = [ "simli-ai~=0.1.7"]
|
||||||
soundfile = [ "soundfile~=0.12.1" ]
|
soundfile = [ "soundfile~=0.12.1" ]
|
||||||
together = [ "openai~=1.57.2" ]
|
together = [ "openai~=1.57.2" ]
|
||||||
websocket = [ "websockets~=13.1", "fastapi~=0.115.0" ]
|
websocket = [ "websockets~=13.1", "fastapi~=0.115.0" ]
|
||||||
whisper = [ "faster-whisper~=1.1.0" ]
|
whisper = [ "faster-whisper~=1.1.0" ]
|
||||||
simli = [ "simli-ai~=0.1.7"]
|
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
# All the following settings are optional:
|
# All the following settings are optional:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import json
|
|||||||
import re
|
import re
|
||||||
from asyncio import CancelledError
|
from asyncio import CancelledError
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional, Union
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
@@ -75,8 +75,7 @@ class AnthropicContextAggregatorPair:
|
|||||||
|
|
||||||
|
|
||||||
class AnthropicLLMService(LLMService):
|
class AnthropicLLMService(LLMService):
|
||||||
"""
|
"""This class implements inference with Anthropic's AI models.
|
||||||
This class implements inference with Anthropic's AI models.
|
|
||||||
|
|
||||||
Can provide a custom client via the `client` kwarg, allowing you to
|
Can provide a custom client via the `client` kwarg, allowing you to
|
||||||
use `AsyncAnthropicBedrock` and `AsyncAnthropicVertex` clients
|
use `AsyncAnthropicBedrock` and `AsyncAnthropicVertex` clients
|
||||||
@@ -328,7 +327,7 @@ class AnthropicLLMContext(OpenAILLMContext):
|
|||||||
tools: list[dict] | None = None,
|
tools: list[dict] | None = None,
|
||||||
tool_choice: dict | None = None,
|
tool_choice: dict | None = None,
|
||||||
*,
|
*,
|
||||||
system: str | NotGiven = NOT_GIVEN,
|
system: Union[str, NotGiven] = NOT_GIVEN,
|
||||||
):
|
):
|
||||||
super().__init__(messages=messages, tools=tools, tool_choice=tool_choice)
|
super().__init__(messages=messages, tools=tools, tool_choice=tool_choice)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user