diff --git a/oracle-test/README.md b/oracle-test/README.md new file mode 100644 index 0000000..6e789a8 --- /dev/null +++ b/oracle-test/README.md @@ -0,0 +1 @@ +![diagram](./diagram.png) diff --git a/oracle-test/diagram.png b/oracle-test/diagram.png new file mode 100644 index 0000000..c1710f3 Binary files /dev/null and b/oracle-test/diagram.png differ diff --git a/oracle-test/run.py b/oracle-test/run.py new file mode 100644 index 0000000..e69de29 diff --git a/oracle-test/server.js b/oracle-test/server.js new file mode 100644 index 0000000..a0da8f3 --- /dev/null +++ b/oracle-test/server.js @@ -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}`) +}); diff --git a/oracle-test/victim.py b/oracle-test/victim.py new file mode 100644 index 0000000..3c36e9a --- /dev/null +++ b/oracle-test/victim.py @@ -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)