Commit ca37ead8 authored by luxq's avatar luxq

add ai config in bunnyfinder

parent c4ae15e5
...@@ -31,4 +31,7 @@ bunnyfinder_params: ...@@ -31,4 +31,7 @@ bunnyfinder_params:
dbconnect: 'eth:12345678@tcp(172.17.0.1:3306)/eth' dbconnect: 'eth:12345678@tcp(172.17.0.1:3306)/eth'
max_malicious_idx: "85" max_malicious_idx: "85"
duration_per_strategy: "30" duration_per_strategy: "30"
openai_key: ""
openai_base_url: ""
llm_model: ""
...@@ -131,6 +131,7 @@ def get_config( ...@@ -131,6 +131,7 @@ def get_config(
files={ files={
BUNNYFINDER_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name, BUNNYFINDER_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
}, },
env_vars={"OPENAI_API_KEY": bunnyfinder_params.openai_key, "OPENAI_BASE_URL": bunnyfinder_params.openai_base_url, "LLM_MODEL": bunnyfinder_params.llm_model},
cmd=["--config", config_file_path, cmd=["--config", config_file_path,
"--strategy", bunnyfinder_params.strategy, "--strategy", bunnyfinder_params.strategy,
"--duration-per-strategy-run", bunnyfinder_params.duration_per_strategy, "--duration-per-strategy-run", bunnyfinder_params.duration_per_strategy,
......
...@@ -470,6 +470,9 @@ def input_parser(plan, input_args): ...@@ -470,6 +470,9 @@ def input_parser(plan, input_args):
duration_per_strategy=result["bunnyfinder_params"]["duration_per_strategy"], duration_per_strategy=result["bunnyfinder_params"]["duration_per_strategy"],
min_malicious_idx=result["bunnyfinder_params"]["min_malicious_idx"], min_malicious_idx=result["bunnyfinder_params"]["min_malicious_idx"],
max_malicious_idx=result["bunnyfinder_params"]["max_malicious_idx"], max_malicious_idx=result["bunnyfinder_params"]["max_malicious_idx"],
openai_key=result["bunnyfinder_params"]["openai_key"],
openai_base_url=result["bunnyfinder_params"]["openai_base_url"],
llm_model=result["bunnyfinder_params"]["llm_model"],
), ),
additional_services=result["additional_services"], additional_services=result["additional_services"],
wait_for_finalization=result["wait_for_finalization"], wait_for_finalization=result["wait_for_finalization"],
...@@ -1215,6 +1218,9 @@ def get_default_bunnyfinder_params(): ...@@ -1215,6 +1218,9 @@ def get_default_bunnyfinder_params():
"duration_per_strategy": "60", "duration_per_strategy": "60",
"min_malicious_idx": "0", "min_malicious_idx": "0",
"max_malicious_idx": "31", "max_malicious_idx": "31",
"openai_key": "",
"openai_base_url": "",
"llm_model": "",
} }
......
...@@ -261,6 +261,9 @@ SUBCATEGORY_PARAMS = { ...@@ -261,6 +261,9 @@ SUBCATEGORY_PARAMS = {
"duration_per_strategy", "duration_per_strategy",
"max_malicious_idx", "max_malicious_idx",
"min_malicious_idx", "min_malicious_idx",
"openai_key",
"openai_base_url",
"llm_model",
], ],
"port_publisher": [ "port_publisher": [
"nat_exit_ip", "nat_exit_ip",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment