-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_topics.py
35 lines (25 loc) · 1.09 KB
/
_topics.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
34
import yaml, json
from os.path import join, isfile
from pprint import pprint as pp
# Import apc and execute_pipeline from auto_reflection
from auto_reflection import apc, execute_pipeline
# Set verbose to True
apc.verbose = True
if __name__ == '__main__':
if 0: # no mock
py_pipeline_name = 'topics'
yaml_pprompt_config = join('yaml_config', 'topics.yaml')
title = "Building a Thriving Community: Collaborations and Initiatives at DeepLearning.AI"
if 1: # mock
py_pipeline_name = 'topics'
yaml_pprompt_config = join('yaml_config', 'topics.yaml')
title = "Building a Thriving Community: Collaborations and Initiatives at DeepLearning.AI"
if 1:
mock_file = join('mock', 'blog_writer', 'topics.json')
assert isfile(mock_file), f"Mock file not found: {mock_file}"
apc.load_mock(mock_file) # Access apc to load mock data
# Use execute_pipeline
if 1:
topics = execute_pipeline({'title':title}, py_pipeline_name, yaml_pprompt_config)
print(topics)
pp(json.loads(topics))