Skip to content

BaseProvider missing model attribute declaration #3

@baranylcn

Description

@baranylcn

All provider classes (OpenAIProvider, AnthropicProvider, etc.) store the model name as self.model, but the abstract base class never declares this attribute. Type checkers like mypy can't see it.

Current behavior

# base.py
class BaseProvider(ABC):
    @abstractmethod
    async def run(self, prompt: str, ...) -> ModelResult: ...
    # no `model` attribute

# every provider does this, but base doesn't know about it
class OpenAIProvider(BaseProvider):
    def __init__(self, model: str) -> None:
        self.model = model  # type checker can't verify this

Expected behavior

class BaseProvider(ABC):
    model: str  # declared here

    @abstractmethod
    async def run(self, prompt: str, ...) -> ModelResult: ...

Files to change

skate/providers/base.py - add model: str class-level annotation

That's it. One line.

How to verify

pip install -e ".[dev]"
mypy skate/providers/base.py
pytest tests/

Tests should still pass, mypy should be happy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions