diff --git a/haystack/components/embedders/openai_document_embedder.py b/haystack/components/embedders/openai_document_embedder.py index 425810349e..b3e26e504f 100644 --- a/haystack/components/embedders/openai_document_embedder.py +++ b/haystack/components/embedders/openai_document_embedder.py @@ -46,6 +46,9 @@ def __init__( """ Create a OpenAIDocumentEmbedder component. + By setting the 'OPENAI_TIMEOUT' and 'OPENAI_MAX_RETRIES' you can change the timeout and max_retries parameters in the OpenAI client. + + :param api_key: The OpenAI API key. :param model: diff --git a/haystack/components/embedders/openai_text_embedder.py b/haystack/components/embedders/openai_text_embedder.py index 0121c4b1e5..25209921d2 100644 --- a/haystack/components/embedders/openai_text_embedder.py +++ b/haystack/components/embedders/openai_text_embedder.py @@ -44,6 +44,8 @@ def __init__( """ Create an OpenAITextEmbedder component. + By setting the 'OPENAI_TIMEOUT' and 'OPENAI_MAX_RETRIES' you can change the timeout and max_retries parameters in the OpenAI client. + :param api_key: The OpenAI API key. :param model: diff --git a/haystack/components/generators/chat/openai.py b/haystack/components/generators/chat/openai.py index 19172d9931..f114acef39 100644 --- a/haystack/components/generators/chat/openai.py +++ b/haystack/components/generators/chat/openai.py @@ -79,6 +79,8 @@ def __init__( Creates an instance of OpenAIChatGenerator. Unless specified otherwise in the `model`, this is for OpenAI's GPT-3.5 model. + By setting the 'OPENAI_TIMEOUT' and 'OPENAI_MAX_RETRIES' you can change the timeout and max_retries parameters in the OpenAI client. + :param api_key: The OpenAI API key. :param model: The name of the model to use. :param streaming_callback: A callback function that is called when a new token is received from the stream. diff --git a/haystack/components/generators/openai.py b/haystack/components/generators/openai.py index 87070e0dc8..5bc50c24f4 100644 --- a/haystack/components/generators/openai.py +++ b/haystack/components/generators/openai.py @@ -61,6 +61,9 @@ def __init__( """ Creates an instance of OpenAIGenerator. Unless specified otherwise in the `model`, this is for OpenAI's GPT-3.5 model. + By setting the 'OPENAI_TIMEOUT' and 'OPENAI_MAX_RETRIES' you can change the timeout and max_retries parameters in the OpenAI client. + + :param api_key: The OpenAI API key. :param model: The name of the model to use. :param streaming_callback: A callback function that is called when a new token is received from the stream. diff --git a/releasenotes/notes/feat-widen-support-of-envars-vars-on-openai-components-efe6203c0c6bd7b3.yaml b/releasenotes/notes/feat-widen-support-of-envars-vars-on-openai-components-efe6203c0c6bd7b3.yaml new file mode 100644 index 0000000000..a793b84779 --- /dev/null +++ b/releasenotes/notes/feat-widen-support-of-envars-vars-on-openai-components-efe6203c0c6bd7b3.yaml @@ -0,0 +1,9 @@ +--- +highlights: > + Add the 'OPENAI_TIMEOUT' and 'OPENAI_MAX_RETRIES' to the OpenAI components. +enhancements: + - | + Now you can set the timeout and max_retries parameters on the OpenAI client by setting the 'OPENAI_TIMEOUT' and 'OPENAI_MAX_RETRIES' environment vars. +issues: + - | + 7610