mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
Update multi-source integration notebook and dependencies
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Installation & Setup\n",
|
||||
"!pip install semantica mcp"
|
||||
"!pip install semantica mcp fastmcp"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -125,6 +125,49 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# --- Demonstration of Real Ingestion (Raw Data) ---\n",
|
||||
"print(\"--- Ingesting Raw Data from Sources (Demonstration) ---\")\n",
|
||||
"\n",
|
||||
"# 1. Ingest from SQLite using DBIngestor\n",
|
||||
"# We connect to the local SQLite database we just created\n",
|
||||
"try:\n",
|
||||
" db_ingestor = DBIngestor()\n",
|
||||
" # SQLAlchemy connection string for SQLite\n",
|
||||
" db_connection = f\"sqlite:///{db_path}\"\n",
|
||||
" raw_db_data = db_ingestor.ingest_database(db_connection)\n",
|
||||
" print(f\"DBIngestor: Successfully connected to {db_path}\")\n",
|
||||
" print(f\"DBIngestor: Found tables: {list(raw_db_data.get('tables', {}).keys())}\")\n",
|
||||
"except Exception as e:\n",
|
||||
" print(f\"DBIngestor Warning: {e}\")\n",
|
||||
"\n",
|
||||
"# 2. Ingest from Files using FileIngestor\n",
|
||||
"# We load the Markdown and JSON files directly\n",
|
||||
"try:\n",
|
||||
" file_ingestor = FileIngestor()\n",
|
||||
" \n",
|
||||
" # Ingest Markdown\n",
|
||||
" readme_file = file_ingestor.ingest_file(repo_path)\n",
|
||||
" print(f\"FileIngestor: Read {readme_file.name} ({readme_file.size} bytes)\")\n",
|
||||
" \n",
|
||||
" # Ingest JSON\n",
|
||||
" market_file = file_ingestor.ingest_file(api_path)\n",
|
||||
" print(f\"FileIngestor: Read {market_file.name} ({market_file.size} bytes)\")\n",
|
||||
"except Exception as e:\n",
|
||||
" print(f\"FileIngestor Warning: {e}\")\n",
|
||||
"\n",
|
||||
"# 3. Ingest from Web using WebIngestor\n",
|
||||
"# Since we created a local HTML file, we could use FileIngestor, \n",
|
||||
"# but here we demonstrate WebIngestor initialization for URL-based sources.\n",
|
||||
"try:\n",
|
||||
" web_ingestor = WebIngestor()\n",
|
||||
" # In a real scenario, we would call: \n",
|
||||
" # web_content = web_ingestor.ingest_url(\"https://nexus.ai/news\")\n",
|
||||
" print(f\"WebIngestor: Initialized and ready to crawl URLs.\")\n",
|
||||
"except Exception as e:\n",
|
||||
" print(f\"WebIngestor Warning: {e}\")\n",
|
||||
"\n",
|
||||
"print(\"-\" * 50 + \"\\n\")\n",
|
||||
"\n",
|
||||
"# Simulate extracted entities from our sources\n",
|
||||
"\n",
|
||||
"source_db = {\n",
|
||||
|
||||
+2
-1
@@ -82,7 +82,8 @@ dependencies = [
|
||||
"boto3>=1.24.0",
|
||||
"azure-storage-blob>=12.12.0",
|
||||
"google-cloud-storage>=2.5.0",
|
||||
"pydantic>=1.10.0",
|
||||
"pydantic>=2.0.0",
|
||||
"fastmcp>=0.1.0",
|
||||
"click>=8.1.0",
|
||||
"rich>=12.5.0",
|
||||
"tqdm>=4.64.0",
|
||||
|
||||
Reference in New Issue
Block a user