Files
dify/api/services/knowledge/retrieval/react_output.py

28 lines
721 B
Python

"""Result types emitted by the knowledge ReAct output parser."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, NamedTuple
@dataclass
class ReactAction:
"""A full description of an action for an ReactAction to execute."""
tool: str
"""The name of the Tool to execute."""
tool_input: str | dict[str, Any]
"""The input to pass in to the Tool."""
log: str
"""Additional information to log about the action."""
class ReactFinish(NamedTuple):
"""The final return value of an ReactFinish."""
return_values: dict[str, Any]
"""Dictionary of return values."""
log: str
"""Additional information to log about the return value"""