forked from seanpixel/Teenage-AGI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (27 loc) · 995 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import agent
import os
from agent import Agent
from dotenv import load_dotenv
# Load default environment variables (.env)
load_dotenv()
AGENT_NAME = os.getenv("AGENT_NAME", "my-agent")
agent = Agent(AGENT_NAME)
# Creates Pinecone Index
agent.createIndex()
print("Talk to the AI!")
while True:
userInput = input()
if userInput:
if (userInput.startswith("read:")):
agent.read(" ".join(userInput.split(" ")[1:]))
print("Understood! The information is stored in my memory.")
elif (userInput.startswith("think:")):
agent.think(" ".join(userInput.split(" ")[1:]))
print("Understood! I stored that thought into my memory.")
elif (userInput.startswith("readDoc:")):
agent.readDoc(" ".join(userInput.split(" ")[1:]))
print("Understood! I stored the document into my memory.")
else:
print(agent.action(userInput), "\n")
else:
print("SYSTEM - Give a valid input")