Skip to content

Commit

Permalink
Updating code to work with openai -v >= 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
msladic1 authored Dec 19, 2023
1 parent 7e6a16b commit 199e43f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions LinuxSSHbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ def main():

logs = open("history.txt", "a+", encoding="utf-8")
try:
res = openai.ChatCompletion.create(
res = openai.chat.completions.create(
model="gpt-3.5-turbo-16k",
messages = messages,
temperature = 0.0,
max_tokens = 800
)

message = res["choices"][0]["message"].to_dict()
msg = res.choices[0].message.content
message = {"content": msg, "role": 'assistant'}

if "$cd" in message["content"] or "$ cd" in message["content"]:
message["content"] = message["content"].split("\n")[1]
Expand Down

0 comments on commit 199e43f

Please sign in to comment.