mirror of
https://github.com/velocitatem/raccoon.git
synced 2026-05-31 08:43:36 +00:00
Extras
This commit is contained in:
1
oracle-test/README.md
Normal file
1
oracle-test/README.md
Normal file
@@ -0,0 +1 @@
|
||||

|
||||
BIN
oracle-test/diagram.png
Normal file
BIN
oracle-test/diagram.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
0
oracle-test/run.py
Normal file
0
oracle-test/run.py
Normal file
18
oracle-test/server.js
Normal file
18
oracle-test/server.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
let port = 8000;
|
||||
|
||||
// read the port from config.json
|
||||
const config = require('./config.json');
|
||||
port = config.port;
|
||||
|
||||
// create an http server with some endpoints GET
|
||||
// GET /validate -> return "I thought I would sail about a little and see the watery part of the world"
|
||||
|
||||
app.get('/validate', (req, res) => {
|
||||
res.send('I thought I would sail about a little and see the watery part of the world');
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Example app listening at http://localhost:${port}`)
|
||||
});
|
||||
22
oracle-test/victim.py
Normal file
22
oracle-test/victim.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from langchain.utilities import RequestsWrapper, BashProcess
|
||||
from langchain.agents import load_tools
|
||||
from langchain.agents import initialize_agent
|
||||
from langchain.llms import OpenAI
|
||||
|
||||
llm = OpenAI(temperature=0)
|
||||
|
||||
# load the tools
|
||||
|
||||
|
||||
tools = load_tools(["requests", "terminal", "python_repl"], llm=llm)
|
||||
|
||||
agent = initialize_agent(tools, llm, agent="zero-shot-react-description", verbose=True)
|
||||
|
||||
def run(prompt):
|
||||
return agent(prompt)
|
||||
|
||||
if __name__ == "__main__":
|
||||
while True:
|
||||
question = input("Ask a question: ")
|
||||
response = agent(question)
|
||||
print(response)
|
||||
Reference in New Issue
Block a user