読み方のヒント
矢印ボタン(または ← → キー)でページを移動できます。
送った後は、状況を確かめ、終わったら結果を読みます。
batch = client.messages.batches.retrieve(batch_id)
if batch.processing_status == "ended":
for entry in client.messages.batches.results(batch_id):
if entry.result.type == "succeeded":
print(entry.custom_id, text_of(entry.result.message))
else:
print(entry.custom_id, "失敗:", entry.result.type)
| 結果の種類 | 意味 | 扱い |
|---|---|---|
succeeded | 答えが返った | 分類を表に書き込む |
errored | 要求に誤りがあった | 要求の中身を直して送り直す |
expired | 時間内に処理されなかった | 送り直す |
11 / 20