mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
fix: Conversation creation accessing secret without unwrapping (#6335)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
This commit is contained in:
@@ -51,7 +51,10 @@ async def _create_new_conversation(
|
||||
session_init_args = {**settings.__dict__, **session_init_args}
|
||||
# We could use litellm.check_valid_key for a more accurate check,
|
||||
# but that would run a tiny inference.
|
||||
if not settings.llm_api_key or settings.llm_api_key.isspace():
|
||||
if (
|
||||
not settings.llm_api_key
|
||||
or settings.llm_api_key.get_secret_value().isspace()
|
||||
):
|
||||
logger.warn(f'Missing api key for model {settings.llm_model}')
|
||||
raise LLMAuthenticationError(
|
||||
'Error authenticating with the LLM provider. Please check your API key'
|
||||
|
||||
Reference in New Issue
Block a user