aboutsummaryrefslogtreecommitdiff
path: root/tools/get_user_inputs.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/get_user_inputs.py')
-rw-r--r--tools/get_user_inputs.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/get_user_inputs.py b/tools/get_user_inputs.py
new file mode 100644
index 0000000..3b59a3a
--- /dev/null
+++ b/tools/get_user_inputs.py
@@ -0,0 +1,37 @@
+from typing import List
+from langchain.agents import tool
+
+from dotenv import load_dotenv
+
+from langchain.agents import load_tools
+from langchain.llms import OpenAI
+from langchain.agents import initialize_agent, AgentType
+
+load_dotenv()
+
+import os
+
+INPUTS = {}
+
+
+@tool("get_desired_inputs")
+def get_desired_inputs(input: str) -> dict:
+ """
+ You will be given a task that will be performed by an autonomous agent on behalf of a user. You will gather any necessary data from the user to complete the specified task before executing the task.
+ """
+
+ prompt = input
+
+ llm = OpenAI(temperature=0)
+ agent = initialize_agent(
+ tools=load_tools(["human"]),
+ llm=llm,
+ agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
+ )
+
+ return agent.run(prompt)
+
+
+def get_user_inputs():
+ # iterate through INPUTS and populate values
+ print("Done")