Use threading for python. and make singals from python

This commit is contained in:
derek holloway
2026-02-19 15:09:06 -08:00
parent 4f08732c78
commit 6172d1c373
3 changed files with 51 additions and 12 deletions
+3 -5
View File
@@ -30,13 +30,11 @@ namespace PythonInterop {
}
}
public double[] PredictAI() {
public int PredictAI(string StockSymbol) {
using (Py.GIL()) {
dynamic main = Py.Import("ai-predictor");
string result = main.Predict();
double[]? predictions = JsonSerializer.Deserialize<double[]>(result);
double[] nullCasted = predictions != null ? predictions : [];
return nullCasted;
int result = main.Predict(StockSymbol);
return result;
}
}