Skip to content

Commit 6679468

Browse files
committed
update
1 parent 824dbaa commit 6679468

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

articles/ai-services/openai/includes/batch/batch-python.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ client = AzureOpenAI(
102102
file = client.files.create(
103103
file=open("test.jsonl", "rb"),
104104
purpose="batch",
105-
#extra_body={"expires_after":{"seconds": 1209600, "anchor": "created_at"}} # Optional you can set to a number between 1209600-2592000. This is equivalent to 14-30 days
105+
extra_body={"expires_after":{"seconds": 1209600, "anchor": "created_at"}} # Optional you can set to a number between 1209600-2592000. This is equivalent to 14-30 days
106106
)
107107

108108

109109
print(file.model_dump_json(indent=2))
110110

111-
#print(f"File expiration: {datetime.fromtimestamp(file.expires_at) if file.expires_at is not None else 'Not set'}")
111+
print(f"File expiration: {datetime.fromtimestamp(file.expires_at) if file.expires_at is not None else 'Not set'}")
112112

113113
file_id = file.id
114114
```
@@ -131,13 +131,13 @@ client = AzureOpenAI(
131131
file = client.files.create(
132132
file=open("test.jsonl", "rb"),
133133
purpose="batch",
134-
#extra_body={"expires_after":{"seconds": 1209600, "anchor": "created_at"}} # Optional you can set to a number between 1209600-2592000. This is equivalent to 14-30 days
134+
extra_body={"expires_after":{"seconds": 1209600, "anchor": "created_at"}} # Optional you can set to a number between 1209600-2592000. This is equivalent to 14-30 days
135135
)
136136

137137

138138
print(file.model_dump_json(indent=2))
139139

140-
#print(f"File expiration: {datetime.fromtimestamp(file.expires_at) if file.expires_at is not None else 'Not set'}")
140+
print(f"File expiration: {datetime.fromtimestamp(file.expires_at) if file.expires_at is not None else 'Not set'}")
141141

142142
file_id = file.id
143143
```
@@ -175,7 +175,7 @@ batch_response = client.batches.create(
175175
input_file_id=file_id,
176176
endpoint="/chat/completions",
177177
completion_window="24h",
178-
#extra_body={"output_expires_after":{"seconds": 1209600, "anchor": "created_at"}} # Optional you can set to a number between 1209600-2592000. This is equivalent to 14-30 days
178+
extra_body={"output_expires_after":{"seconds": 1209600, "anchor": "created_at"}} # Optional you can set to a number between 1209600-2592000. This is equivalent to 14-30 days
179179
)
180180

181181

@@ -674,6 +674,7 @@ The following regions support the new fail fast behavior:
674674
- northcentralus
675675
- polandcentral
676676
- swedencentral
677+
- switzerlandnorth
677678
- eastus2
678679
- westus
679680

0 commit comments

Comments
 (0)