From 2213246de9c215c71318892a29e8211563cad888 Mon Sep 17 00:00:00 2001 From: TSOA2 Date: Tue, 25 Apr 2023 17:16:27 -0700 Subject: Trim remaining characters --- you/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'you/__init__.py') diff --git a/you/__init__.py b/you/__init__.py index 726773ef..073daee9 100644 --- a/you/__init__.py +++ b/you/__init__.py @@ -64,7 +64,8 @@ class Completion: 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) @@ -74,4 +75,4 @@ class Completion: 'response': text, 'links' : loads(thirdPartySearchResults)['search']["third_party_search_results"] if includelinks else None, 'extra' : extra if detailed else None, - } \ No newline at end of file + } -- cgit v1.2.3