Best free ai video generator : Synthesia
Best free ai audio generator.(realistic speech in your language) : Elevenlabs
system_prompt = """You are an industrial SCADA assistant. You can help operators query process data.
from fastapi import FastAPI
from typing import Optional
import pyodbc
from datetime import datetime
app = FastAPI()
ALLOWED_TABLES = ['tag_history', 'alarm_log', 'events']
@app.get("/query_tag_value")
def get_tag_value(tag_name: str, timestamp: str):
# Whitelist validation
if not validate_tag_name(tag_name):
return {"error": "Invalid tag name"}
conn = pyodbc.connect('DRIVER={SQL Server};SERVER=scada-historian;DATABASE=ProcessData')
cursor = conn.cursor()
query = "SELECT TagValue FROM tag_history WHERE TagName=? AND Timestamp=?"
cursor.execute(query, (tag_name, timestamp))
result = cursor.fetchone()
return {"tag": tag_name, "value": result[0] if result else None}