Skip to content

Commit

Permalink
Trim remaining characters
Browse files Browse the repository at this point in the history
  • Loading branch information
TSOA2 committed Apr 26, 2023
1 parent 7e858de commit 2213246
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions you/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def create(
text = response.text.split('}]}\n\nevent: youChatToken\ndata: {"youChatToken": "')[-1]
text = text.replace('"}\n\nevent: youChatToken\ndata: {"youChatToken": "', '')
text = text.replace('event: done\ndata: I\'m Mr. Meeseeks. Look at me.\n\n', '')

text = text[:-4] # trims '"}', along with the last two remaining newlines

extra = {
'youChatSerpResults' : loads(youChatSerpResults),
#'slots' : loads(slots)
Expand All @@ -74,4 +75,4 @@ def create(
'response': text,
'links' : loads(thirdPartySearchResults)['search']["third_party_search_results"] if includelinks else None,
'extra' : extra if detailed else None,
}
}

0 comments on commit 2213246

Please sign in to comment.