LAS VEGAS — Yahoo (YHOO) has long wrestled with the question of what it wanted to be when it grew up. CEO Marissa Mayer on Tuesday took a big step toward providing an answer.

In her keynote speech at the Consumer Electronics Show, Mayer made clear that she sees Yahoo as a media firm at heart, not a tech company. While her old firm, Google (GOOG), tends to put engineers front and center, Mayer’s presentation was filled with stars from the worlds of journalism and entertainment.

“We’re excited about the opportunities ahead,” Mayer said. Then in introducing musician John Legend, the last in a string of celebrities to join her on stage, she added, “We take the entertainment part of our mission pretty seriously.”

Yahoo has been plagued for years with shrinking sales, declining earnings and turmoil in its executive suite. While the company’s websites for news, finance and weather remain among the most popular of their kind, Yahoo missed out on some of the biggest technology shifts over the past decade or so.

It lost out in the search wars to Google and fell hopelessly behind in the market for video when Google bought YouTube. It’s also struggled to make inroads in social networking, losing out to Facebook and Twitter.

Mayer has tried to reinvigorate Yahoo by focusing on its strengths and attempting to narrow its focus. A big part of that turnaround effort involves bulking up its media operations.

In addition to Legend, Mayer’s presentation featured “Saturday Night Live” actors Cecily Strong and Kenan Thompson, who helped tout Yahoo’s video efforts, which include an extensive archive of clips from the comedy show. She also welcomed onstage journalists Katie Couric and David Pogue, both new Yahoo employees who talked up the company’s efforts to be a major player in the digital news business.

“Yahoo has shown a commitment to the kind of quality content that helps us all have a better understanding of our complicated world,” said Couric, the former CBS News anchor whom Yahoo hired last fall to anchor its own video news efforts. “That’s why I couldn’t be more excited to be a part of Yahoo’s team.”

During Mayer’s presentation, Yahoo launched two new “digital magazines” that focus on food and technology. The magazines are artfully designed Web news sites that will be updated daily with articles from well-known journalists. The tech site, for example, will showcase the work of Pogue, formerly the consumer electronics reviewer for The New York Times.

Even the less-famous Yahoo employees who joined her on stage were often there to tout new media-related efforts.

Nick D’Alosio, who became a product manager at Yahoo after the company bought his startup, Summly, last year, showed off a new app called Yahoo News Digest based on his technology that offers a twice-daily digest of news articles.

David Kamp, CEO of Tumblr, which Yahoo also bought last year, discussed some new advertising units that the website is introducing. And Scott Burke, a senior vice president of advertising technology at the company, discussed a suite of new advertising tools and units that Yahoo is rolling out to attract advertisers.

To be sure, even as it tilts toward being more of a digital media company, Yahoo isn’t abandoning its tech roots. The stories featured in the news digest app, for example, are written by computers that summarize human-written stories from around the Web. And Mayer announced that Yahoo had acquired Aviate, a startup that created an “intelligent assistant” similar to Google Now, offering users items such as stock quotes or real-time traffic information unprompted, based on their past actions.

Aviate and the News Digest are part of a broader effort by Yahoo to focus on consumers who access the Internet through smartphones and tablets. Mayer is betting that growth in mobile usage will afford an opportunity for Yahoo to turn its fortunes around.

The company already is enjoying some success in that area. Mayer announced that Yahoo now has 400 million monthly users on mobile devices, which is about half of what it sees from traditional computer users.

Contact Troy Wolverton at 408-840-4285. Follow him at Twitter.com/troywolv.