Returns information about available actions and agents
(self, *, context: CopilotKitContext)
| 226 | self.actions = actions or [] |
| 227 | |
| 228 | def info(self, *, context: CopilotKitContext) -> InfoDict: |
| 229 | """ |
| 230 | Returns information about available actions and agents |
| 231 | """ |
| 232 | |
| 233 | actions = self.actions(context) if callable(self.actions) else self.actions |
| 234 | agents = self.agents(context) if callable(self.agents) else self.agents |
| 235 | |
| 236 | actions_list = [action.dict_repr() for action in actions] |
| 237 | agents_list = [agent.dict_repr() for agent in agents] |
| 238 | |
| 239 | self._log_request_info( |
| 240 | title="Handling info request:", |
| 241 | data=[ |
| 242 | ("Context", context), |
| 243 | ("Actions", actions_list), |
| 244 | ("Agents", agents_list), |
| 245 | ], |
| 246 | ) |
| 247 | |
| 248 | return { |
| 249 | "actions": actions_list, |
| 250 | "agents": agents_list, |
| 251 | "sdkVersion": COPILOTKIT_SDK_VERSION, |
| 252 | } |
| 253 | |
| 254 | def _get_action( |
| 255 | self, |