Skip to content

Commit 4a8456a

Browse files
author
Lucas Alencar Xisto
committed
chore: snapshot before archive
1 parent 6ae5e2b commit 4a8456a

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ from openai import OpenAI
376376

377377
client = OpenAI()
378378

379-
response = client.chat.responses.create(
379+
response = client.responses.create(
380380
input=[
381381
{
382382
"role": "user",
@@ -622,6 +622,35 @@ client.with_options(timeout=5.0).chat.completions.create(
622622
model="gpt-4o",
623623
)
624624
```
625+
- from openai import OpenAI
626+
+ import httpx
627+
+ from openai import OpenAI
628+
629+
import httpx
630+
from openai import OpenAI
631+
632+
# Configure the default for all requests:
633+
client = OpenAI(
634+
# 20 seconds (default is 10 minutes)
635+
timeout=20.0,
636+
)
637+
638+
# More granular control:
639+
client = OpenAI(
640+
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
641+
)
642+
643+
# Override per-request:
644+
client.with_options(timeout=5.0).chat.completions.create(
645+
messages=[
646+
{
647+
"role": "user",
648+
"content": "How can I list all files in a directory using Python?",
649+
}
650+
],
651+
model="gpt-4o",
652+
)
653+
625654

626655
On timeout, an `APITimeoutError` is thrown.
627656

src/openai/types/image.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Optional
3+
from typing import Optional, Dict, Any
44

55
from .._models import BaseModel
66

@@ -24,3 +24,10 @@ class Image(BaseModel):
2424
`response_format` is set to `url` (default value). Unsupported for
2525
`gpt-image-1`.
2626
"""
27+
28+
content_filter_results: Optional[Dict[str, Any]] = None
29+
"""Optional content filter metadata returned by the API.
30+
31+
Includes safety-related categories (e.g. sexual_minors, violence, etc.)
32+
indicating whether the image was flagged or filtered.
33+
"""

0 commit comments

Comments
 (0)