Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Oct 24, 2024
1 parent e1a5f33 commit b834e6f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/danswer/one_shot_answer/answer_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,15 @@ def stream_answer_objects(
try:
llm, fast_llm = get_llms_for_persona(persona=persona)
except ValueError as e:
logger.error("Was not able to get LLMs for persona", exc_info=e)
logger.error(
f"Failed to initialize LLMs for persona '{persona.name}': {str(e)}"
)
if "No LLM provider" in str(e):
raise ValueError(
"Please configure a Generative AI model to use this feature."
) from e
raise ValueError(
"You must configure a Generative AI model to use this feature"
"Failed to initialize the AI model. Please check your configuration and try again."
) from e

llm_tokenizer = get_tokenizer(
Expand Down

0 comments on commit b834e6f

Please sign in to comment.