Generative artificial intelligence (AI) utilizing transformer technology is widely seen as a groundbreaking advancement in applied artificial intelligence. The technology creates a unique opportunity to extract unstructured data from medical notes. In the current experiments, we extracted fundamental sleep parameters from polysomnography (PSG) notes of veterans in the Corporate Data Warehouse (CDW) national database using large language models. The "SOLAR-10.7B-Instruct" model extracted values associated with total sleep time (TST), sleep onset latency (SOL), and sleep efficiency (SE) from the PSG notes. The model's performance was evaluated using 464 human annotated notes. The analysis showed close accuracy for the large language model (LLM) compared to the human TST and SE extraction, and a considerable accuracy improvement (7.6%) in extracting SOL for the machine compared to human annotation. The LLM shows negligible hallucination (no more than 3.6%), and it has the capability to perform complicated reasoning to extract the desired sleep parameter.