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 --- lang_prompt_demo.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lang_prompt_demo.py') diff --git a/lang_prompt_demo.py b/lang_prompt_demo.py index d63aea3..31b5077 100644 --- a/lang_prompt_demo.py +++ b/lang_prompt_demo.py @@ -5,7 +5,9 @@ from dotenv import load_dotenv from tools.contacts import get_all_contacts from tools.vocode import call_phone_number +from tools.get_user_inputs import get_desired_inputs from langchain.memory import ConversationBufferMemory +from langchain.agents import load_tools from stdout_filterer import RedactPhoneNumbers @@ -21,6 +23,7 @@ if __name__ == "__main__": OBJECTIVE = ( input("Objective: ") + + "make sure you use the proper tool before calling final action to meet objective, feel free to say you need more information or cannot do something." or "Find a random person in my contacts and tell them a joke" ) llm = ChatOpenAI(temperature=0, model_name="gpt-4") # type: ignore @@ -28,10 +31,16 @@ if __name__ == "__main__": # Logging of LLMChains verbose = True agent = initialize_agent( - tools=[get_all_contacts, call_phone_number], + tools=[ + get_all_contacts, + call_phone_number, + get_desired_inputs, + ] + + load_tools(["human"]), llm=llm, agent=AgentType.CHAT_CONVERSATIONAL_REACT_DESCRIPTION, verbose=verbose, memory=memory, ) + agent.run(OBJECTIVE) -- cgit v1.2.3