docs: fix curly brackets (#9599)

This commit is contained in:
Julian Risch 2025-07-08 14:51:47 +02:00 committed by GitHub
parent 29d3735c0f
commit 85721c19dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 7 deletions

View File

@ -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:

View File

@ -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):

View File

@ -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.

View File

@ -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.