diff --git a/requirements.lite.txt b/requirements.lite.txt index 3f554bb..0f3c86d 100644 --- a/requirements.lite.txt +++ b/requirements.lite.txt @@ -30,3 +30,4 @@ python-pptx==0.6.23 xlrd==2.0.1 langchain-aws==0.2.1 boto3==1.34.144 +pytest==8.3.3 diff --git a/requirements.txt b/requirements.txt index 28f18a0..b6b32d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,4 +33,5 @@ langchain-huggingface==0.1.0 cryptography==42.0.7 python-magic==0.4.27 python-pptx==0.6.23 -xlrd==2.0.1 \ No newline at end of file +xlrd==2.0.1 +pytest==8.3.3 \ No newline at end of file diff --git a/test/testFiles/short.txt b/test/testFiles/short.txt new file mode 100644 index 0000000..997e4ef --- /dev/null +++ b/test/testFiles/short.txt @@ -0,0 +1 @@ +LibreChat is a free, open source AI chat platform. This Web UI offers vast customization, supporting numerous AI providers, services, and integrations. Serves all AI Conversations in one place with a familiar interface, innovative enhancements, for as many users as you need. \ No newline at end of file diff --git a/test/testFiles/superbowl.txt b/test/testFiles/superbowl.txt new file mode 100644 index 0000000..d7a037c --- /dev/null +++ b/test/testFiles/superbowl.txt @@ -0,0 +1,179 @@ +Super Bowl LVIII was an American football game played to determine the champion of the National Football League (NFL) for the 2023 season. In a rematch of Super Bowl LIV from four years earlier, the American Football Conference (AFC) champion and defending Super Bowl champion Kansas City Chiefs defeated the National Football Conference (NFC) champion San Francisco 49ers 25–22 in overtime. The Chiefs became the first team to win back-to-back Super Bowls since the 2004 New England Patriots.[6] The game was played on February 11, 2024, at Allegiant Stadium in Paradise, Nevada. This was the first Super Bowl to be held in the state of Nevada.[7][8] It marked the third straight year that the Super Bowl had been played in the Western United States, following host cities Inglewood, California, in 2022 and Glendale, Arizona, in 2023. + +As this was the Chiefs' fourth Super Bowl appearance and third win in five years, many have said this game established them as a dynasty.[9] It was the second Super Bowl to be decided in overtime, the first being Super Bowl LI, seven years earlier.[10][11][12] Chiefs quarterback Patrick Mahomes was named Super Bowl Most Valuable Player (MVP), completing 34 of 46 passes for 333 yards, two touchdowns, and one interception. Due to the seating capacity of Allegiant Stadium, the game's sellout attendance of 61,629 was the smallest crowd in Super Bowl history outside of Super Bowl LV, which was played during the COVID-19 pandemic.[13][14] + +The game was televised nationally by CBS, streamed on Paramount+, alternatively broadcast on youth-oriented sister network Nickelodeon, and televised on the Spanish-language network Univision.[15] It was also the second simulcast in Super Bowl history, and the first since Super Bowl I.[16] Super Bowl LVIII became the most watched program in American television history, with a total of 123.7 million average viewers across all platforms, which broke the average record of 115.1 million viewers set by the previous year's Super Bowl.[17][4] The game saw the highest unduplicated total audience in history with more than 200 million viewers watching all or part of the game.[18] It was the most-watched United States broadcast since the Apollo 11 moon landing,[19] attributed to the Taylor Swift effect. The halftime show, headlined by Usher, peaked at 129.3 million viewers.[20][21][22] The game's net playing time of 74 minutes and 57 seconds ranks as the longest in Super Bowl history.[23] + +It was notable for being the first Super Bowl since its inception that George Toma did not serve as groundskeeper.[24] + +Background +Host selection + +Allegiant Stadium, February 2024 +On May 23, 2018, the NFL picked the Mercedes-Benz Superdome in New Orleans to host Super Bowl LVIII. The league picked the winning city from a list of candidates that it had compiled, a process that replaced an earlier one in which cities that wished to host a Super Bowl submitted bids to be debated and voted upon at the league owners' meetings.[25][8] + +In March 2020, the NFL and the NFL Players Association agreed to expand the regular season from 16 to 17 games beginning in 2021, pushing Super Bowl LVIII to February 11, 2024, and causing a conflict with the city's Mardi Gras celebrations.[26] + +The NFL announced on October 14, 2020, that New Orleans would host Super Bowl LIX instead of Super Bowl LVIII,[27] and then announced on December 15, 2021, that Allegiant Stadium was chosen as the new site.[28] + +Logo +The official logo was unveiled on February 13, 2023; it follows the updated logo template established by Super Bowl LVI, with the traditional Roman numerals containing imagery of a sunset behind the skyline of the Las Vegas Strip and the Las Vegas sign. The numerals were also slanted inward to evoke the architecture of resorts such as the Bellagio and Wynn Las Vegas. The unveiling of this logo was met with acclaim, with many praising its originality and its effective representation of the host city's spirit amid the standardized designs used since 2011.[29][30] + +Teams +San Francisco 49ers +Main article: 2023 San Francisco 49ers season + +Brock Purdy was the third-youngest quarterback to start a Super Bowl. (Purdy pictured in 2021 with the Iowa State Cyclones) +Under seventh-year head coach Kyle Shanahan, the San Francisco 49ers ended the 2023 season with a 12–5 record, the NFC's No. 1 seed, and a first-round bye.[31] + +Following the success of rookie quarterback Brock Purdy, who led them to an NFC Championship Game the previous season, the 49ers traded away Trey Lance, the third overall pick in the 2021 NFL draft, and made Purdy the full-time starter.[32] In his first full season as the starter, Purdy was named to the Pro Bowl, throwing for 4,280 yards, 31 touchdowns, and 11 interceptions and finished with a passer rating of 113.0, the highest in the league.[33] The offense was also led by first-team All-Pro running back Christian McCaffrey, whom the 49ers acquired midway through the 2022 season.[34] He led the league in scrimmage yards (2,023) and total touchdowns (21). San Francisco's receiving core was led by Brandon Aiyuk, George Kittle, and Deebo Samuel, all of whom gained more than 1,000 scrimmage yards.[33] The 49ers were the first team in league history to have four players with over 1,000 scrimmage yards.[35] The 49ers' offense finished second in the league in total offense with 398.4 yards per game, which included finishing fourth in pass yards per game (257.9) and third in rush yards per game (140.5).[36] The offensive line was spearheaded by left tackle Trent Williams, who received his third First-team All-Pro selection and his 11th Pro Bowl nomination.[37] + +On defense, the 49ers finished third in the league in scoring defense, giving up 17.5 points per game, and finished first in the league with 22 interceptions (tied with the Chicago Bears).[38] San Francisco's defensive line featured Pro Bowl defensive end Nick Bosa, who led the team with 10.5 sacks, along with defensive tackle Javon Hargrave (seven sacks) and Arik Armstead (five sacks).[33] First-team All-Pro linebacker Fred Warner led the team with 132 combined tackles, four interceptions, four forced fumbles, and 2.5 sacks.[33] The secondary was led by second-team All-Pro cornerbacks Charvarius Ward (five interceptions and 72 tackles) and Deommodore Lenoir (three interceptions, 84 tackles).[33] + +This game marked the 49ers' eighth Super Bowl appearance.[39] The franchise won its first five Super Bowl appearances (XVI, XIX, XXIII, XXIV, and XXIX) but lost its last two before this game (XLVII and LIV). Had the 49ers had won the game, they would have been the first NFC team to win six Super Bowls and the third team overall, joining the New England Patriots and Pittsburgh Steelers.[40] + +Kansas City Chiefs +Main article: 2023 Kansas City Chiefs season + +With quarterback Patrick Mahomes, the Chiefs became the first back-to-back Super Bowl champions since 2005. (Mahomes pictured in 2021) +Kansas City entered the 2023 NFL season as defending Super Bowl champions, having won Super Bowl LVII. They finished the 2023 season with an 11–6 record, their 11th consecutive winning season and eighth consecutive AFC West title under eleventh-year head coach Andy Reid, and as the No. 3 seed in the AFC.[41] + +In his sixth season as the starter, quarterback Patrick Mahomes had his worst statistical season in several categories, including yards per attempt (7.0), passing yards per game (261.4), interceptions (14), and passer rating (92.6).[42] His receivers struggled at several points throughout the season,[43] and going into week 18, the Chiefs led the league in dropped passes. Despite this, Mahomes set a career-high in completion percentage with 67.2% while throwing for 27 touchdowns.[44] Tight end Travis Kelce led the Chiefs in receiving yards for the fourth time in five seasons, but finished with under 1,000 receiving yards for the first time since 2015.[45] Rookie receiver Rashee Rice led the Chiefs' wide receivers with 938 yards and seven touchdowns, while second-year running back Isiah Pacheco ran for 935 yards and seven touchdowns.[46] The offensive line featured two Pro Bowl selections: guard Joe Thuney and center Creed Humphrey.[47] + +The Chiefs' defensive line featured Pro Bowl defensive tackle Chris Jones, who had 10.5 sacks, and defensive end George Karlaftis (10.5 sacks). The secondary was led by cornerbacks L'Jarius Sneed (two interceptions, 78 tackles, 14 pass deflections) and All Pro Trent McDuffie (80 tackles, 5 forced fumbles, 3 sacks), along with safety Justin Reid (team-high 95 tackles, 1 interception, 3 sacks).[48] + +Super Bowl LVIII was the Chiefs' sixth Super Bowl appearance and fourth in the past five seasons. Entering the game, the Chiefs had won three Super Bowls (IV, LIV, and LVII) and lost two (I and LV). The Chiefs also won one pre-Super Bowl era AFL Championship, in 1962 (as the Dallas Texans).[49] + +Playoffs +Main article: 2023–24 NFL playoffs +As the No. 1 seed in the NFC, the 49ers received a first-round bye.[50] In the NFC Divisional Round, the 49ers hosted the No. 7 seed Green Bay Packers. Although the Packers took a 21–14 lead heading into the fourth quarter, the 49ers rallied to win the game 24–21 thanks to a late game-winning drive led by Brock Purdy that ended with a touchdown by Christian McCaffrey. Linebacker Dre Greenlaw sealed the game for the 49ers by intercepting quarterback Jordan Love on the Packers' final drive. This allowed the 49ers to advance to their third straight NFC Championship Game and their fourth in the last five seasons.[51] In that game, the 49ers hosted the No. 3 seed Detroit Lions. The 49ers fell behind quickly, trailing 24–7 at halftime. They scored 27 straight points to take a 34–24 lead late in the fourth quarter. The Lions scored one more touchdown after that but failed to recover the ensuing onside kick attempt, sending the 49ers to their second Super Bowl in five seasons with a 34–31 win.[52] + +As the No. 3 seed in the AFC,[53] the Chiefs hosted the No. 6 seed Miami Dolphins in the AFC Wild Card Round. Due to a cold wave in mid-January, the temperature was −4 °F (−20 °C) at this game's kickoff, which was the fourth-coldest in NFL history.[54] The Chiefs defeated the Dolphins 26–7.[55] The Dolphins' only points in the game came from a touchdown pass from quarterback Tua Tagovailoa to former Chiefs wide receiver Tyreek Hill. The win saw the Chiefs play their first away playoff game in the Mahomes era, the AFC Divisional Round against the No. 2 seed Buffalo Bills. This game saw five lead changes between the two teams. The Chiefs won 27–24 as Buffalo kicker Tyler Bass missed a potential game-tying field goal wide right in the final two minutes.[56] With that win, the Chiefs advanced to their sixth straight AFC Championship Game, which they played on the road against the No. 1 seed Baltimore Ravens. Miscues on both offense and defense doomed the Ravens; the Chiefs led 17–7 at halftime and came up with big defensive stops in the second half to win 17–10.[57] The Chiefs advanced to their fourth Super Bowl in five seasons.[41] + +Pre-game notes + + +The relationship between supercouple Taylor Swift (left) and Chiefs tight end Travis Kelce (right) attracted significant media attention prior to the game. +As the designated home team in the Super Bowl's annual rotation between the two conferences, the Chiefs chose to wear their red home jerseys with white pants. The 49ers wore their white away jerseys with gold pants.[58][59] + +As the designated home team, the Chiefs practiced at the host team Las Vegas Raiders' practice facility in Henderson, Nevada, during the week leading up to the game. The 49ers practiced at UNLV's Fertitta Football Complex in Paradise, Nevada.[60] Both teams stayed off-Strip at luxury hotels at the Lake Las Vegas resort area east of the city, with the Chiefs staying at the Westin and the 49ers staying at the Hilton.[61] + +The game was a rematch of Super Bowl LIV (played in February 2020), in which the Chiefs defeated the 49ers, 31–20,[62] overcoming a 10-point fourth quarter deficit.[63] Mahomes was named the MVP of that Super Bowl. Bill Vinovich was also the referee for that game,[62] making him the first referee to preside over two Super Bowl meetings between the same teams.[64] + +This game was also the first since Super Bowl LV to feature the defending champion. That game saw the defending champion Chiefs fall to the Tampa Bay Buccaneers.[65] + +The game was dubbed by fans and media outlets as the "Taylor Swift Bowl" or "Swiftie Bowl", referencing singer-songwriter Taylor Swift and her fans, which are known as Swifties. The season broke viewership, merchandise, and ticket sales records for the NFL, following Swift's relationship with Chiefs tight end Travis Kelce and her frequent appearances at Chiefs games.[66][67][68] Fans who began supporting the Chiefs due to Swift's association with them have been dubbed as "Chiefties".[69] + +As has been the case with the Chiefs in many nationally televised and publicized games in the past, some Indigenous people's groups used the high profile of Super Bowl LVIII to call on the team to change its name and for their fans to end the use of the tomahawk chop.[70] + +Broadcasting +United States +Television +Super Bowl LVIII was televised by CBS, the network's 22nd broadcast of the game.[71] It was the first Super Bowl to be broadcast under the new 11-year NFL television contract, which began a four-year rotation between CBS, Fox, NBC, and ABC/ESPN.[16][72] + +CBS used 165 cameras, including six embedded within the goal posts ("doink cams"), 48 for high-frame-rate video (24 of which were in 4K for zooming), and 23 for augmented reality effects.[71] Robotic cameras were placed in the city at The Strat, Planet Hollywood Las Vegas, Mandalay Bay, and the Renaissance Las Vegas; another camera ran on a wire over the Bellagio fountains.[71] CBS televised the game in 1080p with high-dynamic-range (HDR) color, upconverted to 4K UHD on Paramount+ and certain television providers.[73][71] CBS built a studio set in front of the Bellagio fountains, from which it broadcast CBS Sports Network and CBS Sports HQ programs during Super Bowl week, as well as editions of CBS Mornings and The Talk. The NFL Today began its pre-game coverage from the studio, then moved to sets outside Allegiant Stadium, then into the stadium as kickoff time approached.[74] + +CBS's lead broadcast team of Jim Nantz (play-by-play), Tony Romo (color commentary), Tracy Wolfson (sideline reporter), and Gene Steratore (rules analyst) called their third Super Bowl together, joined by additional sideline reporter Evan Washburn and special teams analyst Jay Feely.[75][71] The pre-game show featured CBS Sports personalities Kyle Brandt, James Brown, Nate Burleson, Bill Cowher, Charles Davis, Ian Eagle, Boomer Esiason, Jonathan Jones, Jason McCourty, Matt Ryan, Phil Simms, and J. J. Watt.[71] The series premiere of Tracker aired after the game.[76] After late local programming, CBS also aired special Sunday-night episodes of its late-night shows The Late Show with Stephen Colbert and After Midnight.[77] + +CBS sub-licensed the Spanish-language rights to its last three Super Bowl games to ESPN Deportes,[78][79] but TelevisaUnivision announced in May 2023 that it had reached an agreement with CBS to carry Super Bowl LVIII via TUDN;[80][81][82] the TUDN division was represented at the game by both Univision and Mexican network Canal 5, which produced separate broadcasts for each territory.[83] Ramses Sandoval, Memo Schutz, and Martín Gramática were the broadcast team for Univision.[84] CBS also carried Spanish commentary via SAP on the main broadcast.[85] + +On August 1, 2023, CBS Sports announced that it would carry a youth-oriented alternate broadcast of the game on Paramount Global sister network Nickelodeon; the network has aired alternate broadcasts of select NFL games since 2021, but this was the first such broadcast for a Super Bowl.[86] Billed as Super Bowl LVIII: Live from Bikini Bottom, the broadcast incorporated SpongeBob SquarePants-themed augmented reality effects and features (in addition to those seen on previous games aired by the network), and live appearances by characters from the series (such as "analysts" SpongeBob SquarePants and Patrick Star, along with "sideline reporter" Sandy Cheeks) accompanying announcers Noah Eagle and Nate Burleson.[87] Nickelodeon aired the series premiere of Rock Paper Scissors after the game.[88] + +Advertising +CBS charged $6.5 million to $7 million for a 30-second commercial, remaining steady with the previous year's game.[89] Several health and beauty brands bought ads during the game, with analysts suggesting that these buys may have been motivated by Taylor Swift's presence at the game, and the potential for increased viewership by women.[90] FanDuel's ad following their second "Kick of Destiny" featured a posthumous appearance by actor Carl Weathers, who died on February 1, 2024.[91] Most of the advertising time sold by CBS also included airtime on the Nickelodeon simulcast, and selected advertisers were given opportunities to participate in promotional initiatives incorporating Nickelodeon personalities. Commercials for products inappropriate for children (such as alcohol, gambling, and R-rated films) were not carried; Paramount Global sold about 15 Nickelodeon-specific advertising slots for $200,000 to $300,000 each to replace these ads.[92][93] + +Amid the AI boom, a number of commercials advertised artificial intelligence (AI)-related products and services, including Crowdstrike, Etsy's "Gift Mode" (powered by OpenAI GPT-4), Microsoft Copilot, and AI-based photo editing features on Google Pixel 8 smartphones. Generative artificial intelligence was satirized by a tease for Despicable Me 4 depicting an AI art generator that was actually being run by minions.[94] A super PAC supporting 2024 presidential candidate Robert F. Kennedy Jr. aired a spot, which called back to his uncle, John F. Kennedy’s campaign, during the game.[95] Kennedy faced criticism from family members and friends who argued that the ad "exploits and potentially tarnishes the legacy of a storied political family".[96] + +Chinese online marketplace Temu showed their spot five times during and shortly after the game.[97] Beyoncé starred in a commercial with actor Tony Hale for Verizon.[98] Her appearance was teased by the company in the days leading up to the Super Bowl with teaser trailers referencing her sixth and seventh studio albums, Lemonade (2016) and Renaissance (2022).[99][100] At the end of the commercial, which sees the singer attempt to "break the internet" in various ways, Beyoncé says, "Okay, they ready. Drop the new music"; at that time, the singer posted a teaser video on Instagram for her next studio album.[101][102] + +A Vrbo commercial (which had aired 17 days prior to the game)[103] was criticized by Newfoundland and Labrador over the misappropriation of the folk song "I's the B'y" in a scene set in a vacation rental out of a farmhouse that is overcrowded with animals.[104] The provincial government demanded that the commercial be removed from Canadian television; Vrbo apologized on February 15 and announced that it would follow through doing so.[105] + +The Super Bowl Ad Meter survey conducted by USA Today was won by State Farm for their ad "Like a Good Neighbaaa" starring Arnold Schwarzenegger and Danny DeVito.[106] + +Streaming +The game streamed on Paramount+ in English, on TelevisaUnivision's Vix in Spanish,[107] in addition to the paid NFL+ app.[108] + +Radio +Westwood One held the national radio rights to the game, airing it on their various affiliates.[109] The broadcast team featured booth announcers Kevin Harlan (play-by-play) and Kurt Warner (analyst), sideline reporters Mike Golic and Laura Okmin, and rules analyst Dean Blandino. Entravision broadcast the game in Spanish.[110] Annually, over 25 million people listen to the Super Bowl via radio broadcast.[71] + +International +Super Bowl LVIII was broadcast in more than 150 countries on every continent except Antarctica, including:[111] + +Americas +In Canada, the game's broadcast rights were owned by Bell Media. The game was televised in English on TSN and CTV, subject to simultaneous substitution;[112] RDS carried the French broadcast of the game.[113] Additionally, the game was streamed on TSN+ and DAZN.[113][114] The Nickelodeon broadcast was shown exclusively on TSN+ and was not shown by YTV or Nickelodeon Canada, as those channels are owned by competitor Corus Entertainment. +In Latin and South America, the game was televised by ESPN and its streaming and on-demand platform Star+ in Spanish. English language commentary was available on ESPN 3 across Latin America.[111] +In the Caribbean, the game was broadcast on ESPN.[111] +In Mexico, the game was televised by ESPN, Canal 5 and simulcast on ViX and Televisa, Fox Sports and simulcast on Amazon Prime Video, and Azteca 7 all in Spanish. Dedicated English language commentary was available on ESPN 3 and English SAP via Fox Sports.[111] +In Brazil, the game was televised by ESPN and RedeTV! and its streaming and on demand platforms Star+ in Portuguese (with English SAP) and NFL Game Pass on DAZN in English.[111] +In Argentina, the game was televised by ESPN and Fox Sports 2 (under a sublicense due to a divesture order from the Government of Argentina).[111] +Europe +In the United Kingdom, the game was televised on the free-to-air channel ITV1 (STV in Scotland) and streaming service ITVX (STV Player in Scotland), and on pay channels Sky Sports NFL, Sky Sports Main Event, Sky Sports Mix, Sky Showcase, and Sky's on-demand and streaming service Now. It was carried on radio via talkSPORT, BBC Sport Online, BBC Radio 5 Live, and BBC Sounds.[115] +In Ireland, the game was televised on Sky Sports NFL, Sky Sports Main Event, Sky Sports Mix, Sky Showcase, and Sky's on-demand and streaming service Now. It was also carried on Virgin Media One and Two, and broadcast on radio by RTÉ Radio 1. +In Portugal and Belgium, the game was televised by Eleven Sports.[111] +In Germany, Austria, Switzerland, Luxembourg, and Liechtenstein, the game was televised for the first time by RTL Group (RTL, Nitro), following the broadcasting right transfer from previous rights-holder ProSieben. It was also shown on DAZN.[111] +In France, Andorra, Monaco, and some French Overseas Territories, the game was televised by M6 and BeIN Sports.[111] +In Spain, the game was televised by Movistar Plus+.[111] +In Italy, the game was televised by Mediaset's channel Italia 1 and its streaming and on-demand platform DAZN with NFL Game Pass International. +In Denmark, the game was televised by TV 2.[111] +In Norway, the game was televised by VGTV.[111] +In Sweden and Finland, the game was televised by a channel within the TV4-sphere and its streaming service TV4 Play (previously known as C More). Additionally, MTV televised the game in Finland only.[111] +In Iceland, the game was televised by Stöð 2 Sport.[111] +In Poland, the game was televised by free-to-air station Polsat, its first Super Bowl broadcast. The game also aired on Polsat's sister sports station, Polsat Sport, and streamed on Polsat Box Go and DAZN (only for NFL Game Pass subscribers).[111] +In Czechia and Slovakia, the game was televised by Premier Sport.[111] +In Hungary, the game was televised by Arena 4 and streaming service NET4+.[111] +In Bosnia and Herzegovina, Croatia, Kosovo, Montenegro, North Macedonia, Serbia, and Slovenia, the game was televised by Arena Sport. +In Bulgaria, the game was televised by Max Sport 2.[111] +In Greece, the game was televised by Cosmote.[111] +In Cyprus, the game was televised by Cytavision. +In Turkey, the game was televised by S Sport.[111] +In Romania, the game was televised by Digi Sport. +In The Netherlands, the game was televised by ESPN.[111] +Asia–Pacific +In Australia, the game was televised by the Seven Network as well as its sister channel 7mate and on demand platform 7+. The game was also shown on ESPN, Kayo Sports, and NFL Game Pass on DAZN, but the Nickelodeon broadcast was not shown due to the channel being owned by competitor Ten Network Holdings and its parent company Paramount Australia.[116] +In New Zealand, the game was televised on TVNZ 1 and its streaming and on-demand platform TVNZ+, as well as ESPN through Sky Sport and NFL Game Pass on DAZN.[111] +Across the Pacific Islands, the game was televised on ESPN.[111] +In China, the game was televised by Tencent and on multiple regional networks.[111] +In Japan, the game was televised by Nippon TV's sister channel Nittele G+ and NFL Game Pass on DAZN. +In Hong Kong, the game was televised by Now Sports.[111] +In the Indian subcontinent, the game was televised by Star Sports and streaming service Disney+ Hotstar.[111] +In South Korea, the game was televised by Coupang Play and NFL Game Pass on DAZN. +In Taiwan, the game was televised for the first time by ELTA Sports [zh], which also marks the return of NFL games coverage for the Chunghwa Telecom MOD platform.[117][118] +In the Philippines, the game was televised by Premier Sports and its streaming and on-demand platform Blast TV.[111] +In Thailand, the game was televised by TrueVisions.[111] +In Indonesia, Singapore, and Malaysia, the game was televised by over-the-top streaming service Mola.[111] +In Vietnam, the game was televised by K+.[119] +Middle East and Africa +Across Sub-Saharan Africa, the game was televised by ESPN across multiple different providers including DStv, GOtv, and StarTimes.[111] +In Israel, the game was televised by METV and Sport 5.[111] +In Saudi Arabia, the game was televised by AlRiyadiyah. +Entertainment +Pregame + +The American Flag out on the field for the national anthem +On January 18, 2024, the NFL announced that country music singer Reba McEntire would perform the U.S. national anthem. Actor Daniel Durant performed the national anthem in American Sign Language. In addition, rapper Post Malone performed "America the Beautiful" and R&B singer Andra Day accompanied by six female backup singers performed "Lift Every Voice and Sing", with actress Anjel Piñero and actor Shaheem Sanchez performing both songs in ASL.[120][121] + +Electronic music artist Kaskade performed before and during the game, making him the first DJ to perform throughout the Super Bowl. He replaced Tiësto, who dropped out after a family emergency.[122] + +The NFL invited players and coaches from Lahainaluna High School in Lahaina, Hawaii, to serve as honorary captains during the coin toss ceremony. Lahaina was one of the communities ravaged by the 2023 Hawaii wildfires.[123] + +Halftime + +Usher was the leading performer in the Super Bowl LVIII Halftime Show. (Usher pictured in 2010) +Main article: Super Bowl LVIII halftime show +On September 24, 2023, it was announced that R&B and pop singer Usher would headline the halftime show.[124][125] + +Usher's performance included the songs "Caught Up", "U Don't Have to Call", "Love in This Club", "Confessions Part II", "Nice & Slow", "Burn", "U Got It Bad", "OMG", and "Yeah!" (with interpolations of "Freek-a-Leek" by Petey Pablo and "Get Low" by Lil Jon).[126] The show also featured surprise appearances by Alicia Keys, will.i.am, Lil Jon, Ludacris, H.E.R, and Sonic Boom of the South.[127] + +Game summary +First half + +Christian McCaffrey caught the 49ers' first touchdown of the game. (McCaffrey pictured in 2019 with Carolina) +After the Chiefs won the coin toss and deferred possession to the second half, the 49ers received the opening kickoff, which was a touchback. The 49ers' initial drive gained 49 yards in five plays, with Christian McCaffrey and Brock Purdy advancing the ball into Chiefs' territory before McCaffrey lost a fumble at the Kansas City 27-yard line, ending the drive and giving the Chiefs possession.[128] + +The Chiefs' first possession resulted in a punt after a three-and-out. The 49ers' following possession, which went for four plays and 16 yards, was hampered by a false start and a holding penalty. After the 49ers failed to convert a third-and-27, the drive ended in a punt. The next drive by the Chiefs, which went for four plays and ten yards, ended in a punt as well.[128] + +After each team punted, the 49ers put up a ten-play, 46-yard drive that began at their own 17-yard line. Though the first quarter ended with the game still scoreless during this drive, it culminated in a 55-yard field goal by 49ers kicker Jake Moody, making the score 3–0 with 14:48 remaining in the second quarter.[128] It set the record for the longest field goal completed in a Super Bowl.[129] + +The Chiefs began their next drive at their own 25-yard line. The Chiefs went down the field, moving 66 yards in four plays and reaching the 49ers' nine-yard line. But on the drive's fifth play, Chiefs running back Isiah Pacheco fumbled the ball at the eight-yard line, which was recovered by the 49ers.[128] + +The next two possessions both ended in punts. The 49ers, after recovering the fumble, moved 21 yards in four plays before punting the ball away, and the Chiefs followed this up by going three-and-out. After the Chiefs punted the ball 50 yards to San Francisco's 33-yard line with 7:49 remaining in the second quarter, the 49ers began an eight-play, 67-yard touchdown drive that culminated in a 21-yard touchdown pass from wide receiver Jauan Kent to running back McCaffrey.[130] After the extra point was converted, the 49ers had extended their lead over the Chiefs to 10–0 with 4:23 remaining in the first half. \ No newline at end of file diff --git a/test/test_api.py b/test/test_api.py new file mode 100644 index 0000000..0f35bfa --- /dev/null +++ b/test/test_api.py @@ -0,0 +1,106 @@ +from fastapi.testclient import TestClient +import json +import time +import pytest +import sys +import os + +current_dir = os.path.dirname(os.path.abspath(__file__)) +parent_dir = os.path.dirname(current_dir) +sys.path.append(parent_dir) + +from main import app +client = TestClient(app) + + +# GET /ids +def getIDs(): + response = client.get("/ids") + assert response.status_code == 200 + return json.loads(response.text) + + +# DELETE /documents +def deleteID(id): + response = client.request(method="DELETE", url="/documents", json=[id]) + assert response.status_code == 200 + + +# POST /embed +def embed(filepath, file_name, file_id): + with open(filepath, "rb") as file: + file_data = file.read() + response = client.post( + url="/embed", + files={"file": (file_name, file_data, "text/plain")}, + data={"file_id": file_id}, + ) + assert response.status_code == 200 + + +# POST /query +def query(file_id, query, k=1): + response = client.post( + url="/query", json={"file_id": file_id, "query": query, "k": k} + ) + assert response.status_code == 200 + docs = json.loads(response.text) + return docs + + +# POST /query_multiple +def queryMultiple(file_ids: list[str], query, k): + response = client.post( + url="/query_multiple", json={"file_ids": file_ids, "query": query, "k": k} + ) + assert response.status_code == 200 + docs = json.loads(response.text) + return docs + + +@pytest.fixture(scope="session", autouse=True) +def setup_and_teardown(): + embed( + filepath="test/testFiles/superbowl.txt", + file_name="superbowl.txt", + file_id="superbowl", + ) + embed( + filepath="test/testFiles/short.txt", + file_name="short.txt", + file_id="short", + ) + time.sleep(5) # Wait for database update + yield + deleteID("superbowl") + ids = getIDs() + assert "superbowl" not in ids + assert "short" in ids + deleteID("short") + assert "short" not in getIDs() + + +def test_getIDs(): + ids = getIDs() + assert "short" in ids + assert "superbowl" in ids + assert "superbowl_0" not in ids + + +def test_query(): + response = query("superbowl", "Who sang the national anthem in the 2024 superbowl?") + assert "Reba McEntire" in response[0][0]["page_content"] + response = query("superbowl", "what is LibreChat?") + assert "LibreChat" not in response[0][0]["page_content"] + + +def test_queryMultiple(): + response = queryMultiple(["short", "superbowl"], "What is LibreChat?", 2) + assert "short" == response[0][0]["metadata"]["file_id"] + assert "superbowl" == response[1][0]["metadata"]["file_id"] + response = queryMultiple(["superbowl"], "What is LibreChat", 2) + assert "superbowl" == response[0][0]["metadata"]["file_id"] + assert "superbowl" == response[1][0]["metadata"]["file_id"] + + +