Build the logger itself. Write log_prediction(log, model_version, input_hash, latency_ms, output) that:
- Mints a
prediction_idfrom the log's current length:pred-{len(log) + 1:06d}— first record ispred-000001. - Appends a dict to
logwith keysprediction_id,model_version,input_hash,latency_ms,output. - Returns the new
prediction_id— the caller needs it to hand back to the user, or the join key dies right here.
Expected output:
pred-000001
pred-000002
records: 2
last output: will_stay