mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-02-06 15:02:30 +00:00
docs: fix curly brackets (#9599)
This commit is contained in:
parent
29d3735c0f
commit
85721c19dd
@ -103,6 +103,7 @@ class FaithfulnessEvaluator(LLMEvaluator):
|
||||
"inputs" must be a dictionary with keys "questions", "contexts", and "predicted_answers".
|
||||
"outputs" must be a dictionary with "statements" and "statement_scores".
|
||||
Expected format:
|
||||
```python
|
||||
[{
|
||||
"inputs": {
|
||||
"questions": "What is the capital of Italy?", "contexts": ["Rome is the capital of Italy."],
|
||||
@ -113,6 +114,7 @@ class FaithfulnessEvaluator(LLMEvaluator):
|
||||
"statement_scores": [1, 0],
|
||||
},
|
||||
}]
|
||||
```
|
||||
:param progress_bar:
|
||||
Whether to show a progress bar during the evaluation.
|
||||
:param raise_on_failure:
|
||||
|
||||
@ -107,22 +107,31 @@ class ComponentTool(Tool):
|
||||
Optional dictionary defining how a tool outputs should be converted into a string.
|
||||
If the source is provided only the specified output key is sent to the handler.
|
||||
If the source is omitted the whole tool result is sent to the handler.
|
||||
Example: {
|
||||
Example:
|
||||
```python
|
||||
{
|
||||
"source": "docs", "handler": format_documents
|
||||
}
|
||||
```
|
||||
:param inputs_from_state:
|
||||
Optional dictionary mapping state keys to tool parameter names.
|
||||
Example: {"repository": "repo"} maps state's "repository" to tool's "repo" parameter.
|
||||
Example: `{"repository": "repo"}` maps state's "repository" to tool's "repo" parameter.
|
||||
:param outputs_to_state:
|
||||
Optional dictionary defining how tool outputs map to keys within state as well as optional handlers.
|
||||
If the source is provided only the specified output key is sent to the handler.
|
||||
Example: {
|
||||
Example:
|
||||
```python
|
||||
{
|
||||
"documents": {"source": "docs", "handler": custom_handler}
|
||||
}
|
||||
```
|
||||
If the source is omitted the whole tool result is sent to the handler.
|
||||
Example: {
|
||||
Example:
|
||||
```python
|
||||
{
|
||||
"documents": {"handler": custom_handler}
|
||||
}
|
||||
```
|
||||
:raises ValueError: If the component is invalid or schema generation fails.
|
||||
"""
|
||||
if not isinstance(component, Component):
|
||||
|
||||
@ -68,13 +68,16 @@ def create_tool_from_function(
|
||||
To intentionally leave the description empty, pass an empty string.
|
||||
:param inputs_from_state:
|
||||
Optional dictionary mapping state keys to tool parameter names.
|
||||
Example: {"repository": "repo"} maps state's "repository" to tool's "repo" parameter.
|
||||
Example: `{"repository": "repo"}` maps state's "repository" to tool's "repo" parameter.
|
||||
:param outputs_to_state:
|
||||
Optional dictionary defining how tool outputs map to state and message handling.
|
||||
Example: {
|
||||
Example:
|
||||
```python
|
||||
{
|
||||
"documents": {"source": "docs", "handler": custom_handler},
|
||||
"message": {"source": "summary", "handler": format_summary}
|
||||
}
|
||||
```
|
||||
:returns:
|
||||
The Tool created from the function.
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ class Tool:
|
||||
```
|
||||
:param inputs_from_state:
|
||||
Optional dictionary mapping state keys to tool parameter names.
|
||||
Example: {"repository": "repo"} maps state's "repository" to tool's "repo" parameter.
|
||||
Example: `{"repository": "repo"}` maps state's "repository" to tool's "repo" parameter.
|
||||
:param outputs_to_state:
|
||||
Optional dictionary defining how tool outputs map to keys within state as well as optional handlers.
|
||||
If the source is provided only the specified output key is sent to the handler.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user