-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick.py
More file actions
28 lines (18 loc) · 763 Bytes
/
quick.py
File metadata and controls
28 lines (18 loc) · 763 Bytes
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
from pathlib import Path
from tinygent.cli.utils import discover_and_register_components
from tinygent.core.factory import build_agent
from tinygent.logging import setup_logger
from tinygent.utils import tiny_yaml_load
logger = setup_logger('debug')
def main():
parent_path = Path(__file__).parent
# Discover and register tools and middleware from main.py
discover_and_register_components(str(parent_path / 'main.py'))
agent = build_agent(tiny_yaml_load(str(parent_path / 'agent.yaml')))
result = agent.run(
'Will the Albany in Georgia reach a hundred thousand occupants before the one in New York?'
)
logger.info('[RESULT] %s', result)
logger.info('[AGENT] %s', str(agent))
if __name__ == '__main__':
main()