-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathingest_integrations.py
More file actions
27 lines (22 loc) · 953 Bytes
/
ingest_integrations.py
File metadata and controls
27 lines (22 loc) · 953 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
"""Integration data ingestion module.
This module reads integration definitions from YAML files and
ingests them into the Firebase database for use by the application.
"""
import yaml
try:
from firebase import Integration
except ImportError:
from .firebase import Integration
def ingest_integrations():
"""Ingest integration definitions from YAML file into Firebase.
Reads integration data from integrations.yaml and creates or updates
Integration records in Firebase with id, logo, name, description,
and example prompts.
"""
with open('integrations.yaml', 'r') as file:
integrations = yaml.safe_load(file)
for integration in integrations['integrations']:
print(integration['name'])
Integration.create_integration(integration['id'], integration['logo'], integration['name'], integration['description'], integration['prompts'])
if __name__ == '__main__':
ingest_integrations()