fetchAgentDetails method

Future<void> fetchAgentDetails()

Implementation

Future<void> fetchAgentDetails() async {
  try {
    final agent = await _agentService.getAgentById(_agentId);
    if (agent != null) {
      _agentDetails = agent.agentConfigs;
      _isDeployed = agent.isDeployed; // Set the deployment status

      _errorMessage = null;
    } else {
      _errorMessage = 'Failed to fetch agent details.';
    }
  } catch (e) {
    _errorMessage = 'Exception while fetching agent details: $e';
  }
  notifyListeners();
}