Skip to content

Commit

Permalink
style: update method signatures for consistency with async/await syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
liblaf committed Mar 16, 2024
1 parent 7b0169d commit 09a8936
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/aic/prompt/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ async def init(
pathspec = [*pathspec, ":!.cspell.json", ":!*-lock.*", ":!*.lock"]
self._diff = await _git.diff(pathspec)

async def ask(self) -> None: ...
async def ask(self) -> None:
...

@property
@abc.abstractmethod
Expand Down
12 changes: 8 additions & 4 deletions src/aic/provider/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ async def init(self, models: Sequence[str] | None = None) -> None:
if models is not None:
self.models = models

async def list_models(self) -> AsyncGenerator[Model, None]: ...
async def list_models(self) -> AsyncGenerator[Model, None]:
...

async def quota(self) -> tuple[float, str] | None:
return None
Expand All @@ -84,7 +85,8 @@ def pricing(self, model: str) -> Pricing | None:
@abc.abstractmethod
async def generate(
self, prompt: _prompt.Prompt, *, truncate: bool = True
) -> Response: ...
) -> Response:
...

async def generate_stream(
self, prompt: _prompt.Prompt, *, truncate: bool = True
Expand Down Expand Up @@ -118,7 +120,9 @@ def select_model(self, prompt: _prompt.Prompt) -> str:
return self.models[0]

@abc.abstractmethod
def count_tokens(self, model: str, prompt: _prompt.Prompt) -> int: ...
def count_tokens(self, model: str, prompt: _prompt.Prompt) -> int:
...

@abc.abstractmethod
def truncate(self, model: str, prompt: _prompt.Prompt) -> _prompt.Prompt: ...
def truncate(self, model: str, prompt: _prompt.Prompt) -> _prompt.Prompt:
...

0 comments on commit 09a8936

Please sign in to comment.