What was the origin of the Foreign Service?

Article II, section 2 of the Constitution authorized the President to appoint, by and with the advice and consent of the Senate, Ambassadors, other public Ministers, and Consuls. From 1789 until 1924, the Diplomatic Service, which staffed U.S. Legations and Embassies, and the Consular Service, which was primarily responsible for promoting American commerce and assisting distressed American sailors, developed separately.