Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: "https://github.com/psf/black"
rev: 22.6.0
rev: 24.10.0
hooks:
- id: black
files: ./
Expand Down
30 changes: 10 additions & 20 deletions py/autoevals/oai.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class ChatCompletions(Protocol):
@runtime_checkable
class Chat(Protocol):
@property
def completions(self) -> ChatCompletions:
...
def completions(self) -> ChatCompletions: ...


@runtime_checkable
Expand All @@ -38,35 +37,27 @@ class OpenAIV1Module(Protocol):
class OpenAI(Protocol):
# Core API resources
@property
def chat(self) -> Chat:
...
def chat(self) -> Chat: ...

@property
def embeddings(self) -> Embeddings:
...
def embeddings(self) -> Embeddings: ...

@property
def moderations(self) -> Moderations:
...
def moderations(self) -> Moderations: ...

# Configuration
@property
def api_key(self) -> str:
...
def api_key(self) -> str: ...

@property
def organization(self) -> Optional[str]:
...
def organization(self) -> Optional[str]: ...

@property
def base_url(self) -> Union[str, Any, None]:
...
def base_url(self) -> Union[str, Any, None]: ...

class AsyncOpenAI(OpenAI):
...
class AsyncOpenAI(OpenAI): ...

class RateLimitError(Exception):
...
class RateLimitError(Exception): ...


# TODO: we're removing v0 support in the next release
Expand All @@ -89,8 +80,7 @@ class Moderation(Protocol):
base_url: Optional[str]

class error(Protocol):
class RateLimitError(Exception):
...
class RateLimitError(Exception): ...


_openai_module: Optional[Union[OpenAIV1Module, OpenAIV0Module]] = None
Expand Down
4 changes: 2 additions & 2 deletions py/autoevals/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Score(SerializableDataClass):

def as_dict(self):
return {
"name": self.name,
"score": self.score,
"metadata": self.metadata,
}
Expand Down Expand Up @@ -57,8 +58,7 @@ def _name(self) -> str:
return self.__class__.__name__

@abstractmethod
def _run_eval_sync(self, output: Any, expected: Any = None, **kwargs: Any) -> Score:
...
def _run_eval_sync(self, output: Any, expected: Any = None, **kwargs: Any) -> Score: ...


__all__ = ["Score", "Scorer"]
2 changes: 1 addition & 1 deletion py/autoevals/test_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_embeddings():
def test_embedding_values():
for run_async in [False, True]:
evaluator = EmbeddingSimilarity()
for (word1, word2) in VALUES:
for word1, word2 in VALUES:
if run_async:
result = asyncio.run(evaluator.eval_async(word1, word2))
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
package_dir={"": "py"},
include_package_data=True,
packages=setuptools.find_packages(where="py"),
python_requires=">=3.8.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically #154 will be the official deprecation of 3.8 and 3.9.

python_requires=">=3.10.0",
entry_points={},
install_requires=install_requires,
extras_require=extras_require,
Expand Down