feat: desk ia
This commit is contained in:
@@ -1158,7 +1158,7 @@ def auto_assign_template(event_id: int) -> dict:
|
|||||||
confidence = float(recommendation.get("confidence") or 0.0)
|
confidence = float(recommendation.get("confidence") or 0.0)
|
||||||
|
|
||||||
if tmpl_id and confidence >= 0.6:
|
if tmpl_id and confidence >= 0.6:
|
||||||
conn.execute("UPDATE market_events SET template_id = ? WHERE id = ?", (tmpl_id, event_id))
|
conn.execute("UPDATE market_events SET auto_template_id = ? WHERE id = ?", (tmpl_id, event_id))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
row = conn.execute("SELECT name FROM causal_graph_templates WHERE id = ?", (tmpl_id,)).fetchone()
|
row = conn.execute("SELECT name FROM causal_graph_templates WHERE id = ?", (tmpl_id,)).fetchone()
|
||||||
conn.close()
|
conn.close()
|
||||||
@@ -1215,7 +1215,7 @@ Règles : coef intermédiaire ∈ [-5,5] ; coef output en pips, |val| ∈ [30,20
|
|||||||
json.dumps(graph_json),
|
json.dumps(graph_json),
|
||||||
))
|
))
|
||||||
new_id = cur.lastrowid
|
new_id = cur.lastrowid
|
||||||
conn2.execute("UPDATE market_events SET template_id = ? WHERE id = ?", (new_id, event_id))
|
conn2.execute("UPDATE market_events SET auto_template_id = ? WHERE id = ?", (new_id, event_id))
|
||||||
conn2.commit()
|
conn2.commit()
|
||||||
conn2.close()
|
conn2.close()
|
||||||
|
|
||||||
|
|||||||
@@ -806,7 +806,7 @@ def init_db():
|
|||||||
("sub_type", "TEXT DEFAULT NULL"),
|
("sub_type", "TEXT DEFAULT NULL"),
|
||||||
("origin", "TEXT DEFAULT NULL"),
|
("origin", "TEXT DEFAULT NULL"),
|
||||||
("source_refs", "TEXT DEFAULT '[]'"),
|
("source_refs", "TEXT DEFAULT '[]'"),
|
||||||
("template_id", "INTEGER DEFAULT NULL"),
|
("auto_template_id", "INTEGER DEFAULT NULL"),
|
||||||
]:
|
]:
|
||||||
try:
|
try:
|
||||||
c.execute(f"ALTER TABLE market_events ADD COLUMN {_col} {_def}")
|
c.execute(f"ALTER TABLE market_events ADD COLUMN {_col} {_def}")
|
||||||
|
|||||||
Reference in New Issue
Block a user