Skip to content

Commit

Permalink
doc: warning added for deprectaion of gpt-3.5 as default model for …
Browse files Browse the repository at this point in the history
…OpenAI generators (#8300)

* warning added for gpt3.5 usage

* Revert "warning added for gpt3.5 usage"

This reverts commit 035a0ab.

* update openaigenerator and openaichatgenerator with warnings

* if cond removed

* update description

* adding release notes

* linting

---------

Co-authored-by: David S. Batista <[email protected]>
  • Loading branch information
alperkaya and davidsbatista authored Aug 29, 2024
1 parent 51180e0 commit 7dbc51a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions haystack/components/generators/chat/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import copy
import json
import os
import warnings
from typing import Any, Callable, Dict, List, Optional, Union

from openai import OpenAI, Stream
Expand Down Expand Up @@ -117,6 +118,11 @@ def __init__(
Maximum number of retries to contact OpenAI after an internal error.
If not set, it defaults to either the `OPENAI_MAX_RETRIES` environment variable, or set to 5.
"""
warnings.warn(
"In the upcoming releases 'gpt-3.5-turbo' will be replaced by 'gpt-4o-mini' as the default model",
DeprecationWarning,
)

self.api_key = api_key
self.model = model
self.generation_kwargs = generation_kwargs or {}
Expand Down
6 changes: 6 additions & 0 deletions haystack/components/generators/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

import os
import warnings
from typing import Any, Callable, Dict, List, Optional, Union

from openai import OpenAI, Stream
Expand Down Expand Up @@ -102,6 +103,11 @@ def __init__(
from the `OPENAI_MAX_RETRIES` environment variable or set to 5.
"""
warnings.warn(
"In the upcoming releases 'gpt-3.5-turbo' will be replaced by 'gpt-4o-mini' as the default model",
DeprecationWarning,
)

self.api_key = api_key
self.model = model
self.generation_kwargs = generation_kwargs or {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
deprecations:
- |
The 'gpt-3.5-turbo' as the default model for the `OpenAIGenerator` and `OpenAIChatGenerator` will be replaced by 'gpt-4o-mini'.

0 comments on commit 7dbc51a

Please sign in to comment.