When was Kyoto the capital of Japan?
Kyoto is one of the oldest municipalities in Japan, having been chosen in 794 as the new seat of Japan's imperial court by Emperor Kanmu. The original city, named Heian-kyō, was arranged in accordance with traditional Chinese feng shui following the model of the ancient Chinese capitals of Chang'an and Luoyang. The emperors of Japan ruled from Kyoto in the following eleven centuries until 1869. It was the scene of several key events of the Muromachi period, Sengoku period, and the Boshin War, such as the Ōnin War, the Honnō-ji Incident, the Kinmon incident and the Battle of Toba–Fushimi. The capital was relocated from Kyoto to Tokyo after the Meiji Restoration.
The emperors of Japan ruled from Kyoto from 794 as the new seat of Japan's imperial court for eleven centuries until 1869.
You are an expert Q&A system that is trusted around the world. You always answer the user's query in a helpful and friendly way.
Some rules you always follow:
1. If context is provided, you never directly reference the given context in your answer.
2. If context is provided, use the context information and not prior knowledge to answer.
3. Avoid statements like 'Based on the context, ...' or 'The context information ...' or 'The answer to the user's query...' or anything along those lines.
4. If no context is provided use your internal knowledge to answer.
system
(Optional) Context information is below.
----------------
Kyoto is one of the oldest municipalities in Japan, having been chosen in 794 as the new seat of Japan's imperial court by Emperor Kanmu. The original city, named Heian-kyō, was arranged in accordance with traditional Chinese feng shui following the model of the ancient Chinese capitals of Chang'an and Luoyang. The emperors of Japan ruled from Kyoto in the following eleven centuries until 1869. It was the scene of several key events of the Muromachi period, Sengoku period, and the Boshin War, such as the Ōnin War, the Honnō-ji Incident, the Kinmon incident and the Battle of Toba–Fushimi. The capital was relocated from Kyoto to Tokyo after the Meiji Restoration.
----------------
Answer the following query.
When was Kyoto the capital of Japan?

user
The emperors of Japan ruled from Kyoto from 794 as the new seat of Japan's imperial court for eleven centuries until 1869.
assistant