Skip to content

Commit 85721c1

Browse files
authored
docs: fix curly brackets (#9599)
1 parent 29d3735 commit 85721c1

4 files changed

Lines changed: 21 additions & 7 deletions

File tree

haystack/components/evaluators/faithfulness.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def __init__( # pylint: disable=too-many-positional-arguments
103103
"inputs" must be a dictionary with keys "questions", "contexts", and "predicted_answers".
104104
"outputs" must be a dictionary with "statements" and "statement_scores".
105105
Expected format:
106+
```python
106107
[{
107108
"inputs": {
108109
"questions": "What is the capital of Italy?", "contexts": ["Rome is the capital of Italy."],
@@ -113,6 +114,7 @@ def __init__( # pylint: disable=too-many-positional-arguments
113114
"statement_scores": [1, 0],
114115
},
115116
}]
117+
```
116118
:param progress_bar:
117119
Whether to show a progress bar during the evaluation.
118120
:param raise_on_failure:

haystack/tools/component_tool.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,31 @@ def __init__(
107107
Optional dictionary defining how a tool outputs should be converted into a string.
108108
If the source is provided only the specified output key is sent to the handler.
109109
If the source is omitted the whole tool result is sent to the handler.
110-
Example: {
110+
Example:
111+
```python
112+
{
111113
"source": "docs", "handler": format_documents
112114
}
115+
```
113116
:param inputs_from_state:
114117
Optional dictionary mapping state keys to tool parameter names.
115-
Example: {"repository": "repo"} maps state's "repository" to tool's "repo" parameter.
118+
Example: `{"repository": "repo"}` maps state's "repository" to tool's "repo" parameter.
116119
:param outputs_to_state:
117120
Optional dictionary defining how tool outputs map to keys within state as well as optional handlers.
118121
If the source is provided only the specified output key is sent to the handler.
119-
Example: {
122+
Example:
123+
```python
124+
{
120125
"documents": {"source": "docs", "handler": custom_handler}
121126
}
127+
```
122128
If the source is omitted the whole tool result is sent to the handler.
123-
Example: {
129+
Example:
130+
```python
131+
{
124132
"documents": {"handler": custom_handler}
125133
}
134+
```
126135
:raises ValueError: If the component is invalid or schema generation fails.
127136
"""
128137
if not isinstance(component, Component):

haystack/tools/from_function.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,16 @@ def get_weather(
6868
To intentionally leave the description empty, pass an empty string.
6969
:param inputs_from_state:
7070
Optional dictionary mapping state keys to tool parameter names.
71-
Example: {"repository": "repo"} maps state's "repository" to tool's "repo" parameter.
71+
Example: `{"repository": "repo"}` maps state's "repository" to tool's "repo" parameter.
7272
:param outputs_to_state:
7373
Optional dictionary defining how tool outputs map to state and message handling.
74-
Example: {
74+
Example:
75+
```python
76+
{
7577
"documents": {"source": "docs", "handler": custom_handler},
7678
"message": {"source": "summary", "handler": format_summary}
7779
}
80+
```
7881
:returns:
7982
The Tool created from the function.
8083

haystack/tools/tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Tool:
4141
```
4242
:param inputs_from_state:
4343
Optional dictionary mapping state keys to tool parameter names.
44-
Example: {"repository": "repo"} maps state's "repository" to tool's "repo" parameter.
44+
Example: `{"repository": "repo"}` maps state's "repository" to tool's "repo" parameter.
4545
:param outputs_to_state:
4646
Optional dictionary defining how tool outputs map to keys within state as well as optional handlers.
4747
If the source is provided only the specified output key is sent to the handler.

0 commit comments

Comments
 (0)