Foreign Minister Yitzhak Shamir today was formally asked by President Chaim Herzog to form a new Israeli government.

After a meeting with Herzog at the president's official residence, Shamir asked the opposition Labor Alignment to join the ruling Likud bloc in establishing a "government of national unity."

But the prospects of such a government coming about are considered extremely slim because of the wide ideological differences between the two sides and practical political considerations such as who would be given the most powerful positions in the next Cabinet.

Shamir promised some of his political allies he would attempt to form a government of national unity, but it is widely expected that he will only go through the motions. Labor Party leader Shimon Peres predicted today that such an effort by Shamir would fail.

Peres said Labor probably would reject joining a government headed by Shamir because of Likud's "unacceptable" positions on a number of issues, but that he would be willing to discuss the matter with Shamir.

What is likely to emerge from Herzog's decision today is a virtual duplicate of the government of Prime Minister Menachem Begin, who resigned last week after six years in office.

Under Israeli law, Shamir has three weeks to form a government and can ask Herzog for an additional three weeks to complete the process. If Shamir fails, Herzog could ask Peres to try to form a government or he could tell Israel's parliament that elections are necessary.

Shamir became the leader of the ruling Likud bloc when he was elected to succeed Begin as head of the Herut Party, the dominant one in Likud. The 68-year-old foreign minister has already reached an agreement with the smaller parties that make up the Begin coalition government to remain.

The coalition controls 64 seats in the 120-member parliament.

The earlier agreement between Shamir and the other coalition parties gave Herzog little choice but to ask Shamir to form the next government. The details of that agreement, however, are still open to further negotiations among the various parties and there have been predictions that it may take Shamir much of the initial three-week period to get his support firmly in place.

Each party in the six-party coalition is expected to seek the maximum concessions for its continued loyalty. Some of the results of the earlier negotiations Shamir held with his government partners began to be felt earlier this week in an announcement by the Finance Ministry that a new tax on home appliances was being abolished.

The tax was part of a new economic program designed to curb Israel's growing balance-of-payments deficit and its debt burden, major problems the next prime minister will inherit. But abolition of the tax was one of the demands of the TAMI party, which holds three seats in parliament and is a member of the government coalition.