From 0ba622eece6b6f6a5a419b6c186060085ae0ac06 Mon Sep 17 00:00:00 2001 From: OceanLi <122793010+ohdearquant@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:55:01 -0400 Subject: [PATCH] updated init, bump version to 0.1.1 --- README.md | 4 +++- lion_service/__init__.py | 14 +++++++++++--- lion_service/rate_limiter.py | 5 +++-- lion_service/service_util.py | 1 + lion_service/token_calculator.py | 2 +- lion_service/version.py | 2 +- poetry.lock | 16 +++++++++++++++- pyproject.toml | 3 ++- 8 files changed, 37 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 51f3a70..afdd3da 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# lion-service \ No newline at end of file +# lion-service + +API services for lion framework \ No newline at end of file diff --git a/lion_service/__init__.py b/lion_service/__init__.py index b18cbaa..e59dcf6 100644 --- a/lion_service/__init__.py +++ b/lion_service/__init__.py @@ -1,5 +1,13 @@ -from .version import __version__ +from .rate_limiter import RateLimiter, RateLimitError from .service import Service, register_service -from .rate_limiter import RateLimiter +from .service_util import invoke_retry +from .version import __version__ -__all__ = ["Service", "register_service", "RateLimiter", "__version__"] +__all__ = [ + "Service", + "register_service", + "RateLimiter", + "__version__", + "RateLimitError", + "invoke_retry", +] diff --git a/lion_service/rate_limiter.py b/lion_service/rate_limiter.py index 2daf775..72e92a5 100644 --- a/lion_service/rate_limiter.py +++ b/lion_service/rate_limiter.py @@ -1,9 +1,10 @@ from collections import deque -from datetime import datetime, UTC, timezone +from datetime import UTC, datetime, timezone from pydantic import BaseModel, Field -from .complete_request_info import CompleteRequestInfo, CompleteRequestTokenInfo +from .complete_request_info import (CompleteRequestInfo, + CompleteRequestTokenInfo) class RateLimiter(BaseModel): diff --git a/lion_service/service_util.py b/lion_service/service_util.py index ee64ffc..fee905f 100644 --- a/lion_service/service_util.py +++ b/lion_service/service_util.py @@ -1,5 +1,6 @@ import asyncio from functools import wraps + from .rate_limiter import RateLimitError diff --git a/lion_service/token_calculator.py b/lion_service/token_calculator.py index 29d88ff..734f7d1 100644 --- a/lion_service/token_calculator.py +++ b/lion_service/token_calculator.py @@ -1,6 +1,6 @@ -import tiktoken from abc import abstractmethod +import tiktoken from pydantic import BaseModel, Field, field_validator diff --git a/lion_service/version.py b/lion_service/version.py index a68927d..485f44a 100644 --- a/lion_service/version.py +++ b/lion_service/version.py @@ -1 +1 @@ -__version__ = "0.1.0" \ No newline at end of file +__version__ = "0.1.1" diff --git a/poetry.lock b/poetry.lock index b1e31bf..1bbefe6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -231,6 +231,20 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + [[package]] name = "mypy-extensions" version = "1.0.0" @@ -659,4 +673,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "0be1230f5ad9010611e524bf676d423c4c02ddb14fe44fb879fba805f58afd24" +content-hash = "d216de44fb5c6b42b0b94cf98d15ecb7e27940b27ba331294c0d89b15ed3a021" diff --git a/pyproject.toml b/pyproject.toml index 6f4995e..1b74830 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "lion-service" -version = "0.1.0" +version = "0.1.1" description = "" authors = ["OceanLi <122793010+ohdearquant@users.noreply.github.com>"] readme = "README.md" @@ -14,6 +14,7 @@ tiktoken = "^0.7.0" [tool.poetry.group.dev.dependencies] pytest = "^8.3.3" black = "^24.8.0" +isort = "^5.13.2" [build-system] requires = ["poetry-core"]