Skip to content

Commit eb10004

Browse files
committed
update
1 parent 4b04208 commit eb10004

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

examples/webhooks/src/main.rs

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,6 @@ async fn main() {
131131
info!("✅ Background response created successfully!");
132132
info!(" Response ID: {}", response_id);
133133
info!(" Waiting for webhook events...");
134-
info!("");
135-
info!(" Expected events:");
136-
info!(" 1. response.completed - When the response finishes");
137-
info!(" 2. Or response.failed - If the response fails");
138134
info!("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
139135
info!("");
140136
}
@@ -261,56 +257,56 @@ fn process_webhook_event(event: WebhookEvent) {
261257
WebhookEvent::BatchCancelled(webhook) => {
262258
info!("📦 Batch Cancelled");
263259
info!(" Batch ID: {}", webhook.data.id);
264-
info!(" Event occurred at: {}", webhook.created_at);
260+
info!(" Event created at: {}", webhook.created_at);
265261
}
266262
WebhookEvent::BatchCompleted(webhook) => {
267263
info!("📦 Batch Completed");
268264
info!(" Batch ID: {}", webhook.data.id);
269-
info!(" Event occurred at: {}", webhook.created_at);
265+
info!(" Event created at: {}", webhook.created_at);
270266
}
271267
WebhookEvent::BatchExpired(webhook) => {
272268
info!("📦 Batch Expired");
273269
info!(" Batch ID: {}", webhook.data.id);
274-
info!(" Event occurred at: {}", webhook.created_at);
270+
info!(" Event created at: {}", webhook.created_at);
275271
}
276272
WebhookEvent::BatchFailed(webhook) => {
277273
info!("📦 Batch Failed");
278274
info!(" Batch ID: {}", webhook.data.id);
279-
info!(" Event occurred at: {}", webhook.created_at);
275+
info!(" Event created at: {}", webhook.created_at);
280276
}
281277

282278
// Eval run events
283279
WebhookEvent::EvalRunCanceled(webhook) => {
284280
info!("🧪 Eval Run Canceled");
285281
info!(" Eval Run ID: {}", webhook.data.id);
286-
info!(" Event occurred at: {}", webhook.created_at);
282+
info!(" Event created at: {}", webhook.created_at);
287283
}
288284
WebhookEvent::EvalRunFailed(webhook) => {
289285
info!("🧪 Eval Run Failed");
290286
info!(" Eval Run ID: {}", webhook.data.id);
291-
info!(" Event occurred at: {}", webhook.created_at);
287+
info!(" Event created at: {}", webhook.created_at);
292288
}
293289
WebhookEvent::EvalRunSucceeded(webhook) => {
294290
info!("🧪 Eval Run Succeeded");
295291
info!(" Eval Run ID: {}", webhook.data.id);
296-
info!(" Event occurred at: {}", webhook.created_at);
292+
info!(" Event created at: {}", webhook.created_at);
297293
}
298294

299295
// Fine-tuning events
300296
WebhookEvent::FineTuningJobCancelled(webhook) => {
301297
info!("🔧 Fine-Tuning Job Cancelled");
302298
info!(" Job ID: {}", webhook.data.id);
303-
info!(" Event occurred at: {}", webhook.created_at);
299+
info!(" Event created at: {}", webhook.created_at);
304300
}
305301
WebhookEvent::FineTuningJobFailed(webhook) => {
306302
info!("🔧 Fine-Tuning Job Failed");
307303
info!(" Job ID: {}", webhook.data.id);
308-
info!(" Event occurred at: {}", webhook.created_at);
304+
info!(" Event created at: {}", webhook.created_at);
309305
}
310306
WebhookEvent::FineTuningJobSucceeded(webhook) => {
311307
info!("🔧 Fine-Tuning Job Succeeded");
312308
info!(" Job ID: {}", webhook.data.id);
313-
info!(" Event occurred at: {}", webhook.created_at);
309+
info!(" Event created at: {}", webhook.created_at);
314310
}
315311

316312
// Realtime events
@@ -321,35 +317,35 @@ fn process_webhook_event(event: WebhookEvent) {
321317
for header in &webhook.data.sip_headers {
322318
info!(" {}: {}", header.name, header.value);
323319
}
324-
info!(" Event occurred at: {}", webhook.created_at);
320+
info!(" Event created at: {}", webhook.created_at);
325321
}
326322

327323
// Response events (for background responses)
328324
WebhookEvent::ResponseCancelled(webhook) => {
329325
info!("💬 Response Cancelled");
330326
info!(" Response ID: {}", webhook.data.id);
331-
info!(" Event occurred at: {}", webhook.created_at);
327+
info!(" Event created at: {}", webhook.created_at);
332328
info!("");
333329
info!(" ℹ️ The background response was cancelled before completion.");
334330
}
335331
WebhookEvent::ResponseCompleted(webhook) => {
336332
info!("💬 Response Completed ✅");
337333
info!(" Response ID: {}", webhook.data.id);
338-
info!(" Event occurred at: {}", webhook.created_at);
334+
info!(" Event created at: {}", webhook.created_at);
339335
info!("");
340336
info!(" ℹ️ The background response has been completed successfully!");
341337
}
342338
WebhookEvent::ResponseFailed(webhook) => {
343339
info!("💬 Response Failed");
344340
info!(" Response ID: {}", webhook.data.id);
345-
info!(" Event occurred at: {}", webhook.created_at);
341+
info!(" Event created at: {}", webhook.created_at);
346342
info!("");
347343
info!(" ℹ️ The background response failed during processing.");
348344
}
349345
WebhookEvent::ResponseIncomplete(webhook) => {
350346
info!("💬 Response Incomplete");
351347
info!(" Response ID: {}", webhook.data.id);
352-
info!(" Event occurred at: {}", webhook.created_at);
348+
info!(" Event created at: {}", webhook.created_at);
353349
info!("");
354350
info!(" ℹ️ The background response was interrupted.");
355351
}

0 commit comments

Comments
 (0)