Q. What does it do?
A. It demonstrates how to create a simple IP network validator tool for an agent using OpenAI's GPT-4 model and the Rig library.
The agent can perform basic network operations using predefined tools.
The aim is to understand tools so I can progress to automate some cool sh*t related to smart contracts.
- A custom
IPtool
tool to perform check on whether an ip address is in the supernet. - Integration with OpenAI's GPT-4 via the Rig library.
- Use of
.env
file for configuration.
- Rust
- OpenAI API Key (set via
.env
)
-
Clone the repository:
git clone https://github.com/RGGH/rig_tools cd calculator-agent
-
Install dependencies:
cargo build
-
Create a
.env
file and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key
-
Run the project:
cargo run
- IpTool Tool: A simple tool that checks a host ip address against a supernet passed as arguments.
- OpenAI Client: Connects to OpenAI's GPT-4, with the IpTool agent prompting the model to verify the host address using the
ip_in_subnet
tool.
is 192.168.1.0 255.255.255.0 in 192.168.0.0?
network Agent: {"in_subnet":true,"ip":"192.168.1.1","valid":true}
This project is licensed under the MIT License - see the LICENSE file for details.