Skip to content

Commit

Permalink
Merge pull request xtekky#135 from TSOA2/main
Browse files Browse the repository at this point in the history
Trim remaining characters
  • Loading branch information
xtekky authored Apr 26, 2023
2 parents 0265144 + 2213246 commit 71f507e
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 71f507e

Please sign in to comment.