Skip to content

TypeError Due to Unexpected Keyword Argument in PrerecordedOptions Initialization #459

@Viamo

Description

@Viamo

What is the current behavior?

In the code snippet:

from deepgram import PrerecordedOptions

# It's working
print('Case 1')
options = PrerecordedOptions()
options.custom_topic = '...'

# It's not working
print('Case 2')
options = PrerecordedOptions(custom_topic = '...')

Case 1 works as expected, but Case 2 raises a TypeError because PrerecordedOptions.__init__() received an unexpected keyword argument 'custom_topic'.

Steps to reproduce

  1. Import PrerecordedOptions from the deepgram module.
  2. Execute Case 1 where custom_topic is set as an attribute after instantiation.
  3. Execute Case 2 where custom_topic is passed as a keyword argument during instantiation.

Expected behavior

PrerecordedOptions should accept custom_topic as a keyword argument during instantiation, or the attribute should be set correctly after instantiation.

Please tell us about your environment

  • Operating System/Version: Windows 10
  • Python Version: v3.11

Other information

It appears that PrerecordedOptions does not support setting custom_topic via a keyword argument during initialization, but allows setting it as an attribute after instantiation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions