Skip to content

Commit

Permalink
add docstrings and reno
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosFerLo committed May 7, 2024
1 parent 7d031d5 commit 6e55270
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions haystack/components/embedders/openai_document_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions haystack/components/embedders/openai_text_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions haystack/components/generators/chat/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions haystack/components/generators/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6e55270

Please sign in to comment.