summaryrefslogtreecommitdiffstats
path: root/you
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-26 09:54:52 +0200
committerGitHub <noreply@github.com>2023-04-26 09:54:52 +0200
commit71f507ee948e70b53c6a5b4005100494d550ff80 (patch)
tree3368bae977153708803c52c76553ef6c2241057e /you
parentMerge pull request #144 from Joonsey/main (diff)
parentTrim remaining characters (diff)
downloadgpt4free-71f507ee948e70b53c6a5b4005100494d550ff80.tar
gpt4free-71f507ee948e70b53c6a5b4005100494d550ff80.tar.gz
gpt4free-71f507ee948e70b53c6a5b4005100494d550ff80.tar.bz2
gpt4free-71f507ee948e70b53c6a5b4005100494d550ff80.tar.lz
gpt4free-71f507ee948e70b53c6a5b4005100494d550ff80.tar.xz
gpt4free-71f507ee948e70b53c6a5b4005100494d550ff80.tar.zst
gpt4free-71f507ee948e70b53c6a5b4005100494d550ff80.zip
Diffstat (limited to 'you')
-rw-r--r--you/__init__.py5
1 files changed, 3 insertions, 2 deletions
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
+ }