Browse Source

Merge pull request #203 from meirm/bug_stream

Fix bug in sendMessage by moving code
pull/219/head
xssdoctor 8 months ago committed by GitHub
parent
commit
efa0abcfee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      installer/client/cli/utils.py

11
installer/client/cli/utils.py

@ -248,6 +248,11 @@ class Standalone:
presence_penalty=0.1, presence_penalty=0.1,
) )
print(response.choices[0].message.content) print(response.choices[0].message.content)
if self.args.copy:
pyperclip.copy(response.choices[0].message.content)
if self.args.output:
with open(self.args.output, "w") as f:
f.write(response.choices[0].message.content)
except Exception as e: except Exception as e:
if "All connection attempts failed" in str(e): if "All connection attempts failed" in str(e):
print( print(
@ -263,11 +268,7 @@ class Standalone:
else: else:
print(f"Error: {e}") print(f"Error: {e}")
print(e) print(e)
if self.args.copy:
pyperclip.copy(response.choices[0].message.content)
if self.args.output:
with open(self.args.output, "w") as f:
f.write(response.choices[0].message.content)
def fetch_available_models(self): def fetch_available_models(self):
gptlist = [] gptlist = []

Loading…
Cancel
Save