Skip to content

Commit

Permalink
docs: slim down readme slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
sradc committed Oct 8, 2023
1 parent b273d01 commit b629946
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 49 deletions.
49 changes: 15 additions & 34 deletions README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,38 +59,6 @@
"import make_agents as ma"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Action function, `message_user`\n",
"\n",
"An action function must have at most one argument, and that argument must be annotated with a Pydantic model. \n",
"The function's name, its docstring, and the Pydantic model, is provided to the LLM, and should be considered as part of the promping strategy.\n",
"It's not recommended to annotate the arg in the docstring, since it is done via the Pydantic model already.\n",
"\n",
"This action function allows the agent to message the user, and get a response."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"class MessageUserArg(BaseModel):\n",
" message: str = Field(description=\"Message to send user\")\n",
"\n",
"\n",
"@ma.action\n",
"def message_user(arg: MessageUserArg):\n",
" \"\"\"Send the user a message, and get their response.\"\"\"\n",
" response = \"\"\n",
" while response == \"\":\n",
" response = input(arg.message).strip()\n",
" return response"
]
},
{
"cell_type": "code",
"execution_count": 3,
Expand Down Expand Up @@ -177,7 +145,20 @@
}
],
"source": [
"# Define the remaining action functions.\n",
"# First define the action functions\n",
"\n",
"\n",
"class MessageUserArg(BaseModel):\n",
" message: str = Field(description=\"Message to send user\")\n",
"\n",
"\n",
"@ma.action\n",
"def message_user(arg: MessageUserArg):\n",
" \"\"\"Send the user a message, and get their response.\"\"\"\n",
" response = \"\"\n",
" while response == \"\":\n",
" response = input(arg.message).strip()\n",
" return response\n",
"\n",
"\n",
"@ma.action\n",
Expand Down Expand Up @@ -218,7 +199,7 @@
"source": [
"### Example 2: A system assistant <span style=\"color:red\"> — _dangerous_</span>\n",
"\n",
"In this example, the agent is allowed to run bash commands on your system, and read the results... Validation is implemented, so please make sure you understand the command before allowing it to run."
"This agent is allowed to run bash commands on your system, and read the results... Validation is implemented, so <b>please make sure you understand the commands before allowing them to run.</b>"
]
},
{
Expand Down
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,11 @@ from pydantic import BaseModel, Field
import make_agents as ma
```

#### Action function, `message_user`

An action function must have at most one argument, and that argument must be annotated with a Pydantic model.
The function's name, its docstring, and the Pydantic model, is provided to the LLM, and should be considered as part of the promping strategy.
It's not recommended to annotate the arg in the docstring, since it is done via the Pydantic model already.

This action function allows the agent to message the user, and get a response.
```python
# First define the action functions


```python
class MessageUserArg(BaseModel):
message: str = Field(description="Message to send user")

Expand All @@ -69,11 +64,6 @@ def message_user(arg: MessageUserArg):
while response == "":
response = input(arg.message).strip()
return response
```


```python
# Define the remaining action functions.


@ma.action
Expand Down Expand Up @@ -114,7 +104,7 @@ print(f"Retrieved user_name: {json.loads(messages[-1]['content'])}")



![png](https://raw.githubusercontent.com/sradc/MakeAgents/main/README_files/README_4_1.png)
![png](https://raw.githubusercontent.com/sradc/MakeAgents/main/README_files/README_2_1.png)



Expand Down Expand Up @@ -164,7 +154,7 @@ print(f"Retrieved user_name: {json.loads(messages[-1]['content'])}")

### Example 2: A system assistant <span style="color:red"> — _dangerous_</span>

In this example, the agent is allowed to run bash commands on your system, and read the results... Validation is implemented, so please make sure you understand the command before allowing it to run.
This agent is allowed to run bash commands on your system, and read the results... Validation is implemented, so <b>please make sure you understand the commands before allowing them to run.</b>


```python
Expand Down Expand Up @@ -218,7 +208,7 @@ for messages in ma.run_agent(action_graph):



![png](https://raw.githubusercontent.com/sradc/MakeAgents/main/README_files/README_7_1.png)
![png](https://raw.githubusercontent.com/sradc/MakeAgents/main/README_files/README_5_1.png)



Expand Down
Binary file added README_files/README_2_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/README_2_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/README_5_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/README_5_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b629946

Please sign in to comment.