fix: remove duplicate error message in provider validator (#10088)

This commit is contained in:
aeft 2025-08-07 08:37:51 -07:00 committed by GitHub
parent d525c5ad93
commit 029a19ca05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -205,20 +205,11 @@ async def modify_llm_settings_basic(
provider = verified_providers[choice_index]
else:
# User selected "Select another provider" - use manual selection
# Define a validator function that prints an error message
def provider_validator(x):
is_valid = x in organized_models
if not is_valid:
print_formatted_text(
HTML('<grey>Invalid provider selected: {}</grey>'.format(x))
)
return is_valid
provider = await get_validated_input(
session,
'(Step 1/3) Select LLM Provider (TAB for options, CTRL-c to cancel): ',
completer=provider_completer,
validator=provider_validator,
validator=lambda x: x in organized_models,
error_message='Invalid provider selected',
)