Skip to content

Commit

Permalink
Fixed type hints
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Tisnovsky <[email protected]>
  • Loading branch information
tisnik committed Jan 20, 2025
1 parent bc08be4 commit f3064ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ols/app/endpoints/ols.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def conversation_request(
timestamps,
) = process_request(auth, llm_request)

summarizer_response: SummarizerResponse | Generator

if not valid:
summarizer_response = SummarizerResponse(
prompts.INVALID_QUERY_RESP,
Expand All @@ -98,7 +100,7 @@ def conversation_request(
else:
summarizer_response = generate_response(
conversation_id, llm_request, previous_input
) # type: ignore[assignment]
)

timestamps["generate response"] = time.time()

Expand Down Expand Up @@ -362,13 +364,13 @@ def generate_response(
except Exception as summarizer_error:
logger.error("Error while obtaining answer for user question")
logger.exception(summarizer_error)
status_code, response, cause = errors_parsing.parse_generic_llm_error( # type: ignore[assignment]
status_code, response_text, cause = errors_parsing.parse_generic_llm_error(
summarizer_error
)
raise HTTPException(
status_code=status_code,
detail={
"response": response,
"response": response_text,
"cause": cause,
},
)
Expand Down

0 comments on commit f3064ce

Please sign in to comment.