mirror of
https://github.com/danielmiessler/fabric
synced 2024-11-10 07:10:31 +00:00
Merge pull request #203 from meirm/bug_stream
Fix bug in sendMessage by moving code
This commit is contained in:
commit
efa0abcfee
@ -248,6 +248,11 @@ class Standalone:
|
||||
presence_penalty=0.1,
|
||||
)
|
||||
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:
|
||||
if "All connection attempts failed" in str(e):
|
||||
print(
|
||||
@ -263,11 +268,7 @@ class Standalone:
|
||||
else:
|
||||
print(f"Error: {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):
|
||||
gptlist = []
|
||||
|
Loading…
Reference in New Issue
Block a user