updated nouns to requests and batches

pull/1164/head
Katia Gil Guzman 2 weeks ago
parent 8bc04e3af7
commit 57badd00e2

@ -9,7 +9,7 @@
"\n",
"The new Batch API allows to **create async batch jobs for a lower price and with higher rate limits**.\n",
"\n",
"Jobs will be completed within 24h, but may be processed sooner depending on global usage. \n",
"Batches will be completed within 24h, but may be processed sooner depending on global usage. \n",
"\n",
"Ideal use cases for the Batch API include:\n",
"\n",
@ -311,9 +311,9 @@
"source": [
"### Processing step \n",
"\n",
"Here, we will prepare our tasks by first trying them out with the Chat Completions endpoint.\n",
"Here, we will prepare our requests by first trying them out with the Chat Completions endpoint.\n",
"\n",
"Once we're happy with the results, we can move on to creating the batch job file."
"Once we're happy with the results, we can move on to creating the batch file."
]
},
{
@ -449,12 +449,12 @@
"source": [
"### Creating the batch file\n",
"\n",
"The batch file, in the `jsonl` format, should contain one line (json object) per task.\n",
"Each task is defined as such:\n",
"The batch file, in the `jsonl` format, should contain one line (json object) per request.\n",
"Each request is defined as such:\n",
"\n",
"```\n",
"{\n",
" \"custom_id\": <TASK_ID>,\n",
" \"custom_id\": <REQUEST_ID>,\n",
" \"method\": \"POST\",\n",
" \"url\": \"/v1/chat/completions\",\n",
" \"body\": {\n",
@ -465,7 +465,7 @@
"}\n",
"```\n",
"\n",
"Note: the task ID should be unique per batch job. This is what you can use to match results to the initial input files, as tasks will not be returned in the same order."
"Note: the request ID should be unique per batch. This is what you can use to match results to the initial input files, as requests will not be returned in the same order."
]
},
{
@ -592,7 +592,7 @@
"id": "f7ca66c6",
"metadata": {},
"source": [
"### Checking job status\n",
"### Checking batch status\n",
"\n",
"Note: this can take up to 24h, but it will usually be completed faster.\n",
"\n",
@ -601,7 +601,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 45,
"id": "6105d809",
"metadata": {},
"outputs": [
@ -609,7 +609,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Batch(id='batch_EXl9tn7dTiJxw8YQJf69e2PM', completion_window='24h', created_at=1714045729, endpoint='/v1/chat/completions', input_file_id='file-nG1JDPSMRMinN8FOdaL30kVD', object='batch', status='completed', cancelled_at=None, cancelling_at=None, completed_at=1714048437, error_file_id=None, errors=None, expired_at=None, expires_at=1714132129, failed_at=None, finalizing_at=1714048381, in_progress_at=1714045863, metadata=None, output_file_id='file-hHjrZXf0Vo8n3tV9vhVgbHGY', request_counts=BatchRequestCounts(completed=1000, failed=0, total=1000))\n"
"Batch(id='batch_xU74ytOBYUpaUQE3Cwi8SCbA', completion_window='24h', created_at=1714049780, endpoint='/v1/chat/completions', input_file_id='file-6y0JPmkHU42qtaEK8x8ZYzkp', object='batch', status='completed', cancelled_at=None, cancelling_at=None, completed_at=1714049914, error_file_id=None, errors=None, expired_at=None, expires_at=1714136180, failed_at=None, finalizing_at=1714049896, in_progress_at=1714049821, metadata=None, output_file_id='file-XPfkEFZSaM4Avps7mcD3i8BY', request_counts=BatchRequestCounts(completed=312, failed=0, total=312))\n"
]
}
],
@ -673,7 +673,7 @@
"source": [
"### Reading results\n",
"Reminder: the results are not in the same order as in the input file.\n",
"Make sure to check the custom_id to match the results against the input tasks"
"Make sure to check the custom_id to match the results against the input requests"
]
},
{
@ -1067,7 +1067,7 @@
"source": [
"### Processing step \n",
"\n",
"Again, we will first prepare our tasks with the Chat Completions endpoint, and create the batch job file afterwards."
"Again, we will first prepare our requests with the Chat Completions endpoint, and create the batch file afterwards."
]
},
{
@ -1380,7 +1380,7 @@
"As with the first example, we can retrieve results once the batch job is done.\n",
"\n",
"Reminder: the results are not in the same order as in the input file.\n",
"Make sure to check the custom_id to match the results against the input tasks"
"Make sure to check the custom_id to match the results against the input requests"
]
},
{

Loading…
Cancel
Save