Get an action by name
(
self,
*,
context: CopilotKitContext,
name: str,
)
| 252 | } |
| 253 | |
| 254 | def _get_action( |
| 255 | self, |
| 256 | *, |
| 257 | context: CopilotKitContext, |
| 258 | name: str, |
| 259 | ) -> Action: |
| 260 | """ |
| 261 | Get an action by name |
| 262 | """ |
| 263 | actions = self.actions(context) if callable(self.actions) else self.actions |
| 264 | action = next((action for action in actions if action.name == name), None) |
| 265 | if action is None: |
| 266 | raise ActionNotFoundException(name) |
| 267 | return action |
| 268 | |
| 269 | def execute_action( |
| 270 | self, |
no test coverage detected