forked from AgentEra/Agently-Daily-News-Collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
26 lines (23 loc) · 932 Bytes
/
app.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
import Agently
import utils.yaml_reader as yaml
from utils.logger import Logger
from workflows import main_workflow
from utils.path import root_path
# Settings and Logger
SETTINGS = yaml.read("./SETTINGS.yaml")
logger = Logger(console_level = "DEBUG" if SETTINGS.IS_DEBUG else "INFO")
# Agent Factory
agent_factory = (
Agently.AgentFactory(is_debug=SETTINGS.IS_DEBUG)
.set_settings("current_model", SETTINGS.MODEL_PROVIDER)
.set_settings(f"model.{ SETTINGS.MODEL_PROVIDER }.auth", SETTINGS.MODEL_AUTH)
.set_settings(f"model.{ SETTINGS.MODEL_PROVIDER }.url", SETTINGS.MODEL_URL if hasattr(SETTINGS, "MODEL_URL") else None)
.set_settings(f"model.{ SETTINGS.MODEL_PROVIDER }.options", SETTINGS.MODEL_OPTIONS if hasattr(SETTINGS, "MODEL_OPTIONS") else {})
)
# Start Workflow
main_workflow.start(
agent_factory=agent_factory,
SETTINGS=SETTINGS,
root_path=root_path,
logger=logger,
)