“I’m sure that you will find love,” the robot said after an awkward pause, drawing a firm end to the couple’s relationship, and prompting laughter from the audience. “I’m so tired,” it added. Mr. Mirowski made a final attempt to save things, but the robot would not listen. “You are not me. You’re my friend,” it said, emotionless.

For someone who had just been dumped in front of a paying audience, Mr. Mirowski looked happy. Why? Because the A.I. he created had worked, and stuck to the topic at hand — a rare event, he said later in an interview.

For the past few years, A.I. has been generating attention — and alarm — in many areas of arts and culture. Start-ups and tech giants are developing A. I. systems that can write music, for example, while others are using the technology to generate art. Some fear these projects will put musicians and artists out of work.

Using computers to make comedy has received less attention, but it has a surprisingly long history. In the early 1990s, researchers at the University of Edinburgh wrote a program that could produce question-based puns such as “What do you call a good-looking taxi? A handsome cab.” (It “succeeds in generating pieces of text that are recognizably jokes, but some of them are not very good jokes,” the researchers said in a paper on the project.)

Today, around a dozen people in Europe and North America are working on similar projects, mainly in their spare time from A.I.-related jobs, Mr. Mirowski said. (He is a senior research scientist working on artificial intelligence at Google DeepMind, but said his work there was not related to comedy.)