aboutsummaryrefslogtreecommitdiff
path: root/lang_prompt_demo.py
diff options
context:
space:
mode:
Diffstat (limited to 'lang_prompt_demo.py')
-rw-r--r--lang_prompt_demo.py11
1 files changed, 10 insertions, 1 deletions
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)