Skip to content

Conversation

@KorigamiK
Copy link
Contributor

Without this such errors might be seen.

Missing argument prompt in function `speech_recognition.recognizers.whisper_api.groq.recognize[missing-argument]

Copy link
Collaborator

@ftnext ftnext left a comment

Choose a reason for hiding this comment

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

Thank you for telling me.

https://peps.python.org/pep-0692/#required-and-non-required-keys

By default all keys in a TypedDict are required. This behaviour can be overridden by setting the dictionary’s total parameter as False.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a type-checking error by making all fields in the GroqOptionalParameters TypedDict optional. Without this change, type checkers would report missing argument errors when calling the recognize function without providing all parameters defined in the TypedDict.

Key Changes:

  • Added total=False parameter to GroqOptionalParameters TypedDict class to make all fields optional
Comments suppressed due to low confidence (1)

speech_recognition/recognizers/whisper_api/groq.py:28

  • The test coverage for optional parameters is missing. While there's a basic test, it doesn't verify that any of the optional parameters (prompt, response_format, temperature, language) can actually be passed to the recognize function. Consider adding test cases similar to test_openai.py (tests/recognizers/whisper_api/test_openai.py) which includes tests for language and prompt parameters.
class GroqOptionalParameters(TypedDict, total=False):
    """Groq speech transcription's optional parameters.

    https://console.groq.com/docs/speech-text#transcription-endpoint-usage
    """

    prompt: str
    response_format: str
    temperature: float
    language: str

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ftnext ftnext changed the title fix: make arguments optional fix: make GroqOptionalParameters fields optional Dec 24, 2025
@ftnext ftnext merged commit 38f74c1 into Uberi:master Dec 24, 2025
14 checks passed
This was referenced Dec 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants