Skip to content

GPTWorkflowRemediation.__init__ uses *args/**kwargs, losing type info #16

@jtdub

Description

@jtdub

Summary

workflows.py:17 defines def __init__(self, *args, **kwargs) which passes everything through to the parent WorkflowRemediation. This loses all type information and IDE support (autocomplete, type checking, documentation hover).

Current Behavior

def __init__(self, *args, **kwargs):
    super().__init__(*args, **kwargs)

Users cannot see what parameters are expected without reading the parent class source code. mypy also cannot validate constructor arguments.

Suggested Fix

Explicitly declare the parameters that WorkflowRemediation expects:

def __init__(
    self,
    running_config: HConfig,
    generated_config: HConfig,
    ...
) -> None:
    super().__init__(running_config=running_config, generated_config=generated_config, ...)

This also provides a natural place to add the prompt_template parameter (see related issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions