File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -360,6 +360,14 @@ In fact, reducing the amount of hidden state and forcing the agent to work with
360360
361361We still need to tell the LM a bit more about how to behave:
362362
363+ ``` python
364+ messages = [{
365+ " role" : " system" ,
366+ " content" : " You are a helpful assistant. When you want to run a command, wrap it in ```bash-action\n <command>\n ```. To finish, run the exit command."
367+ }
368+ ]
369+ ```
370+
363371### Let's put it together & run it!
364372
365373You should now have code that looks something like this (this example uses litellm + triple backticks):
@@ -404,7 +412,7 @@ def execute_action(command: str) -> str:
404412# Main agent loop
405413messages = [{
406414 " role" : " system" ,
407- " content" : " You are a helpful assistant. When you want to run a command, wrap it in ```bash-action\n <command>\n ```"
415+ " content" : " You are a helpful assistant. When you want to run a command, wrap it in ```bash-action\n <command>\n ```. To finish, run the exit command. "
408416}, {
409417 " role" : " user" ,
410418 " content" : " List the files in the current directory"
You can’t perform that action at this time.
0 commit comments