Skip to content

Commit

Permalink
fix precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
orangetin committed Sep 4, 2024
1 parent 2ee6e1f commit eba230c
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/together/legacy/complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Complete:
def create(
cls,
prompt: str,
**kwargs,
**kwargs: Any,
) -> Dict[str, Any]:
"""Legacy completion function."""

Expand All @@ -36,7 +36,7 @@ def create(
def create_streaming(
cls,
prompt: str,
**kwargs,
**kwargs: Any,
) -> Iterator[Dict[str, Any]]:
"""Legacy streaming completion function."""

Expand All @@ -59,7 +59,7 @@ class Completion:
def create(
cls,
prompt: str,
**kwargs,
**kwargs: Any,
) -> CompletionResponse | Iterator[CompletionChunk]:
"""Completion function."""

Expand All @@ -79,7 +79,7 @@ class AsyncComplete:
async def create(
cls,
prompt: str,
**kwargs,
**kwargs: Any,
) -> CompletionResponse | AsyncGenerator[CompletionChunk, None]:
"""Async completion function."""

Expand Down
2 changes: 1 addition & 1 deletion src/together/legacy/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Embeddings:
def create(
cls,
input: str,
**kwargs,
**kwargs: Any,
) -> Dict[str, Any]:
"""Legacy embeddings function."""

Expand Down
2 changes: 1 addition & 1 deletion src/together/legacy/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Image:
def create(
cls,
prompt: str,
**kwargs,
**kwargs: Any,
) -> Dict[str, Any]:
"""Legacy image function."""

Expand Down
4 changes: 2 additions & 2 deletions src/together/resources/chat/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create(
response_format: Dict[str, str | Dict[str, Any]] | None = None,
tools: Dict[str, str | Dict[str, Any]] | None = None,
tool_choice: str | Dict[str, str | Dict[str, str]] | None = None,
**kwargs,
**kwargs: Any,
) -> ChatCompletionResponse | Iterator[ChatCompletionChunk]:
"""
Method to generate completions based on a given prompt using a specified model.
Expand Down Expand Up @@ -179,7 +179,7 @@ async def create(
response_format: Dict[str, Any] | None = None,
tools: Dict[str, str | Dict[str, str | Dict[str, Any]]] | None = None,
tool_choice: str | Dict[str, str | Dict[str, str]] | None = None,
**kwargs,
**kwargs: Any,
) -> AsyncGenerator[ChatCompletionChunk, None] | ChatCompletionResponse:
"""
Async method to generate completions based on a given prompt using a specified model.
Expand Down
6 changes: 3 additions & 3 deletions src/together/resources/completions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import AsyncGenerator, Dict, Iterator, List
from typing import AsyncGenerator, Dict, Iterator, List, Any

from together.abstract import api_requestor
from together.together_response import TogetherResponse
Expand Down Expand Up @@ -37,7 +37,7 @@ def create(
echo: bool | None = None,
n: int | None = None,
safety_model: str | None = None,
**kwargs,
**kwargs: Any,
) -> CompletionResponse | Iterator[CompletionChunk]:
"""
Method to generate completions based on a given prompt using a specified model.
Expand Down Expand Up @@ -158,7 +158,7 @@ async def create(
echo: bool | None = None,
n: int | None = None,
safety_model: str | None = None,
**kwargs,
**kwargs: Any,
) -> AsyncGenerator[CompletionChunk, None] | CompletionResponse:
"""
Async method to generate completions based on a given prompt using a specified model.
Expand Down
6 changes: 3 additions & 3 deletions src/together/resources/embeddings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import List
from typing import List, Any

from together.abstract import api_requestor
from together.together_response import TogetherResponse
Expand All @@ -21,7 +21,7 @@ def create(
*,
input: str | List[str],
model: str,
**kwargs,
**kwargs: Any,
) -> EmbeddingResponse:
"""
Method to generate completions based on a given prompt using a specified model.
Expand Down Expand Up @@ -67,7 +67,7 @@ async def create(
*,
input: str | List[str],
model: str,
**kwargs,
**kwargs: Any,
) -> EmbeddingResponse:
"""
Async method to generate completions based on a given prompt using a specified model.
Expand Down
6 changes: 4 additions & 2 deletions src/together/resources/images.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

from typing import Any

from together.abstract import api_requestor
from together.together_response import TogetherResponse
from together.types import (
Expand All @@ -25,7 +27,7 @@ def generate(
height: int | None = 1024,
width: int | None = 1024,
negative_prompt: str | None = None,
**kwargs,
**kwargs: Any,
) -> ImageResponse:
"""
Method to generate images based on a given prompt using a specified model.
Expand Down Expand Up @@ -100,7 +102,7 @@ async def generate(
height: int | None = 1024,
width: int | None = 1024,
negative_prompt: str | None = None,
**kwargs,
**kwargs: Any,
) -> ImageResponse:
"""
Async method to generate images based on a given prompt using a specified model.
Expand Down
4 changes: 2 additions & 2 deletions src/together/resources/rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create(
top_n: int | None = None,
return_documents: bool = False,
rank_fields: List[str] | None = None,
**kwargs,
**kwargs: Any,
) -> RerankResponse:
"""
Method to generate completions based on a given prompt using a specified model.
Expand Down Expand Up @@ -83,7 +83,7 @@ async def create(
top_n: int | None = None,
return_documents: bool = False,
rank_fields: List[str] | None = None,
**kwargs,
**kwargs: Any,
) -> RerankResponse:
"""
Async method to generate completions based on a given prompt using a specified model.
Expand Down

0 comments on commit eba230c

Please sign in to comment.