Skip to content

Commit fa5c3c5

Browse files
Merge pull request #47 from dreadnode/example/add-robopages-tool-server-example
feat: add robopages native tool server example
2 parents 4874950 + bb1bf7a commit fa5c3c5

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ Want more?
140140
- OverTheWire Bandit Agent: [**bandit.py**](examples/bandit.py)
141141
- Damn Vulnerable Restaurant Agent: [**dvra.py**](examples/dvra.py)
142142
- RAG Pipeline: [**rag.py**](examples/rag.py) (from [kyleavery](https://github.com/kyleavery/))
143-
143+
- Integrating dreadnode-owned [robopages](https://github.com/dreadnode/robopages-cli) as a tool server (basic nmap scan example): [**rigging_example.py**](https://github.com/dreadnode/robopages-cli/blob/main/examples/rigging_example.py)
144+
144145
## Documentation
145146

146147
**[docs.dreadnode.io](https://docs.dreadnode.io/open-source/rigging/intro)** has everything you need.

examples/robopages.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import asyncio
2+
import os
3+
4+
import litellm
5+
import logfire
6+
7+
import rigging as rg
8+
9+
# Constants
10+
SYSTEM_PROMPT = "Enumerate all open TCP ports on 127.0.0.1 and provide a vulnerability report"
11+
12+
# LOGFIRE_PROJECT = "rigging-demos"
13+
logfire.configure()
14+
os.environ.setdefault("LOGFIRE_TOKEN", "") # (1)!
15+
litellm.callbacks = ["logfire"]
16+
17+
rg.logging.configure_logging("debug")
18+
19+
20+
async def main():
21+
tools = rg.integrations.robopages("http://localhost:8000")
22+
chat = await rg.get_generator("gpt-4").chat(SYSTEM_PROMPT).using(*tools).run()
23+
print(chat.conversation)
24+
25+
26+
if __name__ == "__main__":
27+
asyncio.run(main())

0 commit comments

Comments
 (0)