You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: readme.md
+11-12
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@ The CLI will interface with the same system configuration info as the Arduino ID
18
18
## Running Your First Test
19
19
To run your first test, first edit the ``llm_prompts.json`` file to include the prompt you want to test. The format of this file is as follows, note that you can choose to specify any number of prompts in the file, which could be useful if you want to compare the performance of different prompting strategies for a task. The example below includes two different prompt examples:
20
20
```
21
-
{
22
21
{
23
22
"llm_prompts": [
24
23
{
@@ -38,17 +37,17 @@ Next, open the ``testbench.py`` file and adjust the script parameters at the top
38
37
-__temperature__: the temperature to use for the LLM.
39
38
-__repetition__: the number of times to try each prompt
40
39
-__max_calls_per_minute__: the maximum number of calls to the LLM API to make per minute. This is useful to avoid hitting the API rate limit for models that have a limit expressed in requests per minute. Most APIs have now moved on to tokens/min for limits.
41
-
-__port__: the port on the computer that the Arduino to run LLM code is connected to. You can find this port by opening Arduino IDE and seeing which port the different boards are connected to. It might look something like ``COM3`` or ``/dev/cu.usbmodem14101`` depending on your operating system.
42
-
-__servo_port__: the port on the computer that is controlling the servo, currently used for IMU tests
43
-
-__verify_port__: the port on the computer that the Arduino to run human-written code is connected to. This is used to verify the output of the LLM code.
44
-
-__arduino_type__: the type of Arduino connected to ``port``. This is used to determine the correct board type to use when calling the build and upload commands in the Arduino CLI
45
-
-__scratch_name__: the name of the scratch file to use to store the LLM generated code before it is compiled and uploaded to the Arduino. You should only change this if for some reason Arduino CLI is having issues accessing the file in the project directory.
46
-
-__save_programs__: whether or not to save each generated program to the ``programs`` directory. This is useful for debugging and for generating a dataset of programs for future use.
47
-
-__baudrate__: the baudrate to use for the serial connection to the Arduino. This should match the baudrate specified in your LLM prompts as well!
48
-
-__mode__: the type of test to run. Currently supports 3 tests - ``check_string``, ``1D``, and ``IMU``.
49
-
-__timeout__: the timeout for how long to listen for serial output from the connected Arduino boards. For most tests, something between 5-10s should be sufficient.
50
-
-__expected_msg__: for the ``check_string`` test, this is the string to expect from the Arduino running human-written code.
51
-
-__threshold__: for the ``1D`` test, this is the threshold for the maximum euclidean distabce between the LLM and human-written code outputs. For the ``IMU`` test, this is the threshold for the allowable difference in average values for each position and each IMU axis. To find the appropriate threshold, test with human-written code first to understand the expected range of values for correct code.
40
+
-__port__: the port on the computer that the Arduino to run LLM code is connected to. You can find this port by opening Arduino IDE and seeing which port the different boards are connected to. It might look something like ``COM3`` or ``/dev/cu.usbmodem14101`` depending on your operating system.
41
+
-__servo_port__: the port on the computer that is controlling the servo, currently used for IMU tests
42
+
-__verify_port__: the port on the computer that the Arduino to run human-written code is connected to. This is used to verify the output of the LLM code.
43
+
-__arduino_type__: the type of Arduino connected to ``port``. This is used to determine the correct board type to use when calling the build and upload commands in the Arduino CLI
44
+
-__scratch_name__: the name of the scratch file to use to store the LLM generated code before it is compiled and uploaded to the Arduino. You should only change this if for some reason Arduino CLI is having issues accessing the file in the project directory.
45
+
-__save_programs__: whether or not to save each generated program to the ``programs`` directory. This is useful for debugging and for generating a dataset of programs for future use.
46
+
-__baudrate__: the baudrate to use for the serial connection to the Arduino. This should match the baudrate specified in your LLM prompts as well!
47
+
-__mode__: the type of test to run. Currently supports 3 tests - ``check_string``, ``1D``, and ``IMU``.
48
+
-__timeout__: the timeout for how long to listen for serial output from the connected Arduino boards. For most tests, something between 5-10s should be sufficient.
49
+
-__expected_msg__: for the ``check_string`` test, this is the string to expect from the Arduino running human-written code.
50
+
-__threshold__: for the ``1D`` test, this is the threshold for the maximum euclidean distabce between the LLM and human-written code outputs. For the ``IMU`` test, this is the threshold for the allowable difference in average values for each position and each IMU axis. To find the appropriate threshold, test with human-written code first to understand the expected range of values for correct code.
52
51
53
52
### API keys:
54
53
You will need either a Google or OpenAI API key to run this code. You can place the key for each vendor in a file called ``OpenAI.key`` or ``PaLM.key`` in the root directory of the project. The code will automatically read the key from the file and use it to authenticate with the API.
0 commit comments