File size: 616 Bytes
9609347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from langchain_openai import ChatOpenAI
from dotenv import load_dotenv
from push_notifications_helper import push
from langchain.agents import Tool

from tools import tool_push, tool_search_web

load_dotenv(override=True)


def main():
    print("Hello from sanatan-ai!")
    llm = ChatOpenAI()
    llm_response = llm.invoke("Generate a simple question to ask the user about geography.")
    # print(response)
    response = tool_search_web.invoke(llm_response.content)
    message = "Question: " + llm_response.content + "\nAnswer: " + response
    tool_push.invoke(message)


if __name__ == "__main__":
    main()