Skip to content

Commit 84e0c1d

Browse files
cguo-oaistainless-app[bot]
authored andcommitted
Update README models to gpt-5.2
1 parent 3d93d66 commit 84e0c1d

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ client = OpenAI(
3636
)
3737

3838
response = client.responses.create(
39-
model="gpt-4o",
39+
model="gpt-5.2",
4040
instructions="You are a coding assistant that talks like a pirate.",
4141
input="How do I check if a Python object is an instance of a class?",
4242
)
@@ -52,7 +52,7 @@ from openai import OpenAI
5252
client = OpenAI()
5353

5454
completion = client.chat.completions.create(
55-
model="gpt-4o",
55+
model="gpt-5.2",
5656
messages=[
5757
{"role": "developer", "content": "Talk like a pirate."},
5858
{
@@ -80,7 +80,7 @@ prompt = "What is in this image?"
8080
img_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/2023_06_08_Raccoon1.jpg/1599px-2023_06_08_Raccoon1.jpg"
8181

8282
response = client.responses.create(
83-
model="gpt-4o-mini",
83+
model="gpt-5.2",
8484
input=[
8585
{
8686
"role": "user",
@@ -106,7 +106,7 @@ with open("path/to/image.png", "rb") as image_file:
106106
b64_image = base64.b64encode(image_file.read()).decode("utf-8")
107107

108108
response = client.responses.create(
109-
model="gpt-4o-mini",
109+
model="gpt-5.2",
110110
input=[
111111
{
112112
"role": "user",
@@ -136,7 +136,7 @@ client = AsyncOpenAI(
136136

137137
async def main() -> None:
138138
response = await client.responses.create(
139-
model="gpt-4o", input="Explain disestablishmentarianism to a smart five year old."
139+
model="gpt-5.2", input="Explain disestablishmentarianism to a smart five year old."
140140
)
141141
print(response.output_text)
142142

@@ -178,7 +178,7 @@ async def main() -> None:
178178
"content": "Say this is a test",
179179
}
180180
],
181-
model="gpt-4o",
181+
model="gpt-5.2",
182182
)
183183

184184

@@ -195,7 +195,7 @@ from openai import OpenAI
195195
client = OpenAI()
196196

197197
stream = client.responses.create(
198-
model="gpt-4o",
198+
model="gpt-5.2",
199199
input="Write a one-sentence bedtime story about a unicorn.",
200200
stream=True,
201201
)
@@ -215,7 +215,7 @@ client = AsyncOpenAI()
215215

216216
async def main():
217217
stream = await client.responses.create(
218-
model="gpt-4o",
218+
model="gpt-5.2",
219219
input="Write a one-sentence bedtime story about a unicorn.",
220220
stream=True,
221221
)
@@ -386,7 +386,7 @@ response = client.chat.responses.create(
386386
"content": "How much ?",
387387
}
388388
],
389-
model="gpt-4o",
389+
model="gpt-5.2",
390390
response_format={"type": "json_object"},
391391
)
392392
```
@@ -541,7 +541,7 @@ All object responses in the SDK provide a `_request_id` property which is added
541541

542542
```python
543543
response = await client.responses.create(
544-
model="gpt-4o-mini",
544+
model="gpt-5.2",
545545
input="Say 'this is a test'.",
546546
)
547547
print(response._request_id) # req_123
@@ -559,7 +559,7 @@ import openai
559559

560560
try:
561561
completion = await client.chat.completions.create(
562-
messages=[{"role": "user", "content": "Say this is a test"}], model="gpt-4"
562+
messages=[{"role": "user", "content": "Say this is a test"}], model="gpt-5.2"
563563
)
564564
except openai.APIStatusError as exc:
565565
print(exc.request_id) # req_123
@@ -591,7 +591,7 @@ client.with_options(max_retries=5).chat.completions.create(
591591
"content": "How can I get the name of the current day in JavaScript?",
592592
}
593593
],
594-
model="gpt-4o",
594+
model="gpt-5.2",
595595
)
596596
```
597597

@@ -622,7 +622,7 @@ client.with_options(timeout=5.0).chat.completions.create(
622622
"content": "How can I list all files in a directory using Python?",
623623
}
624624
],
625-
model="gpt-4o",
625+
model="gpt-5.2",
626626
)
627627
```
628628

@@ -669,7 +669,7 @@ response = client.chat.completions.with_raw_response.create(
669669
"role": "user",
670670
"content": "Say this is a test",
671671
}],
672-
model="gpt-4o",
672+
model="gpt-5.2",
673673
)
674674
print(response.headers.get('X-My-Header'))
675675

@@ -702,7 +702,7 @@ with client.chat.completions.with_streaming_response.create(
702702
"content": "Say this is a test",
703703
}
704704
],
705-
model="gpt-4o",
705+
model="gpt-5.2",
706706
) as response:
707707
print(response.headers.get("X-My-Header"))
708708

0 commit comments

Comments
 (0)