OpenAI CEO Sam Altman spoke to an engaged crowd of about 60 lawmakers at a dinner Monday about the advanced artificial technology his company produces and the challenges of regulating it.

The extensive discussion, which lasted about two hours, came before Altman’s first testimony before Congress at a Senate Judiciary hearing on privacy and technology on Tuesday. IBM Chief Privacy and Trust Officer Christina Montgomery and New York University Professor Emeritus Gary Marcus will also testify at the hearing, which focuses on AI supervision.

The dinner discussion comes at a peak moment for AI, which has thoroughly captured the fascination of Congress. On Tuesday, at the same time as the meeting where Altman will testify, the Senate Homeland Security and Governmental Affairs Committee is hosting a separate hearing on artificial intelligence in the government. And on Wednesday, the House Judiciary Subcommittee on Courts, Intellectual Property and the Internet will hold another hearing focused on AI and copyright law.

About a half-dozen members who spoke to CNBC outside the dinner on Capitol Hill described a wide-ranging and informative discussion with Altman that addressed the many fears and hopes about opportunities that come with AI.

Altman received high praise from several members.

“I thought it was amazing,” said Rep. House Democratic Caucus Vice Chairman Ted Lieu, D-Calif., hosted the dinner along with GOP Conference Vice Chairman Mike Johnson, R-La. “It’s not easy to keep members of Congress enthralled for almost two hours. So Sam Altman was very informative and provided a lot of information.”

“He gave fascinating demonstrations in real time,” Johnson said. “I think it surprised a lot of members. And there was a standing-room-only audience there.”

One of the demonstrations, Johnson said, was ChatGPT, OpenAI’s generative AI chatbot, writing a bill dedicating a post office to Lieu. Afterwards, he got Johnson to write a speech to deliver the bill on the floor of the House.

“It was a beautiful speech,” Lieu joked.

“It kind of scared us, too,” Johnson said.

Rep. Haley Stevens, D-Mich., said that despite being in her third term in Congress, she has “never been to a meeting like this” and praised Lieu and Johnson for bringing together “a total cross-section of our entire Congress “to engage with a subject that is changing our world.”

Rope. Anna Eshoo, D-Calif., who co-chairs the Congressional AI Caucus, called Altman very “coming” and “wonderful to have a thoughtful conversation.”

“There’s no question where he’s pulling back on anything,” she said, adding that lawmakers had very thoughtful things to ask.

Eshoo said she had invited Altman to address the caucus, but that Speaker Kevin McCarthy, R-Calif., and Minority Leader Hakeem Jeffries, D-N.Y., insisted it be open to the full House. Eshoo said she welcomed the opportunity.

“You have to understand something before you can accept or reject it,” Eshoo said. “But then, it’s like putting socks on an octopus, because it covers everything.”

One of those tentacles has to do with copyright law, something that House Judiciary Subcommittee on IP Chair Darrell Issa, R-Calif., has given a lot of thought to.

Issa said he is “very interested in fairly quickly providing further guidance to the Copyright Office”, adding that while entirely AI-generated content cannot be covered by copyright, there needs to be guidance on when material that was created with the help of AI can be copyright protected.

As for Altman, Issa said that in general, “He made it clear that this cannot go forward without some legislative and regulatory action, and at the same time, it would be negative to shut down the momentum. So it’s, how do you develop guardrails without to side-swipe it or take it out of the way?”

Rep. Jay Obernolte, R-Calif., who has a degree in artificial intelligence and sits on the congressional AI caucus, said he discussed with Altman the potential to regulate the precursors to the technology, much like one does with the raw materials needed to make nuclear weapons. Obernolte suggested this could take the form of an international registry that keeps track of which entities have enough computing power to create advanced AI.

Rope. Rep. Ro Khanna, D-Calif., whose district spans part of Silicon Valley, said Altman made two important points to members in the room.

“One is that AI is a tool, not a being,” he said. “This is something that will help people not replace people. Second, that it will do tasks, not jobs. This is something that will help people with the jobs they have, not displace those jobs. And so I think it’s been a sobering conversation that’s helped members understand what the tool actually does and help debunk some of the hype.”

Still. there are unanswered questions about AI’s enormous capabilities, where Congress should step in, and OpenAI’s approach to harnessing the technology. For example, some experts have criticized the company for choose to be less forthcoming about what went into making its latest major language model, GPT-4, something its executives have defended as a key competitive and security feature.

Khanna said the issue of the model’s openness is something he has discussed with Altman in the past, though not at Monday’s dinner.

“The challenge and the value we have to consider is the value of having this open source so that other non-incumbent actors can participate,” Khanna said. “But the danger with open source is that they can end up in the wrong hands. And there’s a trade-off between that.”

Subscribe to CNBC on YouTube.

WATCH: Could China’s ChatGPT clones give it an edge over the US in an AI arms race?