Skip to content

Commit 593d5d6

Browse files
committed
fix: force use anonymous
1 parent bb73442 commit 593d5d6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/agent/bot/get_bot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ def get_bot(
2525

2626
bot = bot_dao.get_bot(input_data.bot_id)
2727

28-
if bot.token_id:
28+
# 如果是匿名,强行走 free
29+
if not getattr(user, "anonymous", False):
30+
llm_token = llm_token_dao.get_llm_token(free=True)
31+
elif bot.token_id:
2932
llm_token = llm_service.get_llm_token(id=bot.token_id)
3033
else:
3134
llm_token = llm_token_dao.get_llm_token(bot.llm)
3235

36+
print(f"get_bot, bot={bot}, llm_token={llm_token}")
3337
return Bot(bot=bot, llm_token=llm_token)
3438

3539
def get_bot_by_id(bot_id: str) -> Bot:

0 commit comments

Comments
 (0)