Skip to content

Commit 57d210e

Browse files
Merge branch 'dev'
2 parents 0fe7f1d + 54b243d commit 57d210e

8 files changed

Lines changed: 40 additions & 22 deletions

File tree

bumpver.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
[bumpver]
3-
current_version = "5.1.1"
3+
current_version = "5.1.3"
44
version_pattern = "MAJOR.MINOR.PATCH"
55
commit_message = "bump version {old_version} -> {new_version}"
66
tag_message = "{new_version}"

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def setup(app):
3838
project = "wdoc"
3939
copyright = "2025, thiswillbeyourgithub"
4040
author = "thiswillbeyourgithub"
41-
release = "5.1.1"
41+
release = "5.1.3"
4242

4343
# -- General configuration ---------------------------------------------------
4444
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def run(self):
129129

130130
setup(
131131
name="wdoc",
132-
version="5.1.1",
132+
version="5.1.3",
133133
description="A perfect AI powered RAG for document query and summary. Supports ~all LLM and ~all filetypes (url, pdf, epub, youtube (incl playlist), audio, anki, md, docx, pptx, or any combination!)",
134134
long_description=long_description,
135135
long_description_content_type="text/markdown",
@@ -215,7 +215,7 @@ def run(self):
215215
"pdfplumber >= 0.11.1",
216216
"pdf2image >= 1.17.0",
217217
# URL / web loading (default, since urls are the most common filetype)
218-
"playwright >= 1.45.0", # for online_media and urls
218+
"playwright >= 1.60.0", # for online_media and urls
219219
"goose3 >= 3.1.20",
220220
"tldextract>=5.1.2",
221221
# online search via 'filetype=web'
@@ -232,12 +232,12 @@ def run(self):
232232
# audio/video transcription
233233
"deepgram-sdk >= 3.2.7",
234234
"httpx >= 0.27.0", # to increase deepgram timeout
235-
"pydub >= 0.25.1", # extracting audio from local video
235+
"pydub == 0.25.1", # extracting audio from local video
236236
# audioop was removed in stdlib in Python 3.13 and pydub needs it
237237
# See https://github.com/jiaaro/pydub/issues/815
238238
"audioop-lts>=0.2.2; python_version>='3.13'",
239-
"ffmpeg-python >= 0.2.0", # extracting audio from local video
240-
"torchaudio >= 2.8.0", # silence removal from audio
239+
"ffmpeg-python == 0.2.0", # extracting audio from local video
240+
"torchaudio == 2.8.0", # silence removal from audio
241241
],
242242
"anki": [
243243
"ankipandas>=0.3.15",

wdoc-skill/REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ These load multiple documents and can combine different sources:
327327
| Variable | Default | Description |
328328
|----------|---------|-------------|
329329
| `WDOC_WHISPER_ENDPOINT` | `""` | Custom Whisper API endpoint |
330-
| `WDOC_WHISPER_API_KEY` | `""` | Custom Whisper API key |
330+
| `WDOC_WHISPER_API_KEY` | `""` | Custom Whisper API key. When empty, falls back to `OPENAI_API_KEY`, then `WHISPER_API_KEY` |
331331
| `WDOC_WHISPER_MODEL` | `whisper-1` | Whisper model name |
332332
| `WDOC_WHISPER_PARALLEL_SPLITS` | `True` | Parallelize split audio transcription |
333333

wdoc/docs/help.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,8 @@
947947
* `WDOC_WHISPER_API_KEY`, default: `""`
948948
* If provided, sets a custom API key for Whisper transcription services. This is useful when using alternative
949949
Whisper-compatible services that require their own authentication.
950-
* When empty, uses the default OPENAI_API_KEY environment variable.
950+
* When empty, falls back to the `OPENAI_API_KEY` environment variable, and if that is also unset, to the
951+
`WHISPER_API_KEY` environment variable. The resolution order is `WDOC_WHISPER_API_KEY` > `OPENAI_API_KEY` > `WHISPER_API_KEY`.
951952

952953
* `WDOC_WHISPER_MODEL`, default: `"whisper-1"`
953954
* Specifies which Whisper model to use for audio transcription. This can be any model supported by your Whisper endpoint.

wdoc/utils/loaders/online_media.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pathlib import Path
44

55
import ffmpeg
6-
import playwright
6+
import playwright.sync_api
77
import pydub
88
import uuid6
99
import yt_dlp as youtube_dl

wdoc/utils/loaders/shared_audio.py

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,30 @@ def transcribe_audio_whisper(
210210
)
211211
else:
212212
assert (
213-
"OPENAI_API_KEY" in os.environ
214-
and not os.environ["OPENAI_API_KEY"]
215-
== "REDACTED_BECAUSE_WDOC_IN_PRIVATE_MODE"
216-
) or (
217-
env.WDOC_WHISPER_API_KEY
218-
and not env.WDOC_WHISPER_API_KEY == "REDACTED_BECAUSE_WDOC_IN_PRIVATE_MODE"
219-
), "No environment variable OPENAI_API_KEY nor WDOC_WHISPER_API_KEY found"
213+
(
214+
"OPENAI_API_KEY" in os.environ
215+
and not os.environ["OPENAI_API_KEY"]
216+
== "REDACTED_BECAUSE_WDOC_IN_PRIVATE_MODE"
217+
)
218+
or (
219+
env.WDOC_WHISPER_API_KEY
220+
and not env.WDOC_WHISPER_API_KEY
221+
== "REDACTED_BECAUSE_WDOC_IN_PRIVATE_MODE"
222+
)
223+
or (
224+
os.environ.get("WHISPER_API_KEY")
225+
and not os.environ["WHISPER_API_KEY"]
226+
== "REDACTED_BECAUSE_WDOC_IN_PRIVATE_MODE"
227+
)
228+
), (
229+
"No environment variable OPENAI_API_KEY, WDOC_WHISPER_API_KEY nor WHISPER_API_KEY found"
230+
)
231+
232+
# Resolve the whisper API key. WDOC_WHISPER_API_KEY takes precedence; if it
233+
# is unset and OPENAI_API_KEY is also unset, fall back to WHISPER_API_KEY.
234+
whisper_api_key = env.WDOC_WHISPER_API_KEY
235+
if not whisper_api_key and not os.environ.get("OPENAI_API_KEY"):
236+
whisper_api_key = os.environ.get("WHISPER_API_KEY", "")
220237

