chore: 整理文件

This commit is contained in:
RockChinQ
2024-01-28 18:45:18 +08:00
parent 2b0faea8ec
commit 698782c537
50 changed files with 29 additions and 1007 deletions
+25
View File
@@ -0,0 +1,25 @@
from __future__ import annotations
import typing
import pydantic
class TokenManager():
provider: str
tokens: list[str]
using_token_index: typing.Optional[int] = 0
def __init__(self, provider: str, tokens: list[str]):
self.provider = provider
self.tokens = tokens
self.using_token_index = 0
def get_token(self) -> str:
return self.tokens[self.using_token_index]
def next_token(self):
self.using_token_index = (self.using_token_index + 1) % len(self.tokens)