Skip to content
Merged

V3 #2

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
introduce MAX_ROUND environmental variable
  • Loading branch information
andreashappe committed Sep 7, 2023
commit 957eb101f4eb20b146a867aba73dc1985badc146
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ TARGET_USER='bob'
TARGET_PASSWORD='secret'

# which LLM driver to use (can be openai_rest or oobabooga for now)
LLM_CONNECTION = "openai_rest"
LLM_CONNECTION = "openai_rest"

# how many rounds should this thing go?
MAX_ROUNDS = 20
5 changes: 4 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ def target_user():
return os.getenv('TARGET_USER')

def llm_connection():
return os.getenv("LLM_CONNECTION")
return os.getenv("LLM_CONNECTION")

def max_rounds():
return int(os.getenv("MAX_ROUNDS"))
10 changes: 7 additions & 3 deletions wintermute.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# setup dotenv
load_dotenv()


# setup some infrastructure
cmd_history = ResultHistory()
console = Console()
Expand Down Expand Up @@ -57,7 +56,10 @@ def handle_ssh(input):
except paramiko.ssh_exception.AuthenticationException:
return cmd, "Authentication error, credentials are wrong"

while True:
round : int = 0
max_rounds : int = config.max_rounds()

while round < max_rounds:

state_size = num_tokens_from_string(state)

Expand All @@ -82,4 +84,6 @@ def handle_ssh(input):

# update our command history and output it
cmd_history.append(diff, next_cmd["type"], cmd, result, success, reason)
console.print(cmd_history.create_history_table())
console.print(cmd_history.create_history_table())

round += 1