danoan.word_def.plugins.modules.multilanguage_chatgpt module
- class danoan.word_def.plugins.modules.multilanguage_chatgpt.Adapter(configuration: Configuration, language: str)[source]
Bases:
object
Adapter class that communicates with the word-guru API.
Each method is divided in two subtasks: - _[method_name]_api: Returns the raw api response. - _[method_name]_handle: Manipulate the response to return in the desired format.
Dividing this way allows us to create tests with mock responses for the handle.
- Parameters:
configuration (Configuration)
language (str)
- class danoan.word_def.plugins.modules.multilanguage_chatgpt.AdapterFactory[source]
Bases:
object
- get_adapter(configuration_stream: TextIO | None = None) PluginProtocol [source]
- Parameters:
configuration_stream (TextIO | None)
- Return type:
PluginProtocol
- get_language() str [source]
Language which the plugin is configured to respond.
Multilanguage plugins should return an empty string. The word-def api is responsible to create specific language versions upon request. You can rely on this methos to return the appropriated language code.
- Return type:
str