The nation's governors got an extra-ordinary guided tour through Jimmy Carter's foreign policy last night when he outlined for them in a wide-ranging discussion his aims and goals in international affairs.

It caught the chief executives of 37 states and five territories by surprise. The president launched into his discussion during his toast after a White House dinner at the climax of the midwinter meeting of the National Governors' Association.

The dinner ended on an upbeat note the three-day conference which had been punctuated at times with partisan volleys and barbs by potential presidential challengers.

In addition, grabbing many of the headlines had been an issue favored by some of the governors that calls for a constitutional convention to draft an amendment requiring a balanced federal budget. But by late yesterday the governors had passed with a voice vote the president's proposal to balance the budget by 1981.

By last night you'd have thought the whole thing had ended with love at arm's length. to hear the White House tell it.

"It was a peaceful love fest -- they loved the president," Eugene Eidenberg, deputy assistant to the president for intergovernmental affairs, said of the afternoon's windup session.

Standing in the great hall of the White House, Kentucky Gov. Julian Carroll, the chairman of the governors' group, turned from a bearish hug of Vice President Walter Mondale and said, "Yes, the meetings were extremely harmonious. The sour notes just didn't blossom."

The cordial mood continued throughout the after-dinner conversation, following the president's foreign policy remarks.

"I appreciated the departure from domestic policy," said New Mexico Gov. Bruce King. "He was encouraging a new partnership, which is extremely helpful for those of us who border on foreign countries."

Added Arkansas Gov. William Clinton, "Foreign policy was a safe topic, as opposed to inflation and roads. But I think most of these governors are interested in what they can do to stablize working relationships with foreign countries."

As the guests filed into the East Room to hear blues singer Alberta Hunter, Ginny Thornburgh, the wife of Pennsylvania Gov. Richard Thornburgh grabbed President Carter's hand, saying, "Thanks for the lovely evening." The president looked surprised and asked, "Aren't you staying?" It was obvious that few things could have dragged the president away from the concert by the 83-year-old singer.

Hunter, who came out of retirement a few years ago to draw standing-room-only crowds at a restaurant in New York's Greenwich Village, has perfected the double entendre blues. For last night's black-tie audience, the raunchier the lyrics, the greater the response.

Several times, Rosalynn Carter shaped her mouth into O's of amazement. Alfred Kahn, the president's inflation adviser, sat on the edge of his chair. As Hunter tapped her black T-strap shoes, she sang about "Get yourself a working man," and the president roared with laughter.

Coming into the White House, many of the governors had to face the embarrassing reality of being anonymous faces to the White House press corps. A young Coast Guard lieutenant announced everyone's name in a loud clear voice. Texas Gov. William P. Clements turned around and asked the lieutenant "Where are you from?" Finding out that Lt. Walter Johnson had been born in Colorado City, Tex., the governor grinned and said, "Well I'm your governor."

When inflation advisor Kahn stepped into the foyer, he cautioned, "No, no I'm not a governor. I'm an adviser to the president and I tie my own ties."

Sidestepping the questions of his oft-rumored presidential availability, Iowa Gov. Robert Ray laughed, "The biggest decisions facing me now is have they served dinner yet? If I really had serious plans [about the 1980 presidential race] you would know about it."

One of the governors who had been particularly visible at the conference sessions never even showed up last night. He was California's Jerry Brown, missing for his second year in a row, the White House dinner for the state executives.

The governors shared round tables with the vice president, the secretaries of interior and agriculture and more than two dozen key assistants to the president.

Agriculture Secretary Bob Bergland said he was no longer in a siege situation because of demonstrating farmers and that he had moved back into his office last Friday.

"I'm back in business," he said, noting that he is "a friendly person -- I just can't agree to everything."