221238
try:
222239
t1 = time.time()
@@ -238,8 +255,8 @@ def transcribe_audio_whisper(
238255
f"Using custom whisper endpoint: {env.WDOC_WHISPER_ENDPOINT}"
239256
)
240257

241-
if env.WDOC_WHISPER_API_KEY:
242-
transcription_kwargs["api_key"] = env.WDOC_WHISPER_API_KEY
258+
if whisper_api_key:
259+
transcription_kwargs["api_key"] = whisper_api_key
243260
logger.debug("Using custom whisper API key")
244261

245262
try:
@@ -270,8 +287,8 @@ def transcribe_audio_whisper(
270287
data["language"] = language
271288

272289
headers = {}
273-
if env.WDOC_WHISPER_API_KEY:
274-
headers["Authorization"] = f"Bearer {env.WDOC_WHISPER_API_KEY}"
290+
if whisper_api_key:
291+
headers["Authorization"] = f"Bearer {whisper_api_key}"
275292

276293
# Make the request
277294
endpoint_url = (

wdoc/wdoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class wdoc:
7070
This docstring is dynamically updated with the content of wdoc/docs/help.md
7171
"""
7272

73-
VERSION: str = "5.1.1"
73+
VERSION: str = "5.1.3"
7474
allowed_extra_args = extra_args_types
7575
__import_mode__: bool = True
7676

0 commit comments

Comments
 (0)