Skip to content

Commit

Permalink
Fix slack bot follow up questions (#2756)
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves authored Oct 10, 2024
1 parent b4417fa commit 9be54a2
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Optional
from typing import TypeVar

from fastapi import HTTPException
from retry import retry
from slack_sdk import WebClient
from slack_sdk.models.blocks import DividerBlock
Expand Down Expand Up @@ -155,11 +154,7 @@ def _get_answer(new_message_request: DirectQARequest) -> OneShotQAResponse | Non
with Session(get_sqlalchemy_engine()) as db_session:
if len(new_message_request.messages) > 1:
if new_message_request.persona_config:
raise HTTPException(
status_code=403,
detail="Slack bot does not support persona config",
)

raise RuntimeError("Slack bot does not support persona config")
elif new_message_request.persona_id is not None:
persona = cast(
Persona,
Expand All @@ -170,6 +165,10 @@ def _get_answer(new_message_request: DirectQARequest) -> OneShotQAResponse | Non
get_editable=False,
),
)
else:
raise RuntimeError(
"No persona id provided, this should never happen."
)

llm, _ = get_llms_for_persona(persona)

Expand Down

0 comments on commit 9be54a2

Please sign in to comment.