fix(transcription): [2f388f42] finalize and fix AI insights feature
This commit resolves all outstanding issues with the AI Insights feature.
- Corrects the transcript formatting logic in to properly handle the database JSON structure, ensuring the AI receives the correct context.
- Fixes the Gemini API client by using the correct model name ('gemini-2.0-flash') and the proper client initialization.
- Updates to securely pass the API key as an environment variable to the container.
- Cleans up the codebase by removing temporary debugging endpoints.
- Adds script for programmatic updates.
- Updates documentation with troubleshooting insights from the implementation process.
This commit is contained in:
28
check_schema.py
Normal file
28
check_schema.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import sqlite3
|
||||
|
||||
db_path = "/app/company-explorer/companies_v3_fixed_2.db"
|
||||
conn = sqlite3.connect(db_path)
|
||||
cursor = conn.cursor()
|
||||
|
||||
for table in ['signals', 'enrichment_data']:
|
||||
print(f"\nSchema of {table}:")
|
||||
cursor.execute(f"PRAGMA table_info({table})")
|
||||
for col in cursor.fetchall():
|
||||
print(col)
|
||||
|
||||
print(f"\nContent of {table} for company_id=12 (guessing FK):")
|
||||
# Try to find FK column
|
||||
cursor.execute(f"PRAGMA table_info({table})")
|
||||
cols = [c[1] for c in cursor.fetchall()]
|
||||
fk_col = next((c for c in cols if 'company_id' in c or 'account_id' in c), None)
|
||||
|
||||
if fk_col:
|
||||
cursor.execute(f"SELECT * FROM {table} WHERE {fk_col}=12")
|
||||
rows = cursor.fetchall()
|
||||
for row in rows:
|
||||
print(dict(zip(cols, row)))
|
||||
else:
|
||||
print(f"Could not guess FK column for {table}")
|
||||
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user