mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-09-12 08:29:30 -04:00
Trim remaining characters
This commit is contained in:
parent
7e858de0d4
commit
2213246de9
@ -64,7 +64,8 @@ class Completion:
|
|||||||
text = response.text.split('}]}\n\nevent: youChatToken\ndata: {"youChatToken": "')[-1]
|
text = response.text.split('}]}\n\nevent: youChatToken\ndata: {"youChatToken": "')[-1]
|
||||||
text = text.replace('"}\n\nevent: youChatToken\ndata: {"youChatToken": "', '')
|
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.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 = {
|
extra = {
|
||||||
'youChatSerpResults' : loads(youChatSerpResults),
|
'youChatSerpResults' : loads(youChatSerpResults),
|
||||||
#'slots' : loads(slots)
|
#'slots' : loads(slots)
|
||||||
@ -74,4 +75,4 @@ class Completion:
|
|||||||
'response': text,
|
'response': text,
|
||||||
'links' : loads(thirdPartySearchResults)['search']["third_party_search_results"] if includelinks else None,
|
'links' : loads(thirdPartySearchResults)['search']["third_party_search_results"] if includelinks else None,
|
||||||
'extra' : extra if detailed else None,
|
'extra' : extra if detailed else None,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user