Skip to content

Commit

Permalink
Shorten long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
monst committed Oct 13, 2023
1 parent 63126fc commit d13bf7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/routes/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def execute_call(body: SendMessageRequest) -> dict:
def send_message(body: SendMessageRequest) -> SendMessageResponse:
generated_vars = execute_call(body)

# Restore the old behavior of throwing an exception if no 'response' variable was generated
# V1: Throw an exception if no 'response' variable was generated
if "response" not in generated_vars:
raise InternalServerException(
str(ValueError("The handlebars do not generate 'response'"))
Expand All @@ -77,7 +77,7 @@ def send_message(body: SendMessageRequest) -> SendMessageResponse:
type=ContentType.TEXT,
textContent=generated_vars[
"response"
], # V1 behavior: only return the 'response' variable
], # V1: only return the 'response' variable
)
],
),
Expand All @@ -93,5 +93,5 @@ def send_message_v2(body: SendMessageRequest) -> SendMessageResponseV2:
return SendMessageResponseV2(
usedModel=body.preferred_model,
sentAt=datetime.now(timezone.utc),
content=generated_vars, # V2 behavior: return all variables generated in the program
content=generated_vars, # V2: return all generated variables
)

0 comments on commit d13bf7e

Please sign in to comment.