Commit d1f308a
committed
refactor(Tool): streamline handler resolution in Tool class
- Introduced a new method `resolveHandler()` to encapsulate the logic for determining the callable handler for the tool.
- Simplified the `handle()` method by delegating handler resolution to `resolveHandler()`, improving readability and maintainability.
- Enhanced error handling for cases where no valid handler is defined, ensuring consistent behavior across invokable subclasses.1 parent a8d0798 commit d1f308a
1 file changed
Lines changed: 30 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 269 | + | |
282 | 270 | | |
283 | 271 | | |
284 | 272 | | |
| |||
299 | 287 | | |
300 | 288 | | |
301 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
302 | 319 | | |
303 | 320 | | |
304 | 321 | | |
| |||
0 commit comments