Kotta commited on
Commit ·
bc41366
1
Parent(s): 74f7ac4
feature(#23): implement async logic in auto task achievement.
Browse files
Brain/src/service/auto_task_service.py
CHANGED
|
@@ -4,6 +4,8 @@ import firebase_admin
|
|
| 4 |
from Brain.src.model.req_model import ReqModel
|
| 5 |
from Brain.src.rising_plugin.llm.autogpt_llm import AutoGPTLLM
|
| 6 |
import time
|
|
|
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
class AutoTaskService:
|
|
@@ -21,9 +23,10 @@ class AutoTaskService:
|
|
| 21 |
llm_name="autogpt", uuid=setting.uuid
|
| 22 |
)
|
| 23 |
# call autogpt
|
| 24 |
-
|
| 25 |
-
|
| 26 |
)
|
|
|
|
| 27 |
|
| 28 |
return reference_link
|
| 29 |
|
|
|
|
| 4 |
from Brain.src.model.req_model import ReqModel
|
| 5 |
from Brain.src.rising_plugin.llm.autogpt_llm import AutoGPTLLM
|
| 6 |
import time
|
| 7 |
+
import asyncio
|
| 8 |
+
import threading
|
| 9 |
|
| 10 |
|
| 11 |
class AutoTaskService:
|
|
|
|
| 23 |
llm_name="autogpt", uuid=setting.uuid
|
| 24 |
)
|
| 25 |
# call autogpt
|
| 26 |
+
thread = threading.Thread(
|
| 27 |
+
target=autogpt_llm.ask_task, args=(query, firebase_app, reference_link)
|
| 28 |
)
|
| 29 |
+
thread.start()
|
| 30 |
|
| 31 |
return reference_link
|
| 32 |
|