Thinking tool
ThinkingTool
Bases: Node
A tool for structured thinking and reasoning processes.
This tool helps agents process thoughts in a structured way, providing a cognitive scratchpad for complex reasoning, planning, and analysis. The agent's LLM will be used automatically when this tool is called by an agent.
Attributes:
Name | Type | Description |
---|---|---|
group |
Literal[TOOLS]
|
The group this node belongs to. |
name |
str
|
The name of the tool. |
description |
str
|
A description of the tool's functionality. |
llm |
BaseLLM
|
The LLM to use for processing thoughts. |
error_handling |
ErrorHandling
|
Configuration for error handling. |
prompt_template |
str
|
The prompt template used for thinking processes. |
Source code in dynamiq/nodes/tools/thinking_tool.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
to_dict_exclude_params: dict
property
Property to define which parameters should be excluded when converting to dictionary.
clear_memory()
Clear the thinking history memory.
Source code in dynamiq/nodes/tools/thinking_tool.py
239 240 241 242 |
|
execute(input_data, config=None, **kwargs)
Execute the thinking tool on the input data.
This method processes a thought through structured analysis, helping to clarify, organize, and develop the reasoning around the given input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_data |
ThinkingInputSchema
|
Input containing thought, context, and focus |
required |
config |
RunnableConfig
|
The configuration for running the tool |
None
|
**kwargs |
Additional keyword arguments |
{}
|
Returns:
Type | Description |
---|---|
dict[str, Any]
|
dict[str, Any]: A dictionary containing the analysis, original thought, and metadata |
Source code in dynamiq/nodes/tools/thinking_tool.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
|
get_thought_history()
Get the current thought history.
Source code in dynamiq/nodes/tools/thinking_tool.py
244 245 246 |
|
init_components(connection_manager=None)
Initialize the components of the tool.
Source code in dynamiq/nodes/tools/thinking_tool.py
122 123 124 125 126 127 128 |
|
reset_run_state()
Reset the intermediate steps (run_depends) of the node.
Source code in dynamiq/nodes/tools/thinking_tool.py
130 131 132 |
|
to_dict(**kwargs)
Convert the tool to a dictionary representation.
Source code in dynamiq/nodes/tools/thinking_tool.py
139 140 141 142 143 |
|