Sync Haystack API reference on Docusaurus (#10178)

Co-authored-by: anakin87 <44616784+anakin87@users.noreply.github.com>
This commit is contained in:
Haystack Bot 2025-12-02 16:39:20 +01:00 committed by GitHub
parent 85c27dc155
commit 93edaebe12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -611,7 +611,7 @@ result = parser.run(text_or_messages=messages)
#### RegexTextExtractor.\_\_init\_\_
```python
def __init__(regex_pattern: str)
def __init__(regex_pattern: str, return_empty_on_no_match: bool = True)
```
Creates an instance of the RegexTextExtractor component.
@ -643,6 +643,7 @@ Extracts text from input using the configured regex pattern.
**Returns**:
- If match found: `{"captured_text": "matched text"}`
- If no match and `return_empty_on_no_match=True`: `{}`
- `{"captured_text": "matched text"}` if a match is found
- `{}` if no match is found and self.return_empty_on_no_match=True (default behavior)
- `{"captured_text": ""}` if no match is found and self.return_empty_on_no_match=False