From 5856edfb295bc3d4348398912da66824986dda09 Mon Sep 17 00:00:00 2001 From: Gregory Sinnott Date: Sat, 14 Oct 2023 04:33:34 -0600 Subject: User inputs and call criteria changes --- tools/get_user_inputs.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tools/get_user_inputs.py (limited to 'tools/get_user_inputs.py') 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") -- cgit v1.2.3