demos for network copilot and sql analyzer (#57)

* pulled from main branch after adding enums and made changes

* added sql_analyzer folder and built a demo for Employee stats function calling. "top_employees" and "aggregate_stats".

* sql_anayzer

* After addressing PR comments

* PR comments

* PR comments

* Addeed Network Analyzer FC Code

* Added network Analyzer code for diff timeframes

* Network Copilot and Employee Details demos are updated with their descriptions and resolved the PR comments

* Added 2nd function in network copilot

* Added 2nd function in network copilot

* Added 2nd function in network copilot

* Added 2nd function in network copilot

* Added 2nd function in network copilot
This commit is contained in:
Sampreeth Sarma 2024-09-19 11:40:31 -07:00 committed by GitHub
parent a91fbdbf1c
commit ed6a9139e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 1052 additions and 1 deletions

View file

@ -2,6 +2,9 @@ import os
import sentence_transformers
from gliner import GLiNER
from transformers import pipeline
import sqlite3
from employee_data_generator import generate_employee_data
from network_data_generator import generate_device_data, generate_interface_stats_data, generate_flow_data
def load_transformers(models = os.getenv("MODELS", "BAAI/bge-large-en-v1.5")):
transformers = {}
@ -26,3 +29,22 @@ def load_zero_shot_models(models = os.getenv("ZERO_SHOT_MODELS", "tasksource/deb
zero_shot_models[model] = pipeline("zero-shot-classification",model=model)
return zero_shot_models
def load_sql():
# Example Usage
conn = sqlite3.connect(':memory:')
# create and load the employees table
generate_employee_data(conn)
# create and load the devices table
device_data = generate_device_data(conn)
# create and load the interface_stats table
generate_interface_stats_data(conn, device_data)
# create and load the flow table
generate_flow_data(conn, device_data)
return conn