This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rushdb import RushDB | |
# Initialize the RushDB client | |
client = RushDB( | |
"<your_locally_generated_api_key>", | |
base_url="http://localhost:3000", | |
) | |
# Simple - Create a single Node | |
single_record = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import assemblyai as aai | |
from neo4j import GraphDatabase | |
aai.settings.api_key = "<ASSEMBLYAI_API_KEY>" | |
audio_file = "https://assembly.ai/wildfires.mp3" | |
# audio_file = "./local_file.mp3" #syntax for using a local file | |
config = aai.TranscriptionConfig(entity_detection=True) | |
transcript = aai.Transcriber().transcribe(audio_file, config) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI, HTTPException | |
from pydantic import BaseModel | |
import assemblyai as aai | |
from neo4j import GraphDatabase | |
from dotenv import load_dotenv | |
import os | |
# Load environment variables | |
load_dotenv() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from neo4j import GraphDatabase | |
import sys | |
def update_node_names(uri, user, password, target, replace_with): | |
driver = GraphDatabase.driver(uri, auth=(user, password)) | |
def update_name(tx, target, replace_with): | |
query = ( | |
"MATCH (n) " | |
"WHERE n.name = $target " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
from st_cytoscape import cytoscape | |
from baml_client import b | |
import json | |
# Set page config | |
st.set_page_config(layout="wide") | |
def process_graph_result(result): | |
"""Convert BAML graph result to cytoscape elements format""" |
OlderNewer