mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-12 05:40:58 +00:00
fix: handle case of empty token list in TokenManager to prevent errors
This commit is contained in:
@@ -18,6 +18,8 @@ class TokenManager:
|
|||||||
self.using_token_index = 0
|
self.using_token_index = 0
|
||||||
|
|
||||||
def get_token(self) -> str:
|
def get_token(self) -> str:
|
||||||
|
if len(self.tokens) == 0:
|
||||||
|
return ''
|
||||||
return self.tokens[self.using_token_index]
|
return self.tokens[self.using_token_index]
|
||||||
|
|
||||||
def next_token(self):
|
def next_token(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user