Conflicting reports of an alleged attempt on the life of Prime Minister Mehdi Bazargan set Tehran on edge today following yesterday's assassination of the former military chief of staff.

The government denied that anyone tried to assassinate Bazargan, 71, who was apponted in February to head Iranhs provisional revolutionary government. But it was obvious that some incident occurred as he was leading a funeral procession down a main Tehran avenue for the new government's assassinated former chief of staff, Gen. Mohammed Vali Gharani.

Eyewitness' accounts reported by local and foreign news media differed on almost every detail of the incident.

The only thing reliably agreed on was that a commotion erupted in the crowd near Bazargan shortly after the procession began and "revolutionary guards" hustled away at least one armed man.

It was nuclear whether he was a would-be assassin, another guard who aroused suspicion or simply one of postrevolutionary Tehran's numerous armed citizens.

No shots or explosions were heard and Bazargan was unharmed.

In a radio and television speech tonight, the prime minister called for an end to Iran's "spirit of revenge," a reference to the trials and executions of former officials, soldiers and policemen accused of various crimes under the deposed shah.

"The people should have a spirit of forgiveness and put aside their spirit of revenge, emnity and malevolence," Bazargan said.

He called on Iranians to "behave like brothers and ignore the past."

Bazargan, a long-time human rights activist and foe of the shah, said he had "nothing to do with the revolutionary courts," that have sent at least 158 people before Islamic firing squads.

"We have been acting against the traditions of the prophet," he said.

The remark was interpreted as a pointed remainder to Ayatolah Ruholah Khomeini that Islam can be invoked for mercy as well as punishment.

Bazargan also appealed to Khomeini's revolutionary committees and major Marxist and radical Islamic guerrilla groups t participate in rebuilding the countryhs shattered economic, political and military institutions.

The speech appeared to signal a renewed effort by Bazargan to rein in the revolutionary trials, which he strongly opposed when they began shortly after the February revolution. Since the trials resumed earlier this month following a respite, however, Bazargan had remained silent on the subject.

Bazargan's decision to break that silence coincided with the appointment of Ibrahim Yazdi as the new foreign minister. It was not immediately clear whether in taking over the porfolio from Bazargan, the controversial U.S.- trained Yazdi would give up his influential post as deputy prime minister for revolutionary affairs.

But in a move that apparently strengthened Bazargan's efforts to take over the running of the government from Khomeini loyalists, he created the new post of deputy prime minister for people's cooperation with the government - and installed in it his son-in-law, Hossein Bani-Assadi.

Yazdi, menawhile, came under the sharpest criticism he has yet faced. The Tehran newspaper Peygham Emruz said in an open letter to Bazargan that "fascism has set up its nest in your cabinet." It accused Yazdi of using strongarm tactics to try to impose press censorship and compared his tactics with those of the Ku Klux Klan.

Tehran's two major afternoon papers treated the alleged assassination attempt on Bazargan exceptionally warily. One of the dailies ignored the story entirely and the other quoted its own reporter, who was close to Bazargan at the time, as denying having seen such an attempt.

Different accounts said variously that a man concealing a handgun beneath a petition approached Bazargan and was seized by an Air Force guard, that the petitioner was not carrying a handgun but simply aroused suspicion, that a man in an Air Force uniform tried to first throw a grenade at Bazargan then shoot him with a submachine gun and that the man was a revolutionary guard mistaken for an attacker. CAPTION: Picture, Premier Bazargan stands beside coffin of former chief of staff, Gen. Gharani.