From d61ac9e6ae4463edbb24c0ed69858cf2dc2b31ea Mon Sep 17 00:00:00 2001 From: Daria Fokina Date: Tue, 2 Jan 2024 15:28:01 +0100 Subject: [PATCH] docs: docstrings formatting (#6677) * docs: docstrings formatting * indent --- docs/pydoc/config/builder.yml | 2 +- haystack/components/audio/whisper_remote.py | 4 ++-- haystack/components/preprocessors/document_splitter.py | 2 +- haystack/components/routers/metadata_router.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/pydoc/config/builder.yml b/docs/pydoc/config/builder.yml index 8d783e8e6..559624041 100644 --- a/docs/pydoc/config/builder.yml +++ b/docs/pydoc/config/builder.yml @@ -1,7 +1,7 @@ loaders: - type: loaders.CustomPythonLoader search_path: [../../../haystack/components/builders] - modules: ["answer_builder", "prompt_builder", "dynamic_prompt_builder"] + modules: ["answer_builder", "prompt_builder", "dynamic_prompt_builder", "dynamic_chat_prompt_builder"] ignore_when_discovered: ["__init__"] processors: - type: filter diff --git a/haystack/components/audio/whisper_remote.py b/haystack/components/audio/whisper_remote.py index 1090e54b6..93d26e17c 100644 --- a/haystack/components/audio/whisper_remote.py +++ b/haystack/components/audio/whisper_remote.py @@ -15,7 +15,7 @@ logger = logging.getLogger(__name__) class RemoteWhisperTranscriber: """ Transcribes audio files using OpenAI's Whisper using OpenAI API. Requires an API key. See the - [OpenAI blog post](https://beta.openai.com/docs/api-reference/whisper for more details. + [OpenAI blog post](https://beta.openai.com/docs/api-reference/whisper) for more details. You can get one by signing up for an [OpenAI account](https://beta.openai.com/). For the supported audio formats, languages, and other parameters, see the @@ -100,7 +100,7 @@ class RemoteWhisperTranscriber: Transcribe the audio files into a list of Documents, one for each input file. :param sources: A list of file paths or ByteStreams containing the audio files to transcribe. - :returns: a list of Documents, one for each file. The content of the document is the transcription text. + :returns: A list of Documents, one for each file. The content of the document is the transcription text. """ documents = [] diff --git a/haystack/components/preprocessors/document_splitter.py b/haystack/components/preprocessors/document_splitter.py index 8696f3d16..57531b73c 100644 --- a/haystack/components/preprocessors/document_splitter.py +++ b/haystack/components/preprocessors/document_splitter.py @@ -18,7 +18,7 @@ class DocumentSplitter: ): """ :param split_by: The unit by which the document should be split. Choose from "word" for splitting by " ", - "sentence" for splitting by ".", or "passage" for splitting by "\n\n". + "sentence" for splitting by ".", or "passage" for splitting by "\\n\\n". :param split_length: The maximum number of units in each split. :param split_overlap: The number of units that each split should overlap. """ diff --git a/haystack/components/routers/metadata_router.py b/haystack/components/routers/metadata_router.py index 7f32ea633..eebbbca91 100644 --- a/haystack/components/routers/metadata_router.py +++ b/haystack/components/routers/metadata_router.py @@ -47,8 +47,8 @@ class MetadataRouter: {"field": "meta.created_at", "operator": "<", "value": "2024-01-01"}, ], }, - } - ``` + } + ``` """ self.rules = rules component.set_output_types(self, unmatched=List[Document], **{edge: List[Document] for edge in rules})