STTOpenAI (openai/stt.py)

windows-use · windows_use/providers/openai/stt.py · python · MIT
voice

OpenAI Whisper STT provider class for transcribing audio files synchronously or asynchronously.

# Source: https://github.com/CursorTouch/windows-use | License: MIT | Copyright 2025 CursorTouch
# Provided via justclaw.it.com; keep this notice with the code.
import logging
import os

from openai import AsyncOpenAI, OpenAI

from windows_use.providers.base import BaseSTT

logger = logging.getLogger(__name__)


class STTOpenAI(BaseSTT):
    """OpenAI Whisper-based Speech-to-Text provider.

    Uses the OpenAI Audio Transcriptions API to convert audio files to text.

    Args:
        model: The Whisper model to use (default: "whisper-1").
        api_key: OpenAI API key. Falls back to OPENAI_API_KEY env variable.
        base_url: Optional base URL override. Falls back to OPENAI_BASE_URL env variable.
        language: Optional ISO-639-1 language code to guide transcription (e.g., "en", "

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key