This research introduces a stochastic scheduling approach that incorporates risk constraints for an energy hub (EH), considering uncertainties related to renewable generation and load demands. The proposed method utilizes the Conditional Value at Risk (CVaR) technique to assess and quantify risks. By striking a balance between reducing operational and emissions costs and increasing risk aversion, the approach presents a trade-off. The EH comprises various components such as a wind turbine (WT), photovoltaic (PV) cells, a fuel cell power plant (FCPP), a combined heat and power generation unit (CHP), and plug-in electric vehicles (PEVs). Uncertain variables encompass factors such as wind speed, solar irradiation, different demands, and market prices. To optimize profits and enhance the consumption curve, demand response programs (DRPs) for electrical, thermal, and cooling demands are implemented. To address the uncertainties associated with input random variables, the efficient k-means data clustering method is employed. A new slime mold algorithm, based on coughing and chaos theory, has been proposed to enhance the problem's solution. The algorithm incorporates innovative operators to improve its capabilities. By utilizing the coughing mechanism and chaos theory, the algorithm explores the solution space more effectively, resulting in improved outcomes for the problem at hand. The results demonstrate significant flexibility in EH management and are extensively discussed. Simulation results indicate that integrating PEVs, FCPP, and DRPs can lead to reductions of 2 %, 7 %, and 11 % in the EH's operating costs, respectively. Furthermore, considering PEVs, FCPP, and DRPs can improve the EH's risk cost by 1.98 %, 6.7 %, and 10.5 %, respectively. Based on the numerical results, in Case 4 led to a remarkable 12.65 % reduction in operational costs while simultaneously achieving a 15.43 % decrease in emission costs, showcasing the effectiveness of the proposed approach in optimizing energy management in an energy hub system.