Skip to content

docs: bump models in example snippets to gpt-4o #1861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ chat_completion = client.chat.completions.create(
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
)
```

@@ -67,7 +67,7 @@ async def main() -> None:
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
)


@@ -92,7 +92,7 @@ stream = client.chat.completions.create(
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
stream=True,
)
for chat_completion in stream:
@@ -113,7 +113,7 @@ stream = await client.chat.completions.create(
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
stream=True,
)
async for chat_completion in stream:
@@ -216,7 +216,7 @@ completion = client.chat.completions.create(
"content": "Can you generate an example json object describing a fruit?",
}
],
model="gpt-3.5-turbo-1106",
model="gpt-4o",
response_format={"type": "json_object"},
)
```
@@ -256,7 +256,7 @@ client = OpenAI()

try:
client.fine_tuning.jobs.create(
model="gpt-3.5-turbo",
model="gpt-4o",
training_file="file-abc123",
)
except openai.APIConnectionError as e:
@@ -305,10 +305,10 @@ client.with_options(max_retries=5).chat.completions.create(
messages=[
{
"role": "user",
"content": "How can I get the name of the current day in Node.js?",
"content": "How can I get the name of the current day in JavaScript?",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
)
```

@@ -339,7 +339,7 @@ client.with_options(timeout=5.0).chat.completions.create(
"content": "How can I list all files in a directory using Python?",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
)
```

@@ -384,7 +384,7 @@ response = client.chat.completions.with_raw_response.create(
"role": "user",
"content": "Say this is a test",
}],
model="gpt-3.5-turbo",
model="gpt-4o",
)
print(response.headers.get('X-My-Header'))

@@ -417,7 +417,7 @@ with client.chat.completions.with_streaming_response.create(
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
) as response:
print(response.headers.get("X-My-Header"))

8 changes: 4 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -727,7 +727,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
),
),
cast_to=httpx.Response,
@@ -753,7 +753,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
),
),
cast_to=httpx.Response,
@@ -1594,7 +1594,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
),
),
cast_to=httpx.Response,
@@ -1620,7 +1620,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
"content": "Say this is a test",
}
],
model="gpt-3.5-turbo",
model="gpt-4o",
),
),
cast_to=httpx.Response,