mirror of
https://github.com/langgenius/dify.git
synced 2026-11-24 20:59:04 +08:00
28 lines
721 B
Python
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"""
|