aboutsummaryrefslogtreecommitdiff
path: root/lang_prompt_demo.py
diff options
context:
space:
mode:
authorGregory Sinnott <gnsinnott@gmail.com>2023-10-14 04:33:34 -0600
committerGregory Sinnott <gnsinnott@gmail.com>2023-10-14 04:33:34 -0600
commit5856edfb295bc3d4348398912da66824986dda09 (patch)
tree0318635e8dfe19c27297dd2264e9b42099ec9e8a /lang_prompt_demo.py
parent1808d25fea07c51e251941ef414f396ef8c95c27 (diff)
User inputs and call criteria changes
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)