Spaces:
Running
on
Zero
Running
on
Zero
test
Browse files- babyagi/babyagi.py +22 -1
- chat_history.db +0 -0
- controllers/gpt_enginner20240623184910 +1 -0
- workspace/greet_user.py +0 -0
babyagi/babyagi.py
CHANGED
@@ -36,6 +36,7 @@ import pkgutil
|
|
36 |
import async_timeout
|
37 |
import asyncio
|
38 |
import sys
|
|
|
39 |
|
40 |
args = sys.argv
|
41 |
|
@@ -790,27 +791,47 @@ if not JOIN_EXISTING_OBJECTIVE:
|
|
790 |
}
|
791 |
tasks_storage.append(initial_task)
|
792 |
|
793 |
-
|
794 |
def main():
|
795 |
loop = True
|
|
|
|
|
|
|
|
|
|
|
796 |
while loop:
|
797 |
# As long as there are tasks in the storage...
|
798 |
if not tasks_storage.is_empty():
|
799 |
#OBJECTIVE = "ボットの性能をよくする方法 日本語で説明"
|
800 |
# Print the task list
|
801 |
print("\033[95m\033[1m" + "\n*****TASK LIST*****\n" + "\033[0m\033[0m")
|
|
|
802 |
for t in tasks_storage.get_task_names():
|
803 |
print(" • " + str(t))
|
|
|
|
|
|
|
804 |
|
805 |
# Step 1: Pull the first incomplete task
|
806 |
task = tasks_storage.popleft()
|
807 |
print("\033[92m\033[1m" + "\n*****NEXT TASK*****\n" + "\033[0m\033[0m")
|
|
|
808 |
print(str(task["task_name"]))
|
|
|
|
|
|
|
|
|
809 |
|
810 |
# Send to execution function to complete the task based on the context
|
811 |
result = execution_agent(OBJECTIVE, str(task["task_name"]))
|
812 |
print("\033[93m\033[1m" + "\n*****TASK RESULT*****\n" + "\033[0m\033[0m")
|
|
|
813 |
print(result)
|
|
|
|
|
|
|
|
|
|
|
814 |
|
815 |
# Step 2: Enrich result and store in the results storage
|
816 |
# This is where you should enrich the result if needed
|
|
|
36 |
import async_timeout
|
37 |
import asyncio
|
38 |
import sys
|
39 |
+
from mysite.interpreter.google_chat import send_google_chat_card
|
40 |
|
41 |
args = sys.argv
|
42 |
|
|
|
791 |
}
|
792 |
tasks_storage.append(initial_task)
|
793 |
|
794 |
+
import os
|
795 |
def main():
|
796 |
loop = True
|
797 |
+
webhook_url = os.getenv("chat_url")
|
798 |
+
#OBJECTIVE = message
|
799 |
+
loop = True
|
800 |
+
result_all = ""
|
801 |
+
count = 0
|
802 |
while loop:
|
803 |
# As long as there are tasks in the storage...
|
804 |
if not tasks_storage.is_empty():
|
805 |
#OBJECTIVE = "ボットの性能をよくする方法 日本語で説明"
|
806 |
# Print the task list
|
807 |
print("\033[95m\033[1m" + "\n*****TASK LIST*****\n" + "\033[0m\033[0m")
|
808 |
+
print("\033[95m\033[1m" + "\n*****TASK LIST*****\n" + "\033[0m\033[0m")
|
809 |
for t in tasks_storage.get_task_names():
|
810 |
print(" • " + str(t))
|
811 |
+
#yield str(t)
|
812 |
+
result_all += str(t)+"\r\n"
|
813 |
+
send_google_chat_card(webhook_url,OBJECTIVE,result_all,"tesst","test")
|
814 |
|
815 |
# Step 1: Pull the first incomplete task
|
816 |
task = tasks_storage.popleft()
|
817 |
print("\033[92m\033[1m" + "\n*****NEXT TASK*****\n" + "\033[0m\033[0m")
|
818 |
+
#yield "\033[92m\033[1m" + "\n*****NEXT TASK*****\n" + "\033[0m\033[0m"
|
819 |
print(str(task["task_name"]))
|
820 |
+
#yield str(task["task_name"])
|
821 |
+
result_all += str(task["task_name"])+"\r\n"
|
822 |
+
send_google_chat_card(webhook_url,OBJECTIVE,result_all,"tesst","test")
|
823 |
+
|
824 |
|
825 |
# Send to execution function to complete the task based on the context
|
826 |
result = execution_agent(OBJECTIVE, str(task["task_name"]))
|
827 |
print("\033[93m\033[1m" + "\n*****TASK RESULT*****\n" + "\033[0m\033[0m")
|
828 |
+
#yield "\033[93m\033[1m" + "\n*****TASK RESULT*****\n" + "\033[0m\033[0m"
|
829 |
print(result)
|
830 |
+
#yield result
|
831 |
+
result_all += result+"\r\n"
|
832 |
+
send_google_chat_card(webhook_url,OBJECTIVE,result_all,"tesst","test")
|
833 |
+
|
834 |
+
#yield result_all
|
835 |
|
836 |
# Step 2: Enrich result and store in the results storage
|
837 |
# This is where you should enrich the result if needed
|
chat_history.db
CHANGED
Binary files a/chat_history.db and b/chat_history.db differ
|
|
controllers/gpt_enginner20240623184910
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit f43122ce5f44265696fdffa021c8ddd8c190d201
|
workspace/greet_user.py
ADDED
File without changes
|