diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2023-10-14 04:39:41 -0600 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2023-10-14 04:39:41 -0600 |
commit | 704b6407b4e51800376e73fe934a762e94b30d9d (patch) | |
tree | f51b5c0bd74abd7b836746f3f2222d282bbd541e /lang_prompt_demo.py | |
parent | d433b974d9f15f9a7ab57ba592a4858e7977726d (diff) |
rebased
Diffstat (limited to 'lang_prompt_demo.py')
-rw-r--r-- | lang_prompt_demo.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lang_prompt_demo.py b/lang_prompt_demo.py index 31b5077..3d8f1cd 100644 --- a/lang_prompt_demo.py +++ b/lang_prompt_demo.py @@ -6,6 +6,7 @@ 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 tools.email_tool import email_tasks from langchain.memory import ConversationBufferMemory from langchain.agents import load_tools @@ -14,6 +15,7 @@ from stdout_filterer import RedactPhoneNumbers load_dotenv() from langchain.chat_models import ChatOpenAI +from langchain.chat_models import BedrockChat from langchain.agents import initialize_agent from langchain.agents import AgentType @@ -26,17 +28,13 @@ if __name__ == "__main__": + "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 + #llm = ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo") # type: ignore + llm = BedrockChat(model_id="anthropic.claude-instant-v1", model_kwargs={"temperature":0}) # type: ignore memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True) # Logging of LLMChains verbose = True agent = initialize_agent( - tools=[ - get_all_contacts, - call_phone_number, - get_desired_inputs, - ] - + load_tools(["human"]), + tools=[get_all_contacts, call_phone_number, email_tasks] + load_tools(["serpapi", "human"]), llm=llm, agent=AgentType.CHAT_CONVERSATIONAL_REACT_DESCRIPTION, verbose=verbose, |