In a keynote speech before parliament today, Prime Minister Yasuhiro Nakasone called on Japan to ready itself for a bold new role in global affairs, but appeared to soften the strong stand he took in Washington outlining a substantially larger military commitment.

Citing mounting criticism of Japanese trading policies abroad, Nakasone said, "to err in our response is to orphan Japan in the international society." He appealed to the Japanese people to make "a Japan open to the world," and broadly hinted that his administration will work toward a sweeping reform of the country's trading system to open its markets to more foreign goods.

Nakasone's remarks came at the opening session of the 1983 Diet, or parliament, and reflected an attempt to counteract the protests touched off here by his statements in Washington last week, in which he appeared to promise a major Japanese military buildup far beyond what is now planned.

The Diet session is expected to get off to a rocky start when floor debate begins later this week, with Nakasone's political opponents seeking to block his determination to play a more vigorous leadership role than his predecessors in striking a consensus on key national issues.

In a particularly sensitive area, opposition party leaders have called on former prime minister Kakuei Tanaka, a key Nakasone supporter, to resign his Diet seat immediately and have threatened to stall legislative business unless he complies. On Wednesday, public prosecutors in a Tokyo district court are expected to demand a prison term for Tanaka when they rest their case against him in the long-running Lockheed bribery scandal.

In an apparent bid to contain mounting criticism of his eight-week-old administration, Nakasone today avoided specific statements on the controversial areas of defense, political ethics and his personal views favoring the rewriting of Japan's war-renouncing Constitution. Instead, he stressed the broad outlines of his plans to galvanize public support behind policies needed "at a major turning point in Japan's postwar history."

On defense, Nakasone said he will work toward improving Japan's capabilities to maintain strong military ties with the United States and counter an enlarged Soviet military presence in the Pacific. But he indicated that the buildup of Japanese forces would be undertaken in line with Tokyo's relatively modest five-year defense plan now set to run to 1987.

During his official visit to Washington last week, Nakasone told Washington Post editors and reporters that he planned to make Japan "an unsinkable aircraft carrier" to defend against overflights by Soviet Backfire bombers. The remarks strongly suggested a more costly and accelerated buildup than previously planned and sparked protests in Japan that Nakasone had overstepped the country's public consensus on defense.

Nakasone stressed today that expanding Japan's military power would be carried out strictly within the bounds of the Constitution, which renounces war as an instrument of national policy. He said Japan will maintain a policy "devoting our efforts purely to defense and not posing any military threat to neighboring countries."

In the wide-ranging policy address, Nakasone emphasized that a rising tide of protectionism threatened to push the global economy "into decline and we run the risk of repeating the terrible tragedy of the 1930s." Tokyo's handling of its own trading policies, he indicated, "will have a major impact upon the future of Japan and the rest of the world."

He said, "it is . . . in Japan's own interests to seek harmony as 'a Japan open to the world' rather than to be concerned only with our own position." Nakasone broadly hinted that further measures to open Japan's markets would be taken to follow the package of tariff reductions and import procedure reforms announced earlier this month.

He indicated that Japan would take the lead in setting up a new framework for international cooperation in the exchange of scientific research and the joint development of new industrial technologies.