Skip to content
Open
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
8 changes: 6 additions & 2 deletions server/agent/bot/get_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
llm_token_dao = LLMTokenDAO()

bot = bot_dao.get_bot(input_data.bot_id)

if bot.token_id:
print(f"user={user}")

Check warning on line 27 in server/agent/bot/get_bot.py

View check run for this annotation

Codecov / codecov/patch

server/agent/bot/get_bot.py#L27

Added line #L27 was not covered by tests
# 如果是匿名,强行走 free
if not user or getattr(user, "anonymous"):
llm_token = llm_token_dao.get_llm_token(free=True)
elif bot.token_id:

Check warning on line 31 in server/agent/bot/get_bot.py

View check run for this annotation

Codecov / codecov/patch

server/agent/bot/get_bot.py#L29-L31

Added lines #L29 - L31 were not covered by tests
llm_token = llm_service.get_llm_token(id=bot.token_id)
else:
llm_token = llm_token_dao.get_llm_token(bot.llm)

print(f"get_bot, bot={bot}, llm_token={llm_token}")

Check warning on line 36 in server/agent/bot/get_bot.py

View check run for this annotation

Codecov / codecov/patch

server/agent/bot/get_bot.py#L36

Added line #L36 was not covered by tests
return Bot(bot=bot, llm_token=llm_token)

def get_bot_by_id(bot_id: str) -> Bot:
Expand Down