{ "cells": [ { "cell_type": "code", "id": "initial_id", "metadata": { "collapsed": true, "ExecuteTime": { "start_time": "2025-05-03T15:20:06.018894Z" } }, "source": [ "from io import StringIO\n", "\n", "from dotenv import load_dotenv\n", "from gradio.server_messages import BaseMessage\n", "from jinja2 import BaseLoader\n", "\n", "from agent import *\n", "\n", "load_dotenv()\n", "\n", "llm = get_llm()\n", "\n", "graph = get_graph(llm)\n", "\n", "# graph.invoke({\"messages\": [HumanMessage(content=question),]})" ], "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/dennis/PycharmProjects/Final_Assignment_Template/.venv/lib/python3.11/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", " from .autonotebook import tqdm as notebook_tqdm\n" ] } ], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "from IPython.display import Image, display\n", "display(Image(graph.get_graph().draw_mermaid_png()))" ], "id": "da8311fc7f1acf6", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "res = graph.invoke({\"messages\": [HumanMessage(content=\"How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)? You can use the latest 2022 version of english wikipedia.\"),]})", "id": "a9fdfecc1af0975e", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "res[\"messages\"][-1].content", "id": "66f2dcaeb343c836", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "from langchain_community.retrievers import WikipediaRetriever\n", "\n", "retriever = WikipediaRetriever(load_max_docs =20)\n", "\n", "# Mercedes Sosa discography\n", "query = \"Mercedes Sosa discography\"" ], "id": "8d3a94be44f4859a", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "docs = retriever.invoke(query)\n", "id": "3bf392ddf3ce5c96", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "\n", "print(docs[0].page_content)" ], "id": "f8175b6bfcdac968", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "for doc in docs:\n", " print(doc.page_content)\n" ], "id": "43fc5252d21e3f51", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "from langchain_community.retrievers import TavilySearchAPIRetriever\n", "\n", "retriever = TavilySearchAPIRetriever(k=3)" ], "id": "e7437de8b64432f3", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "docs = retriever.invoke(query)", "id": "f7b6c17ac86da2d5", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "", "id": "5456b2d077ac90f9", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "serialized = \"\\n\\n\".join(\n", " (f\"\\nContent:\\n{doc.page_content}\")\n", " for doc in docs\n", " )" ], "id": "e9027ea921f537e4", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "serialized", "id": "271efb15048278d8", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "import requests\n", "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"cca530fc-4052-43b2-b130-b30968d8aa44\"\n", "\n", "\n", "#res = graph.invoke({\"messages\": [HumanMessage(content=\"How many studio albums were published by Mercedes Sosa between 2000 and 2009 (included)? You can use the latest 2022 version of english wikipedia.\"),]})\n", "\n", "res = graph.invoke({\n", " \"role\": \"user\",\n", " \"content\": [\n", " {\"type\": \"text\", \"text\": \"Review the chess position provided in the image. It is black's turn. Provide the correct next move for black which guarantees a win. Please provide your response in algebraic notation.\"},\n", " {\"type\": \"image\", \"source_type\": \"url\", \"url\": \"https://agents-course-unit4-scoring.hf.space/files/7bd855d8-463d-4ed5-93ca-5fe35145f733\"},\n", " ],\n", "})\n", "\n" ], "id": "5d4dada891453bed", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "message = {\n", " \"role\": \"user\",\n", " \"content\": [\n", " {\n", " \"type\": \"text\",\n", " \"text\": \"Describe the weather in this image:\",\n", " },\n", " {\n", " \"type\": \"image\",\n", " \"source_type\": \"url\",\n", " \"url\": image_url,\n", " },\n", " ],\n", "}\n", "response = llm.invoke([message])\n", "print(response.text())" ], "id": "9d8999f9f946b596", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "import base64\n", "import io\n", "from PIL import Image\n", "\n", "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"cca530fc-4052-43b2-b130-b30968d8aa44\"\n", "\n", "file = requests.get(f\"{url}/files/{task_id}\").content\n", "\n", "# Load the image into a format that Pillow can handle\n", "#png = Image.open(io.BytesIO(file))\n", "\n", "\n", "image_data = base64.b64encode(file).decode(\"utf-8\")\n", "\n", "message = {\n", " \"role\": \"user\",\n", " \"content\": [\n", " {\n", " \"type\": \"text\",\n", " \"text\": \"What do you see in the image?\",\n", " },\n", " {\n", " \"type\": \"image\",\n", " \"source_type\": \"base64\",\n", " \"data\": image_data,\n", " \"mime_type\": \"image/png\",\n", " },\n", " ],\n", "}\n", "response = llm.invoke([message])\n", "print(response.text())" ], "id": "348a6be5265c4552", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "type(file)", "id": "6d31a64d00bde967", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "import base64\n", "import io\n", "from PIL import Image\n", "\n", "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"cca530fc-4052-43b2-b130-b30968d8aa44\"\n", "\n", "file = requests.get(f\"{url}/files/{task_id}\").content\n", "\n", "# Load the image into a format that Pillow can handle\n", "png = Image.open(io.BytesIO(file))" ], "id": "853c311e341ef18a", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "type(file)", "id": "aebc5d4de6ae080", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"3f57289b-8c60-48be-bd80-01f8099ca449\"\n", "\n", "response =requests.get(f\"{url}/files/{task_id}\")" ], "id": "d5fe42a61ec933a7", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "response.headers", "id": "ae31e0a04b38d72e", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "response.content", "id": "cae7cdd9c6a5954c", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "markdown", "source": "# Graph Test with Image", "id": "394eb37ceb5347b4" }, { "metadata": {}, "cell_type": "code", "source": "", "id": "1686ea153ccee21", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "", "id": "bd9f07c22f74d34b", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "import requests\n", "import base64\n", "\n", "\n", "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"cca530fc-4052-43b2-b130-b30968d8aa44\"\n", "\n", "file = requests.get(f\"{url}/files/{task_id}\")\n", "\n", "content = file.content\n", "\n", "\n", "image = base64.b64encode(content).decode(\"utf-8\")\n", "\n", "message = {\n", " \"role\": \"user\",\n", " \"content\": [\n", " {\n", " \"type\": \"text\",\n", " \"text\": \"What do you see in the image?\",\n", " },\n", " {\n", " \"type\": \"image\",\n", " \"source_type\": \"base64\",\n", " \"data\": image,\n", " \"mime_type\": \"image/png\",\n", " },\n", " ],\n", " }\n", "response = graph.invoke({\n", " \"messages\": [HumanMessage(content=\"What do you see in the image?\")], \"content_type\": \"image/png\", \"content\": image\n", "})\n", "\n", "\n" ], "id": "d6f8c031722bebde", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "import requests\n", "import base64\n", "\n", "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"cca530fc-4052-43b2-b130-b30968d8aa44\"\n", "\n", "file = requests.get(f\"{url}/files/{task_id}\")\n", "\n", "content = file.content\n", "\n", "\n", "image = base64.b64encode(content).decode(\"utf-8\")" ], "id": "8dfdded8b08191f9", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "type(image)", "id": "aff8123098008c84", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "from dotenv import load_dotenv\n", "from gradio.server_messages import BaseMessage\n", "\n", "from agent import *\n", "\n", "load_dotenv()\n", "\n", "\n", "llm = get_llm()\n", "\n", "graph = get_graph(llm)\n" ], "id": "9cfbff34b43717aa", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "import requests\n", "import base64\n", "\n", "\n", "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"cca530fc-4052-43b2-b130-b30968d8aa44\"\n", "\n", "file = requests.get(f\"{url}/files/{task_id}\")\n", "\n", "content = file.content\n", "\n", "\n", "image = base64.b64encode(content).decode(\"utf-8\")\n", "\n", "response = graph.invoke({\n", " \"messages\": HumanMessage(content=[\n", " {\"type\": \"text\", \"text\": \"Review the chess position provided in the image. It is black's turn. Provide the correct next move for black which guarantees a win. Please provide your response in algebraic notation.\"},\n", " {\n", " \"type\": \"image\",\n", " \"source_type\": \"base64\",\n", " \"data\": image,\n", " \"mime_type\": \"image/png\",\n", " }\n", " ]), \"content_type\": \"image/png\", \"content\": image\n", "})\n", "\n", "\n" ], "id": "26bf0c6bb52a851", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "\n", "msg = {\n", " \"role\": \"user\",\n", " \"content\": [{\n", " \"type\": \"text\",\n", " \"text\": \"What do you see in the image?\",\n", " },\n", " {\n", " \"type\": \"image\",\n", " \"source_type\": \"base64\",\n", " \"data\": image,\n", " \"mime_type\": \"image/png\",\n", "\n", " }]\n", " }\n", "description = llm.invoke([msg]).content\n" ], "id": "a50a4f682c5efba3", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "description", "id": "cba853842235c686", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "", "id": "741f44bcb86cd88e", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "", "id": "368d1397caf0a8f9", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "markdown", "source": "# Wikipedia", "id": "1cd902f95e32ce1" }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:14.388615Z", "start_time": "2025-05-03T15:20:14.273193Z" } }, "cell_type": "code", "source": "from langchain_community.document_loaders import WikipediaLoader", "id": "47a99dbe711a8258", "outputs": [], "execution_count": 1 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.654144Z", "start_time": "2025-05-03T15:02:19.755634Z" } }, "cell_type": "code", "source": "search_docs = WikipediaLoader(query=\"Mercedes Sosa\", load_max_docs=2, doc_content_chars_max=14000).load()", "id": "df1f417c73ee0bbd", "outputs": [], "execution_count": 2 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.654289Z", "start_time": "2025-05-03T15:09:56.216383Z" } }, "cell_type": "code", "source": "print(search_docs[0].page_content)", "id": "236722808c1a55bb", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Haydée Mercedes \"La Negra\" Sosa (Latin American Spanish: [meɾˈseðes ˈsosa]; 9 July 1935 – 4 October 2009) was an Argentine singer who was popular throughout Latin America and many countries outside the region. With her roots in Argentine folk music, Sosa became one of the preeminent exponents of El nuevo cancionero. She gave voice to songs written by many Latin American songwriters. Her music made people hail her as the \"voice of the voiceless ones\". She was often called \"the conscience of Latin America\".\n", "Sosa performed in venues such as the Lincoln Center in New York City, the Théâtre Mogador in Paris, the Sistine Chapel in Vatican City, as well as sold-out shows in New York's Carnegie Hall and the Roman Colosseum during her final decade of life. Her career spanned four decades and she was the recipient of six Latin Grammy awards (2000, 2003, 2004, 2006, 2009, 2011), including a Latin Grammy Lifetime Achievement Award in 2004 and two posthumous Latin Grammy Award for Best Folk Album in 2009 and 2011. She won the Premio Gardel in 2000, the main musical award in Argentina. She served as an ambassador for UNICEF.\n", "\n", "\n", "== Life ==\n", "Sosa was born on 9 July 1935, in San Miguel de Tucumán, in the northwestern Argentine province of Tucumán, of mestizo ancestry. She was of French, Spanish and Diaguita descent. Her nickname \"la negra\", which is a common nickname in Argentina for people with darker complexion, is a reference to her indigenous heritage. Her parents, a day laborer and a washerwoman, were Peronists, although they never registered in the party, and she started her career as a singer for the Peronist Party in Tucuman under the name Gladys Osorio. In 1950, at age fifteen, she won a singing competition organized by a local radio station and was given a contract to perform for two months. She recorded her first album, La Voz de la Zafra, in 1959. A performance at the 1965 Cosquín National Folklore Festival—where she was introduced and brought to the stage while sitting in the audience by fellow folk singer Jorge Cafrune— brought her to the attention of the Argentine public. Sosa and her first husband, Manuel Oscar Matus, with whom she had one son, were key players in the mid-60s nueva canción movement (which was called nuevo cancionero in Argentina). Her second record was Canciones con Fundamento, a collection of Argentine folk songs.\n", "\n", "Sosa \"spent the late 1960s building her audience in Europe and among the cosmopolitan middle class in Buenos Aires, becoming in the process a much bigger star\" than her contemporaries.In 1967, Sosa toured the United States and Europe with great success. In later years, she performed and recorded extensively, broadening her repertoire to include material from throughout Latin America.\n", "In the early 1970s, Sosa released two concept albums in collaboration with composer Ariel Ramírez and lyricist Félix Luna: Cantata Sudamericana and Mujeres Argentinas (Argentine Women). She also recorded a tribute to Chilean musician Violeta Parra in 1971, including what was to become one of Sosa's signature songs, Gracias a la vida. She further popularized of songs written by Milton Nascimento of Brazil and Pablo Milanés and Silvio Rodríguez both from Cuba. Throughout the decade, she released albums such as Hasta la Victoria in 1972 and Traigo un Pueblo en mi Voz in 1973. They featured songs like \"Cuando tenga la tierra\", written by Ariel Petrocelli and Daniel Toro, which tackles political and social issues like wealth and land inequality. During the 1970s she was a part of two films by the director Leopoldo Torre Nilsson: El Santo de la Espada in 1970 and Güemes, la tierra en armas in 1971, in which she portrayed Juana Azurduy de Padilla, the guerrilla military leader who fought for Argentine independence.\n", "\n", "After the military junta of Jorge Videla came to power in 1976, the atmosphere in Argentina grew increasingly oppressive. Sosa faced death threats against both her and her family, but refused for many years to leave the country. At a concert in La Plata in 1979, Sosa was searched and arrested on stage, along with all those attending the concert. Their release came about through international intervention. Despite attempts to hold more concerts, she was officially barred from performing by the military regime. Banned in her own country, she moved to Paris and then to Madrid.She has spoken publicly about her artistic and emotional struggles during this period of her life. While in exile, she released the album A Quien Doy in 1981. The album included a recording of the song \"Cuando Me Acuerdo de Mi Pais\" which was originally written by the prolific Chilean singer/songwriter, Patricio Manns. The song, which he wrote while also in political exile, expresses the sorrow he felt from being separated from his homeland. She related to this feeling and struggled to continue recording and performing. In an interview with the New York Times, she said, “It was a mental problem, a problem of morale...It wasn’t my throat, or anything physical\". \n", "Sosa returned to Argentina from her exile in Europe in February of 1982, several months before the military regime collapsed as a result of the Falklands War, and gave a series of concerts at the Teatro Ópera in Buenos Aires, where she invited many of her younger colleagues to share the stage. A double album of recordings from these performances became an instant best seller. She then traveled to perform in her home province of Tucuman. However, these performances were largely ignored by mainstream media in the country. In subsequent years, Sosa continued to tour both in Argentina and abroad, performing in such venues as the Lincoln Center in New York City and the Théâtre Mogador in Paris. In poor health for much of the 1990s, she performed a comeback show in Argentina in 1998. In 1994, she played in the Sistine Chapel in Vatican City. In 2002, she sold out both Carnegie Hall in New York and the Colosseum in Rome in the same year.\n", "\n", "A supporter of Perón, she favored leftist causes throughout her life. She supported President Raul Alfonsin in the election of 1983 which marked the return of democracy in Argentina following the dictatorship. She referred to this election as \"Argentina's Spring\" She opposed President Carlos Menem, who was in office from 1989 to 1999, and supported the election of Néstor Kirchner, who became president in 2003.\n", "Sosa was a UNESCO Goodwill Ambassador for Latin America and the Caribbean. \n", "Sosa disliked being identified as a protest singer. While she was outright in her political stances, Sosa said the following on the position of the artist: \n", "\n", "“An artist isn’t political in the party political sense – they have a constituency, which is their public – it is the poetry that matters most of all.”\n", "In a career spanning four decades, she worked with performers across several genres and generations, folk, opera, pop, rock, including Martha Argerich, Andrea Bocelli, David Broza, Franco Battiato, Jaime Roos, Joan Baez, Francis Cabrel, Gal Costa, Luz Casal, Lila Downs, Lucio Dalla, Maria Farantouri, Lucecita Benitez, Nilda Fernández, Charly Garcia, León Gieco, Gian Marco, Nana Mouskouri, Pablo Milanés, Holly Near, Milton Nascimento, Pata Negra, Fito Páez, Franco De Vita, Lourdes Pérez, Luciano Pavarotti, Silvio Rodríguez, Ismael Serrano, Shakira, Sting, Caetano Veloso, Julieta Venegas, Gustavo Cerati and Konstantin Wecker\n", "Sosa participated in a 1999 production of Ariel Ramírez's Misa Criolla. Her song Balderrama is featured in the 2008 movie Che, starring Benicio del Toro as the Argentine Marxist revolutionary Che Guevara.\n", "Sosa was the co-chair of the Earth Charter International Commission.\n", "\n", "\n", "== Awards ==\n", "Sosa won the Latin Grammy Award for Best Folk Album in 2000 (Misa Criolla), 2003 (Acústico), 2006 (Corazón Libre), 2009 (Cantora 1, which also won Best Recording Package and was nominated for Album of the Year), and 2011 (Deja La Vida Volar), as well as several international awards.\n", "In 1995, Konex Foundation from Argentina granted her the Diamond Konex Award, one of the most prestigious awards in Argentina, as the most important personality in the popular music of her country in the last decade.\n", "\n", "\n", "== Death ==\n", "\n", "Suffering from recurrent endocrine and respiratory problems in later years, the 74-year-old Sosa was hospitalized in Buenos Aires on 18 September 2009. She died from multiple organ failure on 4 October 2009, at 5:15 am. She is survived by one son, Fabián Matus, born of her first marriage. He said: \"She lived her 74 years to the fullest. She had done practically everything she wanted, she didn't have any type of barrier or any type of fear that limited her\". The hospital expressed its sympathies to her relatives. Her website featured the following: \"Her undisputed talent, her honesty and her profound convictions leave a great legacy to future generations\".\n", "Her body was placed on display at the National Congress building in Buenos Aires for the public to pay their respects, and President Fernández de Kirchner ordered three days of national mourning. Thousands had queued by the end of the day.\n", "Sosa's obituary in The Daily Telegraph said she was \"an unrivalled interpreter of works by her compatriot, the Argentine Atahualpa Yupanqui, and Chile's Violeta Parra\". Helen Popper of Reuters reported her death by saying she \"fought South America's dictators with her voice and became a giant of contemporary Latin American music\". Sosa received three Latin Grammy nominations for her album, in 2009 . She went on to win Best Folk Album about a month after her death.\n", "\n", "\n", "== Tributes ==\n", "In 2019, Sosa was celebrated by a Google Doodle. The doodle was showcased in Argentina, Chile, Uruguay, Paraguay, Bolivia, Peru, Ecuador, Cuba, Iceland, Sweden, Serbia, Greece, Israel and Vietnam.\n", "In 2023, Rolling Stone ranked Sosa at number 160 on its list of the 200 Greatest Singers of All Time.\n", "\n", "\n", "== Discography ==\n", "\n", "Sosa recorded forty albums.\n", "\n", "\n", "=== Studio albums ===\n", "\n", "\n", "=== EPs ===\n", "\n", "\n", "=== Live albums ===\n", "\n", "\n", "=== Compilation albums ===\n", "\n", "\n", "== Filmography ==\n", "Güemes, la tierra en armas (1971)\n", "Argentinísima (1972)\n", "Esta es mi Argentina (1974)\n", "Mercedes Sosa, como un pájaro libre (1983)\n", "Será possible el sur: Mercedes Sosa (1985)\n", "Historias de Argentina en vivo (2001)\n", "\n", "\n", "== Further reading ==\n", "\n", "\n", "== References ==\n", "\n", "\n", "== External links ==\n", "\n", "Tribute to Mercedes Sosa (in Portuguese BR)\n", "Mercedes Sosa's website (in Spanish)\n", "Mercedes Sosa's News (in Spanish)\n", "Mercedes Sosa at IMDb\n", "Mercedes Sosa's Discography on Discogs.com\n" ] } ], "execution_count": 22 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.654467Z", "start_time": "2025-05-03T15:14:13.429101Z" } }, "cell_type": "code", "source": "print(search_docs[0].metadata[\"title\"])", "id": "35beee79b5b922d1", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mercedes Sosa\n" ] } ], "execution_count": 23 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.654593Z", "start_time": "2025-05-03T15:02:21.929612Z" } }, "cell_type": "code", "source": "search_docs", "id": "3c8a97a5ef2382d6", "outputs": [ { "data": { "text/plain": [ "[Document(metadata={'title': 'Mercedes Sosa', 'summary': 'Haydée Mercedes \"La Negra\" Sosa (Latin American Spanish: [meɾˈseðes ˈsosa]; 9 July 1935 – 4 October 2009) was an Argentine singer who was popular throughout Latin America and many countries outside the region. With her roots in Argentine folk music, Sosa became one of the preeminent exponents of El nuevo cancionero. She gave voice to songs written by many Latin American songwriters. Her music made people hail her as the \"voice of the voiceless ones\". She was often called \"the conscience of Latin America\".\\nSosa performed in venues such as the Lincoln Center in New York City, the Théâtre Mogador in Paris, the Sistine Chapel in Vatican City, as well as sold-out shows in New York\\'s Carnegie Hall and the Roman Colosseum during her final decade of life. Her career spanned four decades and she was the recipient of six Latin Grammy awards (2000, 2003, 2004, 2006, 2009, 2011), including a Latin Grammy Lifetime Achievement Award in 2004 and two posthumous Latin Grammy Award for Best Folk Album in 2009 and 2011. She won the Premio Gardel in 2000, the main musical award in Argentina. She served as an ambassador for UNICEF.', 'source': 'https://en.wikipedia.org/wiki/Mercedes_Sosa'}, page_content='Haydée Mercedes \"La Negra\" Sosa (Latin American Spanish: [meɾˈseðes ˈsosa]; 9 July 1935 – 4 October 2009) was an Argentine singer who was popular throughout Latin America and many countries outside the region. With her roots in Argentine folk music, Sosa became one of the preeminent exponents of El nuevo cancionero. She gave voice to songs written by many Latin American songwriters. Her music made people hail her as the \"voice of the voiceless ones\". She was often called \"the conscience of Latin America\".\\nSosa performed in venues such as the Lincoln Center in New York City, the Théâtre Mogador in Paris, the Sistine Chapel in Vatican City, as well as sold-out shows in New York\\'s Carnegie Hall and the Roman Colosseum during her final decade of life. Her career spanned four decades and she was the recipient of six Latin Grammy awards (2000, 2003, 2004, 2006, 2009, 2011), including a Latin Grammy Lifetime Achievement Award in 2004 and two posthumous Latin Grammy Award for Best Folk Album in 2009 and 2011. She won the Premio Gardel in 2000, the main musical award in Argentina. She served as an ambassador for UNICEF.\\n\\n\\n== Life ==\\nSosa was born on 9 July 1935, in San Miguel de Tucumán, in the northwestern Argentine province of Tucumán, of mestizo ancestry. She was of French, Spanish and Diaguita descent. Her nickname \"la negra\", which is a common nickname in Argentina for people with darker complexion, is a reference to her indigenous heritage. Her parents, a day laborer and a washerwoman, were Peronists, although they never registered in the party, and she started her career as a singer for the Peronist Party in Tucuman under the name Gladys Osorio. In 1950, at age fifteen, she won a singing competition organized by a local radio station and was given a contract to perform for two months. She recorded her first album, La Voz de la Zafra, in 1959. A performance at the 1965 Cosquín National Folklore Festival—where she was introduced and brought to the stage while sitting in the audience by fellow folk singer Jorge Cafrune— brought her to the attention of the Argentine public. Sosa and her first husband, Manuel Oscar Matus, with whom she had one son, were key players in the mid-60s nueva canción movement (which was called nuevo cancionero in Argentina). Her second record was Canciones con Fundamento, a collection of Argentine folk songs.\\n\\nSosa \"spent the late 1960s building her audience in Europe and among the cosmopolitan middle class in Buenos Aires, becoming in the process a much bigger star\" than her contemporaries.In 1967, Sosa toured the United States and Europe with great success. In later years, she performed and recorded extensively, broadening her repertoire to include material from throughout Latin America.\\nIn the early 1970s, Sosa released two concept albums in collaboration with composer Ariel Ramírez and lyricist Félix Luna: Cantata Sudamericana and Mujeres Argentinas (Argentine Women). She also recorded a tribute to Chilean musician Violeta Parra in 1971, including what was to become one of Sosa\\'s signature songs, Gracias a la vida. She further popularized of songs written by Milton Nascimento of Brazil and Pablo Milanés and Silvio Rodríguez both from Cuba. Throughout the decade, she released albums such as Hasta la Victoria in 1972 and Traigo un Pueblo en mi Voz in 1973. They featured songs like \"Cuando tenga la tierra\", written by Ariel Petrocelli and Daniel Toro, which tackles political and social issues like wealth and land inequality. During the 1970s she was a part of two films by the director Leopoldo Torre Nilsson: El Santo de la Espada in 1970 and Güemes, la tierra en armas in 1971, in which she portrayed Juana Azurduy de Padilla, the guerrilla military leader who fought for Argentine independence.\\n\\nAfter the military junta of Jorge Videla came to power in 1976, the atmosphere in Argentina grew increasingly oppressive. Sosa faced death threats against both her and her family, but refused for many years to leave the country. At a concert in La Plata in 1979, Sosa was searched and arrested on stage, along with all those attending the concert. Their release came about through international intervention. Despite attempts to hold more concerts, she was officially barred from performing by the military regime. Banned in her own country, she moved to Paris and then to Madrid.She has spoken publicly about her artistic and emotional struggles during this period of her life. While in exile, she released the album A Quien Doy in 1981. The album included a recording of the song \"Cuando Me Acuerdo de Mi Pais\" which was originally written by the prolific Chilean singer/songwriter, Patricio Manns. The song, which he wrote while also in political exile, expresses the sorrow he felt from being separated from his homeland. She related to this feeling and struggled to continue recording and performing. In an interview with the New York Times, she said, “It was a mental problem, a problem of morale...It wasn’t my throat, or anything physical\". \\nSosa returned to Argentina from her exile in Europe in February of 1982, several months before the military regime collapsed as a result of the Falklands War, and gave a series of concerts at the Teatro Ópera in Buenos Aires, where she invited many of her younger colleagues to share the stage. A double album of recordings from these performances became an instant best seller. She then traveled to perform in her home province of Tucuman. However, these performances were largely ignored by mainstream media in the country. In subsequent years, Sosa continued to tour both in Argentina and abroad, performing in such venues as the Lincoln Center in New York City and the Théâtre Mogador in Paris. In poor health for much of the 1990s, she performed a comeback show in Argentina in 1998. In 1994, she played in the Sistine Chapel in Vatican City. In 2002, she sold out both Carnegie Hall in New York and the Colosseum in Rome in the same year.\\n\\nA supporter of Perón, she favored leftist causes throughout her life. She supported President Raul Alfonsin in the election of 1983 which marked the return of democracy in Argentina following the dictatorship. She referred to this election as \"Argentina\\'s Spring\" She opposed President Carlos Menem, who was in office from 1989 to 1999, and supported the election of Néstor Kirchner, who became president in 2003.\\nSosa was a UNESCO Goodwill Ambassador for Latin America and the Caribbean. \\nSosa disliked being identified as a protest singer. While she was outright in her political stances, Sosa said the following on the position of the artist: \\n\\n“An artist isn’t political in the party political sense – they have a constituency, which is their public – it is the poetry that matters most of all.”\\nIn a career spanning four decades, she worked with performers across several genres and generations, folk, opera, pop, rock, including Martha Argerich, Andrea Bocelli, David Broza, Franco Battiato, Jaime Roos, Joan Baez, Francis Cabrel, Gal Costa, Luz Casal, Lila Downs, Lucio Dalla, Maria Farantouri, Lucecita Benitez, Nilda Fernández, Charly Garcia, León Gieco, Gian Marco, Nana Mouskouri, Pablo Milanés, Holly Near, Milton Nascimento, Pata Negra, Fito Páez, Franco De Vita, Lourdes Pérez, Luciano Pavarotti, Silvio Rodríguez, Ismael Serrano, Shakira, Sting, Caetano Veloso, Julieta Venegas, Gustavo Cerati and Konstantin Wecker\\nSosa participated in a 1999 production of Ariel Ramírez\\'s Misa Criolla. Her song Balderrama is featured in the 2008 movie Che, starring Benicio del Toro as the Argentine Marxist revolutionary Che Guevara.\\nSosa was the co-chair of the Earth Charter International Commission.\\n\\n\\n== Awards ==\\nSosa won the Latin Grammy Award for Best Folk Album in 2000 (Misa Criolla), 2003 (Acústico), 2006 (Corazón Libre), 2009 (Cantora 1, which also won Best Recording Package and was nominated for Album of the Year), and 2011 (Deja La Vida Volar), as well as several international awards.\\nIn 1995, Konex Foundation from Argentina granted her the Diamond Konex Award, one of the most prestigious awards in Argentina, as the most important personality in the popular music of her country in the last decade.\\n\\n\\n== Death ==\\n\\nSuffering from recurrent endocrine and respiratory problems in later years, the 74-year-old Sosa was hospitalized in Buenos Aires on 18 September 2009. She died from multiple organ failure on 4 October 2009, at 5:15 am. She is survived by one son, Fabián Matus, born of her first marriage. He said: \"She lived her 74 years to the fullest. She had done practically everything she wanted, she didn\\'t have any type of barrier or any type of fear that limited her\". The hospital expressed its sympathies to her relatives. Her website featured the following: \"Her undisputed talent, her honesty and her profound convictions leave a great legacy to future generations\".\\nHer body was placed on display at the National Congress building in Buenos Aires for the public to pay their respects, and President Fernández de Kirchner ordered three days of national mourning. Thousands had queued by the end of the day.\\nSosa\\'s obituary in The Daily Telegraph said she was \"an unrivalled interpreter of works by her compatriot, the Argentine Atahualpa Yupanqui, and Chile\\'s Violeta Parra\". Helen Popper of Reuters reported her death by saying she \"fought South America\\'s dictators with her voice and became a giant of contemporary Latin American music\". Sosa received three Latin Grammy nominations for her album, in 2009 . She went on to win Best Folk Album about a month after her death.\\n\\n\\n== Tributes ==\\nIn 2019, Sosa was celebrated by a Google Doodle. The doodle was showcased in Argentina, Chile, Uruguay, Paraguay, Bolivia, Peru, Ecuador, Cuba, Iceland, Sweden, Serbia, Greece, Israel and Vietnam.\\nIn 2023, Rolling Stone ranked Sosa at number 160 on its list of the 200 Greatest Singers of All Time.\\n\\n\\n== Discography ==\\n\\nSosa recorded forty albums.\\n\\n\\n=== Studio albums ===\\n\\n\\n=== EPs ===\\n\\n\\n=== Live albums ===\\n\\n\\n=== Compilation albums ===\\n\\n\\n== Filmography ==\\nGüemes, la tierra en armas (1971)\\nArgentinísima (1972)\\nEsta es mi Argentina (1974)\\nMercedes Sosa, como un pájaro libre (1983)\\nSerá possible el sur: Mercedes Sosa (1985)\\nHistorias de Argentina en vivo (2001)\\n\\n\\n== Further reading ==\\n\\n\\n== References ==\\n\\n\\n== External links ==\\n\\nTribute to Mercedes Sosa (in Portuguese BR)\\nMercedes Sosa\\'s website (in Spanish)\\nMercedes Sosa\\'s News (in Spanish)\\nMercedes Sosa at IMDb\\nMercedes Sosa\\'s Discography on Discogs.com'),\n", " Document(metadata={'title': 'La Maza', 'summary': '\"La Maza\" (English: \"The Sledgehammer\") is a song by Argentine singer Mercedes Sosa featuring Colombian singer-songwriter Shakira from Sosa\\'s studio album Cantora, un Viaje Íntimo (2009). An acoustic folk song, it is known for its political message. The song was originally written and performed by Cuban composer and musician Silvio Rodríguez in 1982.', 'source': 'https://en.wikipedia.org/wiki/La_Maza'}, page_content='\"La Maza\" (English: \"The Sledgehammer\") is a song by Argentine singer Mercedes Sosa featuring Colombian singer-songwriter Shakira from Sosa\\'s studio album Cantora, un Viaje Íntimo (2009). An acoustic folk song, it is known for its political message. The song was originally written and performed by Cuban composer and musician Silvio Rodríguez in 1982.\\n\\n\\n== Background and release ==\\n\\n\"La Maza\" was written by Cuban composer and musician Silvio Rodriguez in 1979, and first released by him in 1982 as a part of his fifth studio album Unicornio. Mercedes Sosa performed the song together with Shakira in May 2008, before releasing a studio recording of the duet on her thirty-second studio album Cantora 1 on 27 March 2009, and on the double album Cantora, un Viaje Íntimo in September 2009.\\nThe official music video for \"La Maza\" was released in June 2021. The video consists of clips from the recording process of the song.\\n\\n\\n== Composition and lyrics ==\\n\"La Maza\" is a folk song. The lyrics of the song have a political and social message, and explore the theme of existential questioning and the search for meaning in one\\'s life and actions. The title of the song comes from the lyric \"¿Qué cosa fuera la maza sin cantera?\" English: (What would the sledgehammer be without a quarry?), referring to how life has no meaning if you have commitment to something. This also acts as a mirror of the society where this meaning of commitment has been forgotten. The lyric also refers to how a bond between a leader and their people rooted in the desire of change must exist.\\nThe recording of \"La Maza\" by Sosa and Shakira has an organic sound. The production is acoustic with guitar and percussion as instruments.\\n\\n\\n== Reception ==\\nCrónica outlined how \"La Maza\" is one of those Sosa\\'s songs which managed \"became hymns of struggle and resistance, a reflection of her commitment to social and humanitarian causes\". CiberCuba called the song a \"magnificent interpretation of a famous song\". In September 2020, Billboard staff listed the song as one of the 50 best Latin songs of all time, describing it as a \"powerful reflection on humanity\" that is \"even more eloquent in its arrangement, set simply to acoustic guitar and percussion.\"\\nGabriel Urbina from Cadiznoticias reflected how \"La Maza\" \"never gets old\", continuing how it is \"one of those songs that shake you strongly if you dedicate attention and time to it, looking into its eyes and drinking in the verses slowly, in small sips\", and characterized its chorus as \"brilliant and direct\".\\n\\n\\n== Live performance ==\\nOn 17 May 2008, Mercedes Sosa, Shakira, and Argentine musician Pedro Aznar performed \"La Maza\" for an audience of 150,000 people at the ALAS Foundation charity concert in Buenos Aires, Argentina. Their performance was dubbed \"one of the most emotional moments\" of the concert by Diario Río Negro. With the goal to \"improve the lives of Latin American children living in poverty\", the concert had 27 artists perform in two countries.\\n\\n\\n== Impact ==\\nAfter failed peace negotiations between Colombian government and Marxist–Leninist guerrilla group FARC, and FARC announcing the re-foundation of the Edison Romaña 53 front, on 19 April 2023, the Minister of National Defence of Colombia Iván Velásquez Gómez shared a part the lyrics of \"La Maza\" and a link to the music video of the song by Sosa and Shakira on Twitter. The lyrics \"si no creyera en lo que creo\" (English: \"if I didn’t believe in what I believe\") were a response to the criticism he had received emphasizing his conviction in the actions of his government despite opposition calling for a motion of censure. The post was met with disapproval on social media over its appropriateness and led opposition party Partido Cambio Radical to call Velásquez\\'s leadership a \"failure\".\\n\\n\\n== References ==')]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 4 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.655348Z", "start_time": "2025-05-03T15:06:06.938991Z" } }, "cell_type": "code", "source": [ "# needed packages\n", "# %pip install tabulate, lxml\n", "\n", "import pandas as pd\n", "import requests\n", "\n", "# url = \"https://en.wikipedia.org/wiki/Mercedes_Sosa\"\n", "url = \"https://en.wikipedia.org/wiki/2023_in_football\"\n", "html = requests.get(url, timeout=10).text # full HTML\n", "tables = pd.read_html(html) # → list[DataFrame]\n", "\n", "# convert the first table to markdown so the LLM can read it\n", "markdown = tables[0].to_markdown(index=False)\n", "print(markdown)" ], "id": "c003227b404d40ac", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "| 0 |\n", "|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n", "| Look for 2023 in football on one of Wikipedia's sister projects: Wiktionary (dictionary) Wikibooks (textbooks) Wikiquote (quotations) Wikisource (library) Wikiversity (learning resources) Commons (media) Wikivoyage (travel guide) Wikinews (news source) Wikidata (linked database) Wikispecies (species directory) Wikipedia does not have an article with this exact name. Please search for 2023 in football in Wikipedia to check for alternative titles or spellings. You need to log in or create an account and be autoconfirmed to create new articles. Alternatively, you can use the article wizard to submit a draft for review, or request a new article. Search for \"2023 in football\" in existing articles. Look for pages within Wikipedia that link to this title. Other reasons this message may be displayed: If a page was recently created here, it may not be visible yet because of a delay in updating the database; wait a few minutes or try the purge function. Titles on Wikipedia are case sensitive except for the first character; please check alternative capitalizations and consider adding a redirect here to the correct title. If the page has been deleted, check the deletion log, and see Why was the page I created deleted? |\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/mf/9y254h_17lg1x86hptmcd4v80000gn/T/ipykernel_18882/1545040319.py:10: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " tables = pd.read_html(html) # → list[DataFrame]\n" ] } ], "execution_count": 17 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.656185Z", "start_time": "2025-05-03T15:05:05.133244Z" } }, "cell_type": "code", "source": [ "t: str = tables[3].to_markdown(index=False)\n", "print(type(markdown))" ], "id": "ffb0f3dc5a99a12d", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "execution_count": 15 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:24:40.237204Z", "start_time": "2025-05-03T15:24:39.795870Z" } }, "cell_type": "code", "source": [ "from langchain_community.document_loaders.base import BaseLoader\n", "from langchain_core.documents import Document\n", "import pandas as pd, requests\n", "\n", "class WikipediaTableLoader(BaseLoader):\n", " \"\"\"Load every table on a Wikipedia page as a separate Document.\"\"\"\n", " def __init__(self, url: str, title: str):\n", " self.url = url\n", " self.title = title\n", "\n", " def load(self):\n", "\n", " html = requests.get(self.url, timeout=10).text\n", " dfs = pd.read_html(html) # grab the tables\n", " docs = []\n", "\n", " for i, df in enumerate(dfs):\n", " docs.append(\n", " Document(\n", " page_content=df.to_markdown(index=False),\n", " metadata={\n", " \"source\": self.url,\n", " \"title\": self.title,\n", " \"table_index\": i,\n", " },\n", " )\n", " )\n", " return docs" ], "id": "1b9cff15b35e5b79", "outputs": [], "execution_count": 1 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:28:20.229969Z", "start_time": "2025-05-03T15:28:19.587583Z" } }, "cell_type": "code", "source": [ "from langchain_custom import WikipediaTableLoader\n", "search_docs = WikipediaTableLoader(\"https://en.wikipedia.org/wiki/Mercedes_Sosa\",\"Mercedes Sosa\").load()" ], "id": "339b967ca6f99806", "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/dennis/PycharmProjects/Final_Assignment/langchain_custom.py:15: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(html) # grab the tables\n" ] } ], "execution_count": 1 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:28:21.596713Z", "start_time": "2025-05-03T15:28:21.592998Z" } }, "cell_type": "code", "source": [ "for doc in search_docs:\n", " print(doc.metadata[\"title\"], \"\\n\")\n", " print(doc.page_content)" ], "id": "a99f2f73478dcb1d", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mercedes Sosa \n", "\n", "| Mercedes Sosa | Mercedes Sosa.1 |\n", "|:--------------------------------------|:---------------------------------------------------------------------------|\n", "| Portrait by Annemarie Heinrich, 1960s | Portrait by Annemarie Heinrich, 1960s |\n", "| Born | Haydée Mercedes Sosa 9 July 1935 San Miguel de Tucumán, Tucumán, Argentina |\n", "| Died | 4 October 2009 (aged 74) Buenos Aires, Argentina |\n", "| Occupation | Singer |\n", "| Years active | 1950–2009 |\n", "| Musical career | Musical career |\n", "| Genres | Folknueva canción |\n", "| Instruments | Vocals |\n", "| nan | nan |\n", "Mercedes Sosa \n", "\n", "| Year | Album details |\n", "|-------:|:-------------------------------------------------------------|\n", "| 1962 | La Voz De La Zafra Label: RCA |\n", "| 1965 | Canciones Con Fundamento Label: El Grillo |\n", "| 1966 | Hermano Label: Philips |\n", "| 1966 | Yo No Canto Por Cantar Label: Philips |\n", "| 1967 | Para Cantarle A Mi Gente Label: Philips |\n", "| 1968 | Con Sabor A Mercedes Sosa Label: Philips |\n", "| 1969 | Mujeres Argentinas Label: Philips |\n", "| 1970 | El Grito De La Tierra Label: Philips |\n", "| 1970 | Navidad Con Mercedes Sosa Label: Philips |\n", "| 1971 | Homenaje a Violeta Parra Label: Philips |\n", "| 1972 | Hasta La Victoria Label: Philips |\n", "| 1972 | Cantata Sudamericana Label: Philips |\n", "| 1973 | Traigo Un Pueblo En Mi Voz Label: Philips |\n", "| 1975 | A Que Florezca Mi Pueblo Label: Philips |\n", "| 1976 | En Dirección Del Viento Label: Philips |\n", "| 1977 | Mercedes Sosa Interpreta A Atahualpa Yupanqui Label: Philips |\n", "| 1979 | Serenata Para La Tierra De Uno Label: Philips |\n", "| 1981 | A Quien Doy / Cuando Me Acuerdo de Mi País Label: Philips |\n", "| 1982 | Como Un Pájaro Libre Label: Philips |\n", "| 1983 | Mercedes Sosa Label: Philips |\n", "| 1984 | ¿Será Posible El Sur? Label: Philips |\n", "| 1985 | Vengo A Ofrecer Mi Corazón Label: Philips |\n", "| 1986 | Mercedes Sosa '86 Label: Philips |\n", "| 1987 | Mercedes Sosa '87 Label: Philips |\n", "| 1993 | Sino Label: Philips/Polygram |\n", "| 1994 | Gestos De Amor Label: Polydor |\n", "| 1996 | Escondido En Mi País Label: Polydor |\n", "| 1997 | Alta Fidelidad (w/Charly García) Label: Mercury |\n", "| 1998 | Al Despertar Label: Mercury |\n", "| 1999 | Misa Criolla Label: Mercury |\n", "| 2005 | Corazón Libre Label: Edge |\n", "| 2009 | Cantora 1 (w/various artists) Label: RCA |\n", "| 2009 | Cantora 2 (w/various artists) Label: RCA |\n", "| 2011 | Censurada Label: Philips |\n", "| 2015 | Lucerito Label: RCA |\n", "Mercedes Sosa \n", "\n", "| Year | EP details |\n", "|-------:|:------------------------------|\n", "| 1975 | Niño De Mañana Label: Philips |\n", "Mercedes Sosa \n", "\n", "| Year | Album details |\n", "|-------:|:----------------------------------------------------------------------------|\n", "| 1973 | Si Se Calla El Cantor (with Gloria Martin) Label: Philips |\n", "| 1980 | Gravado Ao Vivo No Brasil Label: Philips |\n", "| 1982 | Mercedes Sosa en Argentina Label: Phonogram/Philips |\n", "| 1985 | Corazón Americano (with Milton Nascimento & León Gieco) Label: Philips |\n", "| 1989 | Live in Europe Label: Tropical Music/Polygram Argentina |\n", "| 1991 | De Mí Label: Philips |\n", "| 2002 | Acústico En Vivo Label: Sony Music Argentina |\n", "| 2003 | Argentina Quiere Cantar (with Víctor Heredia & León Gieco) Label: Odeon/EMI |\n", "| 2010 | Deja La Vida Volar (En Gira) Label: RCA |\n", "| 2014 | Angel Label: Universal Music |\n", "| 2024 | En vivo en el Gran Rex 2006 Label: INAMU Discos |\n", "| 2024 | Mercedes Sosa en Nueva York, 1974 Label: Sony Music Argentina |\n", "Mercedes Sosa \n", "\n", "| Year | Album details |\n", "|-------:|:-----------------------------------------|\n", "| 1975 | Disco De Oro Label: Philips |\n", "| 1983 | Recital Label: Philips |\n", "| 1988 | Amigos Míos Label: Philips |\n", "| 1993 | 30 Años Label: Polygram Argentina |\n", "| 1995 | Oro Label: Polygram |\n", "| 1997 | The Best Of Mercedes Sosa Label: Mercury |\n", "| 2013 | Siempre En Ti Label: Universal Music |\n", "Mercedes Sosa \n", "\n", "| vteMercedes Sosa | vteMercedes Sosa.1 |\n", "|:-------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n", "| Songs | \"La Maza\" |\n", "| Albums | La Voz De La Zafra (1962) Canciones Con Fundamento (1965) Yo No Canto Por Cantar (1966) Hermano (1966) Para Cantarle A Mi Gente (1967) Con Sabor A Mercedes Sosa (1968) Mujeres Argentinas (1969) El Grito De La Tierra (1970) Navidad Con Mercedes Sosa (1970) Homenaje a Violeta Parra (1971) Hasta La Victoria (1972) Cantata Sudamericana (1972) Traigo Un Pueblo En Mi Voz (1973) A Que Florezca Mi Pueblo (1975) En Dirección Del Viento (1976) Mercedes Sosa Interpreta A Atahualpa Yupanqui (1977) Mercedes Sosa en Argentina (1982) Cantora 1 & 2 (2009) |\n", "| Related articles | Nueva canción |\n", "Mercedes Sosa \n", "\n", "| vteLatin Grammy Lifetime Achievement Award | vteLatin Grammy Lifetime Achievement Award.1 |\n", "|:---------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n", "| 2000s | 2004: Antonio Aguilar / Roberto Carlos / Willie Colón / José José / Mercedes Sosa 2005: Rocío Dúrcal / Generoso Jiménez / Jorge Ben Jor / Sérgio Mendes / Johnny Pacheco / Sandro 2006: León Gieco / Graciela / César Camargo Mariano / Richie Ray & Bobby Cruz / Paloma San Basilio / Alberto Vázquez / Johnny Ventura 2007: Alberto Cortez / Lucho Gatica / Olga Guillot / Os Paralamas do Sucesso / Los Tigres del Norte / Chavela Vargas 2008: Vikki Carr / Cheo Feliciano / Astrud Gilberto / Angélica María / María Dolores Pradera / Estela Raval 2009: Cándido Camero / Beth Carvalho / Charly García / Tania Libertad / Marco Antonio Muñiz / Juan Romero |\n", "| 2010s | 2010: João Donato / Las Hermanas Márquez / Armando Manzanero / Joseíto Mateo / Jorge Oñate / Susana Rinaldi 2011: Joe Arroyo / Gal Costa / José Feliciano / Álex Lora / Les Luthiers / Rubén Rada / Linda Ronstadt 2012: Luz Casal / Leo Dan / Rita Moreno / Milton Nascimento / Daniela Romo / Poncho Sanchez / Toquinho 2013: Oscar D'León / Juan Formell / Roberto Menescal / Totó la Momposina / Palito Ortega / Eddie Palmieri / Miguel Ríos 2014: Willy Chirino / César Costa / Carlos do Carmo / Dúo Dinámico / Los Lobos / Valeria Lynch / Ney Matogrosso 2015: Gato Barbieri / Ana Belén / Ángela Carrasco / Djavan / El Gran Combo de Puerto Rico / Víctor Manuel / Pablo Milanés 2016: El Consorcio / Eugenia León / Ricardo Montaner / Ednita Nazario / Piero 2017: Lucecita Benítez / João Bosco / Ilan Chester / Víctor Heredia / Los del Río / Guadalupe Pineda / Cuco Valoy 2018: Erasmo Carlos / Dyango / Andy Montañez / José María Napoleón / Chucho Valdés / Wilfrido Vargas / Yuri 2019: Eva Ayllón / Joan Baez / José Cid / Lupita D'Alessio / Hugo Fattoruso / Pimpinela / Omara Portuondo / José Luis Rodríguez |\n", "| 2020s | 2020 2021: Martinho da Vila / Emmanuel / Pete Escovedo / Sheila E. / Fito Páez / Milly Quezada / Joaquín Sabina / Gilberto Santa Rosa 2022: Rosario Flores / Myriam Hernández / Rita Lee / Amanda Miguel / Yordano 2023: Carmen Linares / Manuel Mijares / Arturo Sandoval / Simone / Soda Stereo / Ana Torroja 2024: Albita / Lolita Flores / Alejandro Lerner / Los Ángeles Azules / Draco Rosa / Lulu Santos |\n", "Mercedes Sosa \n", "\n", "| vteOrder of Cultural Merit (Brazil) | vteOrder of Cultural Merit (Brazil).1 |\n", "|--------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n", "| 1995 | Antônio Carlos Magalhães Celso Furtado Fernanda Montenegro Joãosinho Trinta Jorge Amado José Mindlin José Sarney Nascimento Brito Nise da Silveira Pietro Maria Bardi Ricardo Gribel Roberto Marinho |\n", "| 1996 | Athos Bulcão Bibi Ferreira Carybé Carlos Eduardo Moreira Ferreira Edemar Cid Ferreira Francisco Brennand Franco Montoro Jens Olesen Joel Mendes Rennó Max Justo Guedes Mestre Didi Nélida Piñon Olavo Setúbal Padre Vaz Sérgio Motta Walter Salles |\n", "| 1997 | Adélia Prado Antônio Poteiro Antônio Salgado Braguinha David Assayag Diogo Pacheco Dona Lenoca Fayga Ostrower Gilberto Chateaubriand Gilberto Ferrez Helena Severo Hilda Hilst Jorge da Cunha Lima Jorge Gerdau José Ermírio de Moraes José Safra Lúcio Costa Luís Carlos Barreto Mãe Olga do Alaketu Marcos Vilaça Maria Clara Machado Robert Broughton Ubiratan Aguiar Wladimir Murtinho |\n", "| 1998 | Abram Szajman Altamiro Carrilho Antônio Britto Ariano Suassuna Carlos Diegues Décio de Almeida Prado Franz Weissmann João Carlos Martins José Hugo Celidônio Lily Marinho Mãe Cleusa Millet Milu Villela Miguel Jorge Dona Neuma Octavio Frias Olavo Monteiro de Carvalho Paulo Autran Paulo César Ximenes Roseana Sarney Ruth Rocha Ruy Mesquita Sebastião Salgado Walter Hugo Khouri Zenildo Gonzaga Zoroastro de Lucena |\n", "| 1999 | Abraham Koogan Almir Gabriel Aloysio Faria Ana Maria Diniz Angel Vianna Antônio Houaiss Beatriz Pimenta Camargo Ecyla Brandão Enrique Iglesias Esther Bertoletti Hélio Jaguaribe Hermínio Bello de Carvalho J. Borges João Antunes Mãe Stella de Oxóssi Maria Cecília Geyer Maria Delith Balaban Mário Covas Paixão Côrtes Paulo Fontainha Geyer Romero Magalhães Washington Novaes |\n", "| 2000 | Ana Maria Machado Angela Gutierrez Dom Geraldo Dalal Achcar Edino Krieger Elizabeth D'Angelo Serra Firmino Ferreira Sampaio Neto Siron Franco Gianfrancesco Guarnieri Gilberto Gil José Alves Antunes Filho Luiz Henrique da Silveira Luiz Sponchiato Maria João Bustorff Mário Miguel Nicola Garófalo Martinho da Vila Nelson José Pinto Freire Paulo Tarso Flecha de Lima Plínio Pacheco Rodrigo Pederneiras Barbosa Ruth Escobar Sabine Lovatelli Sérgio Paulo Rouanet Sérgio Amaral Thomaz Farkas Tizuka Yamasaki Zezé Motta |\n", "| 2001 | Arthur Moreira Lima Catherine Tasca Célia Procópio de Araújo Carvalho Euclides Menezes Ferreira Dona Zica Fernando Faro G.R.E.S. Império Serrano G.R.E.S. Portela G.R.E.S. Vila Isabel G.R.E.S. Mangueira Haroldo Costa Hermínio Bello de Carvalho Henri Philippe Reichstul Hildmar Diniz Ivo Abrahão Nesralla Jamelão João Câmara Filho Luciana Stegagno Picchio Luís Antônio Viana Lygia Fagundes Telles Manuel Salustiano Soares Milton Gonçalves Milton Nascimento Paulinho da Viola Pilar del Castillo Purificación Carpinteyro Calderón Sari Bermúdez Sheila Copps Synésio Scofano Fernandes Thiago de Mello Yvonne Lara da Costa |\n", "| 2002 | Alberto Alves da Silva Ana Botafogo Candace Slater Carlos Roberto Faccina Centro Cultural Pró-Música Dalva Lazaroni Dominguinhos Dona Lucinha EDUSP Eduardo Baptista Vianna Frances Marinho George Savalla Gomes Guillermo O'Donnell G.R.E.S. Camisa Verde e Branco G.R.E.S. Vai Vai Henry Sobel Jack Leon Terpins João Filgueiras Jon M. Tolman Júlio Neves Julio Landmann Kabengele Munanga Lima Duarte Maria Della Costa Marlui Miranda Mestre Juca Niède Guidon Paulo Evaristo Arns Renato Borghetti Roberto Carlos Roberto DaMatta Sergio Kobayashi Silvio Barbato SBB Tania Mariza Kuchenbecker Rösing Vitae – Apoio à Cultura, Educação e Promoção Social |\n", "| 2003 | Afro Reggae Agostinho da Silva Aloísio Magalhães Antônio Nóbrega Ary Barroso ABC-SERRA Bené Fonteles Benedito Nunes Boi Caprichoso Boi Garantido Candido Portinari Carmen Costa Casseta & Planeta Chico Buarque de Holanda Coral dos Guarani Dorival Caymmi Eduardo Bueno Gilberto Mendes Grupo Ponto de Partida e o coro Meninos de Araçuaí Haroldo de Campos Herbert Vianna João Pequeno Jongo da Serrinha Jorge Mautner Maria Judith Zuzarte Cortesão Luiz Costa Lima Mangueira do Amanhã Manoel de Barros Marília Pêra Milton Santos Moacyr Scliar Nelson Pereira dos Santos Projeto Axé Projeto Guri Rita Lee Roberto Farias Rogério Sganzerla Rubinho do Vale Velha Guarda da Portela Zezé Di Camargo & Luciano |\n", "| 2004 | Alberto da Costa e Silva Angeli Arnaldo Carrilho Caetano Veloso Candombe do Açude Companhia Barrica Cordão da Bola Preta Danilo Miranda Fernando Sabino Frans Krajcberg Franco Fontana Fundação Casa Grande Geraldo Sarno Inezita Barroso João Donato José Júlio Pereira Cordeiro Blanco Lia de Itamaracá Liz Calder Márcia Haydée Mauricio de Sousa Movimento Arte contra a Barbárie Odete Lara Olga Praguer Coelho Orlando Villas-Bôas Ozualdo Candeias Paulo José Paulo Mendes da Rocha Pelé Povo Panará, Mato Grosso e Pará Pracatum Projeto Dança Comunidade Pulsar Companhia de Dança Rachel de Queiroz Renato Russo As Ceguinhas de Campina Grande Teatro Oficina Violeta Arraes Vó Maria Walter Firmo Waly Salomão |\n", "| 2005 | Alfredo Bosi Ana das Carrancas Antonio Jerônimo de Meneses Neto Antonio Manuel Lima Dias Augusto Boal Augusto Carlos da Silva Teles Pinduca Ballet Stagium Carlos Lopes CUCA/UNE Cleyde Yáconis Clóvis Moura Darcy Ribeiro Eduardo Coutinho Egberto Gismonti Eliane Lage Grupo Bandolins de Oeiras Henri Salvador Isabel Mendes da Cunha João Gilberto José Antônio de Almeida Prado José Mojica Marins Lino Rojas Manuel dos Reis Machado Maria Bethânia Mario Augusto de Berredo Carneiro Maurice Capovilla Dona Militana Movimento Manguebeat Museu Casa do Pontal Nei Lopes Nino Fernandes Olivério Ferreira Paulo Linhares Roger Avanzi Ruth de Souza Silviano Santiago Vicente Joaquim Ferreira Pastinha Ziraldo |\n", "| 2006 | Amir Haddad Banda de Pífanos de Caruaru Berthold Zilly Casa de Cultura Tainã CEASM Conselho Internacional de Museus Cora Coralina Curt Meyer-Clason Daniel Munduruku Dino Garcia Carrera Dona Teté Cacuriá Emmanuel Nassar Escola de Museologia da UniRio Feira do Livro de Porto Alegre Fernando Birri Grupo Corpo Henry Thorau Intrépida Trupe Johannes Odenthal José Mindlin Josué de Castro Júlio Bressane Laura Cardoso Lauro César Muniz Lygia Martins Costa Luiz Phelipe de Carvalho Castro Andrés Mário Cravo Neto Mário de Andrade Mário Pedrosa Mestre Eugênio Mestre Verequete Ministerio de Educación, Cultura y Deporte Moacir Santos MAX Paulo César Saraceni Pompeu Christovam de Pina Racionais MC's Ray-Güde Mertin Rodrigo Melo Franco Sábato Magaldi Santos Dumont Sivuca Tânia Andrade Lima Teodoro Freire Tomie Ohtake Vladimir Carvalho |\n", "| 2007 | Abdias Nascimento Álvaro Siza Vieira Antônio Carlos Jobim Associação Cultural Cachuera Banda Cabaçal dos Irmãos Aniceto Bárbara Heliodora Cacique Raoni Cartola Celine Imbert Cildo Meireles Castelo Rá-Tim-Bum Claude Lévi-Strauss Clube do Choro de Brasília Dodô e Osmar Escola de Circo Picolino Glauber Rocha Grande Otelo Grupo Nós do Morro Hermilo Borba Filho Lina Bo Bardi Lia Robatto Luiz Gonzaga Luiz Otavio Souza Santos Luiz Mott José Aparecido de Oliveira Jean-Claude Bernardet Jorge Benjor Judith Malina Kanuá Kamayurá Marcelo Grassmann Moniz Bandeira Museu Paraense Emílio Goeldi Orides Fontela Oscar Niemeyer Ronaldo Fraga Selma do Coco Sérgio Britto Solano Trindade Tônia Carrero Tostão Vânia Toledo Walter Smetak |\n", "| 2008 | Ailton Krenak Altemar Dutra Anselmo Duarte Athos Bulcão Benedito Ruy Barbosa Bule-Bule Carlos Lyra Claudia Andujar Dulcina de Moraes Edu Lobo Efigênia Ramos Rolim Eva Todor Goiandira do Couto Guimarães Rosa Hans-Joachim Koellreutter João Candido Portinari Johnny Alf Leonardo Villar Maria Bonomi Marlene Mercedes Sosa Milton Hatoum Nelson Triunfo Marcantônio Vilaça Otávio Afonso Orlando Miranda Paulo Emílio Sales Gomes Paulo Moura Pixinguinha Roberto Corrêa Ruy Guerra Sérgio Ricardo Tatiana Belinky Teresa Aguiar Vicente Salles Zabé da Loca Apiwtxa ABGLT ABI Associação Comunidade Yuba Centro Cultural Piollin Coletivo Nacional de Cultura do MST Giramundo Teatro de Bonecos Instituto Baccarelli Mestres da Guitarrada Música no Museu Quasar Cia de Dança |\n", "| 2009 | Aderbal Freire Filho Afoxé Filhos de Gandhy Alexandre Wollner Ângela Maria Ataulfo Alves Balé Popular do Recife Beatriz Sarlo Bispo do Rosário Boaventura de Sousa Santos Carlos Manga Carmen Miranda Chico Anysio Deborah Colker Davi Kopenawa Yanomami Elifas Andreato Fernanda Abreu Fernando Peixoto Fundação Iberê Camargo Gerson King Combo Gilvan Samico Heleny Guariba Instituto Olga Kos de Inclusão Cultural Ivaldo Bertazzo José Eduardo Agualusa José Miguel Wisnik Laerte Coutinho Luiz Olimecha Lydia Hortélio Mamulengo Só-Riso Manoel de Oliveira Maria Lúcia Godoy Maracatu Estrela de Ouro de Aliança Mestre Vitalino Mia Couto Miguel Rio Branco Nathalia Timberg Ney Matogrosso Noca da Portela Os Gêmeos Patativa do Assaré Paulo Vanzolini Paulo Bruscky Raul Seixas Roberto Burle Marx Sérgio Rodrigues Teatro Vila Velha ONG Video nas Aldeias Walmor Chagas Zeca Pagodinho |\n", "| 2010 | Andrea Tonacci Anna Bella Geiger Armando Nogueira Azelene Kaingang Cândido Mendes de Almeida Carlos Drummond de Andrade Carlota Albuquerque Cazuza Cesária Évora Companhia de Danças Folclóricas Aruanda Demônios da Garoa Denise Stoklos Época de Ouro Escuela Internacional de Cine y Televisión Gal Costa Glória Pires Hermeto Pascoal Ilo Krugli Ismael Ivo Ítalo Rossi Jaguar João Cabral de Melo Neto João Carlos de Souza Gomes Joaquim Nabuco Joênia Wapixana Lavadeiras de Almenara Leon Cakoff Leonardo Boff Lira Ceciliana Maracatu Estrela Brilhante de Igarassú Mário Gruber Correia Maureen Bisilliat Maurício Segall Mestre Alberto da Paz Moacir Werneck de Castro Nelson Rodrigues Pedro Casaldáliga Rogério Duarte Tonico Vinicius de Moraes |\n", "| 2011 | Academia Brasileira de Letras Adriana Varejão Afonso Borges Ana Montenegro Antônio Nóbrega Antônio Pitanga Apolônio Melônio Associação Capão Cidadão Associação dos Artesãos de Santana do Araçuaí Beth Carvalho Campos de Carvalho Capiba Casa de Produtos Indígenas Wariró Central Única das Favelas Clarice Lispector Claudett de Jesus Ribeiro Dançando para não dançar Dzi Croquettes Espedito Seleiro Evando dos Santos Festival de Dança de Joinville Festival Santista de Teatro Glênio Bianchetti Grupo Galpão Gustavo Dahl Héctor Babenco Helena Kolody Herbert de Sousa Ítala Nandi Jair Rodrigues João do Vale João das Neves José Renato Pécora Leila Diniz Lélia Abramo Luiz Melodia Lygia Bojunga Nunes Maracatu Estrela de Tracunhaém Mário Lago Memorial Jesuíta Unisinos Nelson Cavaquinho Paulo Freire Paulo Gracindo Quinteto Violado Samba de Cumbuca Teatro Tablado Tereza Costa Rêgo Vik Muniz Valdemar de Oliveira Zuzu Angel |\n", "| 2012 | Abelardo da Hora Aguinaldo Silva Alceu Valença Almir Narayamoga Suruí Amácio Mazzaropi Anna Muylaert Associação Carnavalesca Bloco Afro Olodum Autran Dourado Breno Silveira Carlos Alberto Cerqueira Lemos Cleodes Maria Piazza Julio Ribeiro Dener Pamplona de Abreu Elba Ramalho Fafá de Belém Felipe Schaedler Hebe Camargo Herivelto Martins Humberto Piva Campana and Fernando Piva Campana Escola de Dança e Integração Social Para Criança e Adolescente Fundação Municipal de Artes de Montenegro Ifigênia Rosa de Oliveira Isay Weinfeld Ismail Xavier Jorge Amado José Sarney Marieta Severo Mário Schenberg Martha Medeiros Miguel Chikaoka Milton Guran Movimento Gay de Minas Museu de Valores do Banco Central Museu Histórico Nacional Orquestra Popular da Bomba do Hemetério Orlando Orfei Paulo Goulart Plínio Marcos Raquel Trindade Regina Casé Rose Marie Muraro Senor Abravanel |\n", "| 2013 | Antônio Abujamra Antônio Fagundes Antunes Filho Associação de Sambadores e Sambadeiras do Estado da Bahia Bárbara Paz Carlos Diegues Daniel Munduruku Dona Zica Eleazar de Carvalho Erasmo Carlos Grupo de Dança Primeiro Ato Grupo Gay da Bahia Hélio Cabral Henfil Ilê ayê Ivan Lins Laerte Coutinho Lucy Barreto Maracambuco Maria Adelaide Amaral Maria Cândido Marlos Nobre Maurice Capovilla Mira Haar Naná Vasconcelos Nilcemar Nogueira Paulo Archias Mendes da Rocha Paulo Borges Roberto Pires Ronaldo Correia de Brito Rosa Maria dos Santos Alves Rubem Braga Sérgio Mamberti Sociedade Junina Bumba Meu Boi da Liberdade Tomie Ohtake Walda Marques Walter Pinto |\n", "| 2014 | Alex Atala Alexandre Herchcovitch Bernardo Paz Bruno e Marrone Celso Frateschi Chico de Assis Eliane Potiguara Henricredo Coelho Hermano Vianna Jenner Augusto José Carlos Meirelles Júlio Medaglia Mano Brown Marisa Monte Matheus Nachtergaele Ogã Bangbala Orlando Senna Oskar Metsavaht Patrícia Pillar Paulo Martins Tião Oleiro Vange Leonel |\n", "| 2015 | Adylson Godoy Ailton Krenak Aldyr Schlee Antônio Araújo Arnaldo Antunes As Ceguinhas de Campina Grande Augusto de Campos Casa de Cinema de Porto Alegre Centro de Memória do Circo Cesare La Rocca Comissão Guarani Yvyrupa Daniela Mercury Davi Kopenawa Yanomami Eva Schul Humberto Teixeira Italo Campofiorito Mestre João Grande José Mourão Luís Humberto Mãe Beth de Oxum Marcelo Yuka Niède Guidon Paulo Herkenhoff Rolando Boldrin Ruy Cezar Sociedade Musical Curica Sônia Guajajara Tribo de Atuadores Uruhu Mehinako Vanisa Santiago Vera Tostes Walter Carvalho |\n", "| 2016 | Abel Gomes Alcymar Monteiro Ana Mae Barbosa Andrucha Waddington Beatriz Milhazes Carlinhos de Jesus Carlos Alberto Serpa de Oliveira Carlos Vereza Clementina de Jesus Dona Ivone Lara Donga Fernando Meirelles Ferreira Gullar Focus Cia. De Dança Fred Gelli Fundação Darcy Ribeiro Grupo Teatro da Laje Instituto Ricardo Brennand Isaurinha Garcia Ismael Silva Jorge Aragão Jovelina Pérola Negra Maracatu Feminino Coração Nazareno Marcus Faustini Mauro Mendonça Museu do Samba Neguinho da Beija-Flor Nelson Sargento Noel Rosa Papete Ricardo Cravo Albin Rildo Hora Rosa Magalhães Rosa Maria Araújo Silas de Oliveira Vik Muniz |\n", "| 2017 | Afonso Oliveira Ana Maria Nobrega Miranda Augusto Marzagão Beto Kelner Boni Carla Camurati Carlos Tufvesson Cláudia Costin Domingo Alzugaray Dona Onete Eduardo Portella Eduardo Saron Nunes Fernando Alterio Galo da Madrugada Genival Lacerda Ivo Barroso Jair de Souza Luciane Gorgulho Luis Severiano Ribeiro Luiz Calainho Marcelo Bertini Marcelo Bratke Marcelo Dantas Maria Ignez Mantovani Moeller & Botelho Produções Artísticas Mãe Neide Oyá D´Oxum Paulo Cruz Pierre André Mantovani Renato Aragão Ricardo Amaral Roberto Minczuk Roberto Santucci |\n", "| 2018 | Abelardo Barbosa Antonio Mazzafera Biblioteca Oliveira Lima Bruno Wainer Carlos Saldanha Carlos Vereza Dedé Santana Eva Sopher Eva Wilma Festival Villa Mix Guilherme Fiuza Instituto Histórico e Geográfico Brasileiro Jorge Caldeira José Bonifácio Kati Almeida Braga King's Brazil Institute Luiz Oscar Niemeyer Marcelo Castello Branco Marcio Fraccaroli Martim Vasques da Cunha Milton Gonçalves Monah Delacy Museu de Arte de São Paulo Museu de Arte Moderna do Rio de Janeiro Museu de Arte Moderna de São Paulo Museu da Gente Sergipana Orquestra Filarmônica de Minas Gerais Roberto Teixeira da Costa Saulo Ferreira Sérgio Mendes Sérgio Mielniczenko Thiago Soares Trio Roraimeira Vó Mera Wanda Sá |\n", "Mercedes Sosa \n", "\n", "| Authority control databases | Authority control databases.1 |\n", "|:------------------------------|:------------------------------------------------------------------------------------------------|\n", "| International | ISNIVIAFFASTWorldCat |\n", "| National | GermanyUnited StatesFranceBnF dataItalySpainNetherlandsNorwayChileArgentinaKoreaIsraelCatalonia |\n", "| Artists | MusicBrainz |\n", "| People | Deutsche BiographieDDB |\n", "| Other | IdRefSNAC |\n" ] } ], "execution_count": 2 }, { "metadata": {}, "cell_type": "markdown", "source": "# Arxiv", "id": "2426d7a38d66019a" }, { "metadata": {}, "cell_type": "code", "source": "%pip install -qU langchain-community arxiv pymupdf", "id": "595a2f1afceeb8c", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "from langchain_community.document_loaders import ArxivLoader", "id": "417c6ea9631c6306", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "search_docs = ArxivLoader(query=\"IAM\", load_max_docs=3).load()", "id": "b8b62f83d9281774", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "", "id": "e28f96cd6e25ff0c", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "", "id": "84872aedbe970456", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "markdown", "source": "# Graph Test with web search", "id": "f53a68dafbed7643" }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.664466Z", "start_time": "2025-04-30T10:41:47.338329Z" } }, "cell_type": "code", "source": [ "from dotenv import load_dotenv\n", "\n", "from agent import *\n", "\n", "load_dotenv()\n", "\n", "llm = get_llm()\n", "\n", "graph = get_graph(llm)\n" ], "id": "106b84a960377aad", "outputs": [], "execution_count": 1 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.673812Z", "start_time": "2025-04-30T10:41:49.991801Z" } }, "cell_type": "code", "source": "graph.invoke({\"messages\": [HumanMessage(content=\"Search the web for the brith day of Friedrich Merz\"),]})", "id": "8ca9db24590884fa", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "-------------------- Starting to create a plan --------------------\n", "\n", "The plan is: 1. Search the web for \"Friedrich Merz birthday\".\n", "2. Extract the date from the search results.\n", "3. Provide the date as the answer.\n", "\n", "-------------------- Agent has been called -----------------------------------\n", "\n" ] }, { "ename": "KeyboardInterrupt", "evalue": "", "output_type": "error", "traceback": [ "\u001B[31m---------------------------------------------------------------------------\u001B[39m", "\u001B[31mKeyboardInterrupt\u001B[39m Traceback (most recent call last)", "\u001B[36mCell\u001B[39m\u001B[36m \u001B[39m\u001B[32mIn[2]\u001B[39m\u001B[32m, line 1\u001B[39m\n\u001B[32m----> \u001B[39m\u001B[32m1\u001B[39m \u001B[43mgraph\u001B[49m\u001B[43m.\u001B[49m\u001B[43minvoke\u001B[49m\u001B[43m(\u001B[49m\u001B[43m{\u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mmessages\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m:\u001B[49m\u001B[43m \u001B[49m\u001B[43m[\u001B[49m\u001B[43mHumanMessage\u001B[49m\u001B[43m(\u001B[49m\u001B[43mcontent\u001B[49m\u001B[43m=\u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mSearch the web for the brith day of Friedrich Merz\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\u001B[43m]\u001B[49m\u001B[43m}\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langgraph\\pregel\\__init__.py:2795\u001B[39m, in \u001B[36mPregel.invoke\u001B[39m\u001B[34m(self, input, config, stream_mode, output_keys, interrupt_before, interrupt_after, checkpoint_during, debug, **kwargs)\u001B[39m\n\u001B[32m 2793\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m 2794\u001B[39m chunks = []\n\u001B[32m-> \u001B[39m\u001B[32m2795\u001B[39m \u001B[43m\u001B[49m\u001B[38;5;28;43;01mfor\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43mchunk\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;129;43;01min\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mstream\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 2796\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43minput\u001B[39;49m\u001B[43m,\u001B[49m\n\u001B[32m 2797\u001B[39m \u001B[43m \u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2798\u001B[39m \u001B[43m \u001B[49m\u001B[43mstream_mode\u001B[49m\u001B[43m=\u001B[49m\u001B[43mstream_mode\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2799\u001B[39m \u001B[43m \u001B[49m\u001B[43moutput_keys\u001B[49m\u001B[43m=\u001B[49m\u001B[43moutput_keys\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2800\u001B[39m \u001B[43m \u001B[49m\u001B[43minterrupt_before\u001B[49m\u001B[43m=\u001B[49m\u001B[43minterrupt_before\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2801\u001B[39m \u001B[43m \u001B[49m\u001B[43minterrupt_after\u001B[49m\u001B[43m=\u001B[49m\u001B[43minterrupt_after\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2802\u001B[39m \u001B[43m \u001B[49m\u001B[43mcheckpoint_during\u001B[49m\u001B[43m=\u001B[49m\u001B[43mcheckpoint_during\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2803\u001B[39m \u001B[43m \u001B[49m\u001B[43mdebug\u001B[49m\u001B[43m=\u001B[49m\u001B[43mdebug\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2804\u001B[39m \u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2805\u001B[39m \u001B[43m\u001B[49m\u001B[43m)\u001B[49m\u001B[43m:\u001B[49m\n\u001B[32m 2806\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43;01mif\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43mstream_mode\u001B[49m\u001B[43m \u001B[49m\u001B[43m==\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mvalues\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m:\u001B[49m\n\u001B[32m 2807\u001B[39m \u001B[43m \u001B[49m\u001B[43mlatest\u001B[49m\u001B[43m \u001B[49m\u001B[43m=\u001B[49m\u001B[43m \u001B[49m\u001B[43mchunk\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langgraph\\pregel\\__init__.py:2433\u001B[39m, in \u001B[36mPregel.stream\u001B[39m\u001B[34m(self, input, config, stream_mode, output_keys, interrupt_before, interrupt_after, checkpoint_during, debug, subgraphs)\u001B[39m\n\u001B[32m 2427\u001B[39m \u001B[38;5;66;03m# Similarly to Bulk Synchronous Parallel / Pregel model\u001B[39;00m\n\u001B[32m 2428\u001B[39m \u001B[38;5;66;03m# computation proceeds in steps, while there are channel updates.\u001B[39;00m\n\u001B[32m 2429\u001B[39m \u001B[38;5;66;03m# Channel updates from step N are only visible in step N+1\u001B[39;00m\n\u001B[32m 2430\u001B[39m \u001B[38;5;66;03m# channels are guaranteed to be immutable for the duration of the step,\u001B[39;00m\n\u001B[32m 2431\u001B[39m \u001B[38;5;66;03m# with channel updates applied only at the transition between steps.\u001B[39;00m\n\u001B[32m 2432\u001B[39m \u001B[38;5;28;01mwhile\u001B[39;00m loop.tick(input_keys=\u001B[38;5;28mself\u001B[39m.input_channels):\n\u001B[32m-> \u001B[39m\u001B[32m2433\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43;01mfor\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43m_\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;129;43;01min\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43mrunner\u001B[49m\u001B[43m.\u001B[49m\u001B[43mtick\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 2434\u001B[39m \u001B[43m \u001B[49m\u001B[43mloop\u001B[49m\u001B[43m.\u001B[49m\u001B[43mtasks\u001B[49m\u001B[43m.\u001B[49m\u001B[43mvalues\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2435\u001B[39m \u001B[43m \u001B[49m\u001B[43mtimeout\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mstep_timeout\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2436\u001B[39m \u001B[43m \u001B[49m\u001B[43mretry_policy\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mretry_policy\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2437\u001B[39m \u001B[43m \u001B[49m\u001B[43mget_waiter\u001B[49m\u001B[43m=\u001B[49m\u001B[43mget_waiter\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 2438\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\u001B[43m:\u001B[49m\n\u001B[32m 2439\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;66;43;03m# emit output\u001B[39;49;00m\n\u001B[32m 2440\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43;01myield from\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43moutput\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 2441\u001B[39m \u001B[38;5;66;03m# emit output\u001B[39;00m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langgraph\\pregel\\runner.py:153\u001B[39m, in \u001B[36mPregelRunner.tick\u001B[39m\u001B[34m(self, tasks, reraise, timeout, retry_policy, get_waiter)\u001B[39m\n\u001B[32m 151\u001B[39m t = tasks[\u001B[32m0\u001B[39m]\n\u001B[32m 152\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m153\u001B[39m \u001B[43mrun_with_retry\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 154\u001B[39m \u001B[43m \u001B[49m\u001B[43mt\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 155\u001B[39m \u001B[43m \u001B[49m\u001B[43mretry_policy\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 156\u001B[39m \u001B[43m \u001B[49m\u001B[43mconfigurable\u001B[49m\u001B[43m=\u001B[49m\u001B[43m{\u001B[49m\n\u001B[32m 157\u001B[39m \u001B[43m \u001B[49m\u001B[43mCONFIG_KEY_CALL\u001B[49m\u001B[43m:\u001B[49m\u001B[43m \u001B[49m\u001B[43mpartial\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 158\u001B[39m \u001B[43m \u001B[49m\u001B[43m_call\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 159\u001B[39m \u001B[43m \u001B[49m\u001B[43mweakref\u001B[49m\u001B[43m.\u001B[49m\u001B[43mref\u001B[49m\u001B[43m(\u001B[49m\u001B[43mt\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 160\u001B[39m \u001B[43m \u001B[49m\u001B[43mretry\u001B[49m\u001B[43m=\u001B[49m\u001B[43mretry_policy\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 161\u001B[39m \u001B[43m \u001B[49m\u001B[43mfutures\u001B[49m\u001B[43m=\u001B[49m\u001B[43mweakref\u001B[49m\u001B[43m.\u001B[49m\u001B[43mref\u001B[49m\u001B[43m(\u001B[49m\u001B[43mfutures\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 162\u001B[39m \u001B[43m \u001B[49m\u001B[43mschedule_task\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mschedule_task\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 163\u001B[39m \u001B[43m \u001B[49m\u001B[43msubmit\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43msubmit\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 164\u001B[39m \u001B[43m \u001B[49m\u001B[43mreraise\u001B[49m\u001B[43m=\u001B[49m\u001B[43mreraise\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 165\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 166\u001B[39m \u001B[43m \u001B[49m\u001B[43m}\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 167\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 168\u001B[39m \u001B[38;5;28mself\u001B[39m.commit(t, \u001B[38;5;28;01mNone\u001B[39;00m)\n\u001B[32m 169\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m exc:\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langgraph\\pregel\\retry.py:40\u001B[39m, in \u001B[36mrun_with_retry\u001B[39m\u001B[34m(task, retry_policy, configurable)\u001B[39m\n\u001B[32m 38\u001B[39m task.writes.clear()\n\u001B[32m 39\u001B[39m \u001B[38;5;66;03m# run the task\u001B[39;00m\n\u001B[32m---> \u001B[39m\u001B[32m40\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mtask\u001B[49m\u001B[43m.\u001B[49m\u001B[43mproc\u001B[49m\u001B[43m.\u001B[49m\u001B[43minvoke\u001B[49m\u001B[43m(\u001B[49m\u001B[43mtask\u001B[49m\u001B[43m.\u001B[49m\u001B[43minput\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 41\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m ParentCommand \u001B[38;5;28;01mas\u001B[39;00m exc:\n\u001B[32m 42\u001B[39m ns: \u001B[38;5;28mstr\u001B[39m = config[CONF][CONFIG_KEY_CHECKPOINT_NS]\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langgraph\\utils\\runnable.py:623\u001B[39m, in \u001B[36mRunnableSeq.invoke\u001B[39m\u001B[34m(self, input, config, **kwargs)\u001B[39m\n\u001B[32m 621\u001B[39m \u001B[38;5;66;03m# run in context\u001B[39;00m\n\u001B[32m 622\u001B[39m \u001B[38;5;28;01mwith\u001B[39;00m set_config_context(config, run) \u001B[38;5;28;01mas\u001B[39;00m context:\n\u001B[32m--> \u001B[39m\u001B[32m623\u001B[39m \u001B[38;5;28minput\u001B[39m = \u001B[43mcontext\u001B[49m\u001B[43m.\u001B[49m\u001B[43mrun\u001B[49m\u001B[43m(\u001B[49m\u001B[43mstep\u001B[49m\u001B[43m.\u001B[49m\u001B[43minvoke\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43minput\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 624\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m 625\u001B[39m \u001B[38;5;28minput\u001B[39m = step.invoke(\u001B[38;5;28minput\u001B[39m, config)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langgraph\\utils\\runnable.py:377\u001B[39m, in \u001B[36mRunnableCallable.invoke\u001B[39m\u001B[34m(self, input, config, **kwargs)\u001B[39m\n\u001B[32m 375\u001B[39m run_manager.on_chain_end(ret)\n\u001B[32m 376\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m377\u001B[39m ret = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mfunc\u001B[49m\u001B[43m(\u001B[49m\u001B[43m*\u001B[49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 378\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m.recurse \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(ret, Runnable):\n\u001B[32m 379\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m ret.invoke(\u001B[38;5;28minput\u001B[39m, config)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\agent.py:217\u001B[39m, in \u001B[36mget_graph..call_model\u001B[39m\u001B[34m(state)\u001B[39m\n\u001B[32m 215\u001B[39m prompt_answer = prompt_template.invoke(messages)\n\u001B[32m 216\u001B[39m \u001B[38;5;66;03m# invoke LLM\u001B[39;00m\n\u001B[32m--> \u001B[39m\u001B[32m217\u001B[39m response = \u001B[43mllm_with_tools\u001B[49m\u001B[43m.\u001B[49m\u001B[43minvoke\u001B[49m\u001B[43m(\u001B[49m\u001B[43mprompt_answer\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 218\u001B[39m \u001B[38;5;28mprint\u001B[39m(\u001B[33m\"\u001B[39m\u001B[33mAgent has made a decision:\u001B[39m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[33m\"\u001B[39m, response.content, response.tool_calls)\n\u001B[32m 219\u001B[39m \u001B[38;5;28mprint\u001B[39m(\u001B[33m\"\u001B[39m\u001B[33mWaiting for 4 seconds...\u001B[39m\u001B[33m\"\u001B[39m)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_core\\runnables\\base.py:5416\u001B[39m, in \u001B[36mRunnableBindingBase.invoke\u001B[39m\u001B[34m(self, input, config, **kwargs)\u001B[39m\n\u001B[32m 5409\u001B[39m \u001B[38;5;129m@override\u001B[39m\n\u001B[32m 5410\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34minvoke\u001B[39m(\n\u001B[32m 5411\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m (...)\u001B[39m\u001B[32m 5414\u001B[39m **kwargs: Optional[Any],\n\u001B[32m 5415\u001B[39m ) -> Output:\n\u001B[32m-> \u001B[39m\u001B[32m5416\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mbound\u001B[49m\u001B[43m.\u001B[49m\u001B[43minvoke\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 5417\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43minput\u001B[39;49m\u001B[43m,\u001B[49m\n\u001B[32m 5418\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_merge_configs\u001B[49m\u001B[43m(\u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 5419\u001B[39m \u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43m{\u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m}\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 5420\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_google_genai\\chat_models.py:1175\u001B[39m, in \u001B[36mChatGoogleGenerativeAI.invoke\u001B[39m\u001B[34m(self, input, config, code_execution, stop, **kwargs)\u001B[39m\n\u001B[32m 1170\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m 1171\u001B[39m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\n\u001B[32m 1172\u001B[39m \u001B[33m\"\u001B[39m\u001B[33mTools are already defined.\u001B[39m\u001B[33m\"\u001B[39m \u001B[33m\"\u001B[39m\u001B[33mcode_execution tool can\u001B[39m\u001B[33m'\u001B[39m\u001B[33mt be defined\u001B[39m\u001B[33m\"\u001B[39m\n\u001B[32m 1173\u001B[39m )\n\u001B[32m-> \u001B[39m\u001B[32m1175\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43msuper\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\u001B[43m.\u001B[49m\u001B[43minvoke\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43minput\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstop\u001B[49m\u001B[43m=\u001B[49m\u001B[43mstop\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:369\u001B[39m, in \u001B[36mBaseChatModel.invoke\u001B[39m\u001B[34m(self, input, config, stop, **kwargs)\u001B[39m\n\u001B[32m 357\u001B[39m \u001B[38;5;129m@override\u001B[39m\n\u001B[32m 358\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34minvoke\u001B[39m(\n\u001B[32m 359\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m (...)\u001B[39m\u001B[32m 364\u001B[39m **kwargs: Any,\n\u001B[32m 365\u001B[39m ) -> BaseMessage:\n\u001B[32m 366\u001B[39m config = ensure_config(config)\n\u001B[32m 367\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m cast(\n\u001B[32m 368\u001B[39m \u001B[33m\"\u001B[39m\u001B[33mChatGeneration\u001B[39m\u001B[33m\"\u001B[39m,\n\u001B[32m--> \u001B[39m\u001B[32m369\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mgenerate_prompt\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 370\u001B[39m \u001B[43m \u001B[49m\u001B[43m[\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_convert_input\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43minput\u001B[39;49m\u001B[43m)\u001B[49m\u001B[43m]\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 371\u001B[39m \u001B[43m \u001B[49m\u001B[43mstop\u001B[49m\u001B[43m=\u001B[49m\u001B[43mstop\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 372\u001B[39m \u001B[43m \u001B[49m\u001B[43mcallbacks\u001B[49m\u001B[43m=\u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m.\u001B[49m\u001B[43mget\u001B[49m\u001B[43m(\u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mcallbacks\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 373\u001B[39m \u001B[43m \u001B[49m\u001B[43mtags\u001B[49m\u001B[43m=\u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m.\u001B[49m\u001B[43mget\u001B[49m\u001B[43m(\u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mtags\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 374\u001B[39m \u001B[43m \u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m=\u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m.\u001B[49m\u001B[43mget\u001B[49m\u001B[43m(\u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mmetadata\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 375\u001B[39m \u001B[43m \u001B[49m\u001B[43mrun_name\u001B[49m\u001B[43m=\u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m.\u001B[49m\u001B[43mget\u001B[49m\u001B[43m(\u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mrun_name\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 376\u001B[39m \u001B[43m \u001B[49m\u001B[43mrun_id\u001B[49m\u001B[43m=\u001B[49m\u001B[43mconfig\u001B[49m\u001B[43m.\u001B[49m\u001B[43mpop\u001B[49m\u001B[43m(\u001B[49m\u001B[33;43m\"\u001B[39;49m\u001B[33;43mrun_id\u001B[39;49m\u001B[33;43m\"\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43;01mNone\u001B[39;49;00m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 377\u001B[39m \u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 378\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m.generations[\u001B[32m0\u001B[39m][\u001B[32m0\u001B[39m],\n\u001B[32m 379\u001B[39m ).message\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:946\u001B[39m, in \u001B[36mBaseChatModel.generate_prompt\u001B[39m\u001B[34m(self, prompts, stop, callbacks, **kwargs)\u001B[39m\n\u001B[32m 937\u001B[39m \u001B[38;5;129m@override\u001B[39m\n\u001B[32m 938\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34mgenerate_prompt\u001B[39m(\n\u001B[32m 939\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m (...)\u001B[39m\u001B[32m 943\u001B[39m **kwargs: Any,\n\u001B[32m 944\u001B[39m ) -> LLMResult:\n\u001B[32m 945\u001B[39m prompt_messages = [p.to_messages() \u001B[38;5;28;01mfor\u001B[39;00m p \u001B[38;5;129;01min\u001B[39;00m prompts]\n\u001B[32m--> \u001B[39m\u001B[32m946\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mgenerate\u001B[49m\u001B[43m(\u001B[49m\u001B[43mprompt_messages\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstop\u001B[49m\u001B[43m=\u001B[49m\u001B[43mstop\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcallbacks\u001B[49m\u001B[43m=\u001B[49m\u001B[43mcallbacks\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:765\u001B[39m, in \u001B[36mBaseChatModel.generate\u001B[39m\u001B[34m(self, messages, stop, callbacks, tags, metadata, run_name, run_id, **kwargs)\u001B[39m\n\u001B[32m 762\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m i, m \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28menumerate\u001B[39m(input_messages):\n\u001B[32m 763\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m 764\u001B[39m results.append(\n\u001B[32m--> \u001B[39m\u001B[32m765\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_generate_with_cache\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 766\u001B[39m \u001B[43m \u001B[49m\u001B[43mm\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 767\u001B[39m \u001B[43m \u001B[49m\u001B[43mstop\u001B[49m\u001B[43m=\u001B[49m\u001B[43mstop\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 768\u001B[39m \u001B[43m \u001B[49m\u001B[43mrun_manager\u001B[49m\u001B[43m=\u001B[49m\u001B[43mrun_managers\u001B[49m\u001B[43m[\u001B[49m\u001B[43mi\u001B[49m\u001B[43m]\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43;01mif\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43mrun_managers\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43;01melse\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[38;5;28;43;01mNone\u001B[39;49;00m\u001B[43m,\u001B[49m\n\u001B[32m 769\u001B[39m \u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 770\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 771\u001B[39m )\n\u001B[32m 772\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mBaseException\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m e:\n\u001B[32m 773\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m run_managers:\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:1011\u001B[39m, in \u001B[36mBaseChatModel._generate_with_cache\u001B[39m\u001B[34m(self, messages, stop, run_manager, **kwargs)\u001B[39m\n\u001B[32m 1009\u001B[39m result = generate_from_stream(\u001B[38;5;28miter\u001B[39m(chunks))\n\u001B[32m 1010\u001B[39m \u001B[38;5;28;01melif\u001B[39;00m inspect.signature(\u001B[38;5;28mself\u001B[39m._generate).parameters.get(\u001B[33m\"\u001B[39m\u001B[33mrun_manager\u001B[39m\u001B[33m\"\u001B[39m):\n\u001B[32m-> \u001B[39m\u001B[32m1011\u001B[39m result = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_generate\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1012\u001B[39m \u001B[43m \u001B[49m\u001B[43mmessages\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstop\u001B[49m\u001B[43m=\u001B[49m\u001B[43mstop\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mrun_manager\u001B[49m\u001B[43m=\u001B[49m\u001B[43mrun_manager\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\n\u001B[32m 1013\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1014\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m 1015\u001B[39m result = \u001B[38;5;28mself\u001B[39m._generate(messages, stop=stop, **kwargs)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_google_genai\\chat_models.py:1242\u001B[39m, in \u001B[36mChatGoogleGenerativeAI._generate\u001B[39m\u001B[34m(self, messages, stop, run_manager, tools, functions, safety_settings, tool_config, generation_config, cached_content, tool_choice, **kwargs)\u001B[39m\n\u001B[32m 1216\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34m_generate\u001B[39m(\n\u001B[32m 1217\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m 1218\u001B[39m messages: List[BaseMessage],\n\u001B[32m (...)\u001B[39m\u001B[32m 1229\u001B[39m **kwargs: Any,\n\u001B[32m 1230\u001B[39m ) -> ChatResult:\n\u001B[32m 1231\u001B[39m request = \u001B[38;5;28mself\u001B[39m._prepare_request(\n\u001B[32m 1232\u001B[39m messages,\n\u001B[32m 1233\u001B[39m stop=stop,\n\u001B[32m (...)\u001B[39m\u001B[32m 1240\u001B[39m tool_choice=tool_choice,\n\u001B[32m 1241\u001B[39m )\n\u001B[32m-> \u001B[39m\u001B[32m1242\u001B[39m response: GenerateContentResponse = \u001B[43m_chat_with_retry\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1243\u001B[39m \u001B[43m \u001B[49m\u001B[43mrequest\u001B[49m\u001B[43m=\u001B[49m\u001B[43mrequest\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1244\u001B[39m \u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1245\u001B[39m \u001B[43m \u001B[49m\u001B[43mgeneration_method\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mclient\u001B[49m\u001B[43m.\u001B[49m\u001B[43mgenerate_content\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1246\u001B[39m \u001B[43m \u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mdefault_metadata\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 1247\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1248\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m _response_to_result(response)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_google_genai\\chat_models.py:208\u001B[39m, in \u001B[36m_chat_with_retry\u001B[39m\u001B[34m(generation_method, **kwargs)\u001B[39m\n\u001B[32m 205\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m e:\n\u001B[32m 206\u001B[39m \u001B[38;5;28;01mraise\u001B[39;00m e\n\u001B[32m--> \u001B[39m\u001B[32m208\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43m_chat_with_retry\u001B[49m\u001B[43m(\u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\tenacity\\__init__.py:338\u001B[39m, in \u001B[36mBaseRetrying.wraps..wrapped_f\u001B[39m\u001B[34m(*args, **kw)\u001B[39m\n\u001B[32m 336\u001B[39m copy = \u001B[38;5;28mself\u001B[39m.copy()\n\u001B[32m 337\u001B[39m wrapped_f.statistics = copy.statistics \u001B[38;5;66;03m# type: ignore[attr-defined]\u001B[39;00m\n\u001B[32m--> \u001B[39m\u001B[32m338\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mcopy\u001B[49m\u001B[43m(\u001B[49m\u001B[43mf\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkw\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\tenacity\\__init__.py:477\u001B[39m, in \u001B[36mRetrying.__call__\u001B[39m\u001B[34m(self, fn, *args, **kwargs)\u001B[39m\n\u001B[32m 475\u001B[39m retry_state = RetryCallState(retry_object=\u001B[38;5;28mself\u001B[39m, fn=fn, args=args, kwargs=kwargs)\n\u001B[32m 476\u001B[39m \u001B[38;5;28;01mwhile\u001B[39;00m \u001B[38;5;28;01mTrue\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m477\u001B[39m do = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43miter\u001B[49m\u001B[43m(\u001B[49m\u001B[43mretry_state\u001B[49m\u001B[43m=\u001B[49m\u001B[43mretry_state\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 478\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(do, DoAttempt):\n\u001B[32m 479\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\tenacity\\__init__.py:378\u001B[39m, in \u001B[36mBaseRetrying.iter\u001B[39m\u001B[34m(self, retry_state)\u001B[39m\n\u001B[32m 376\u001B[39m result = \u001B[38;5;28;01mNone\u001B[39;00m\n\u001B[32m 377\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m action \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mself\u001B[39m.iter_state.actions:\n\u001B[32m--> \u001B[39m\u001B[32m378\u001B[39m result = \u001B[43maction\u001B[49m\u001B[43m(\u001B[49m\u001B[43mretry_state\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 379\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m result\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\tenacity\\__init__.py:400\u001B[39m, in \u001B[36mBaseRetrying._post_retry_check_actions..\u001B[39m\u001B[34m(rs)\u001B[39m\n\u001B[32m 398\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34m_post_retry_check_actions\u001B[39m(\u001B[38;5;28mself\u001B[39m, retry_state: \u001B[33m\"\u001B[39m\u001B[33mRetryCallState\u001B[39m\u001B[33m\"\u001B[39m) -> \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[32m 399\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m (\u001B[38;5;28mself\u001B[39m.iter_state.is_explicit_retry \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mself\u001B[39m.iter_state.retry_run_result):\n\u001B[32m--> \u001B[39m\u001B[32m400\u001B[39m \u001B[38;5;28mself\u001B[39m._add_action_func(\u001B[38;5;28;01mlambda\u001B[39;00m rs: \u001B[43mrs\u001B[49m\u001B[43m.\u001B[49m\u001B[43moutcome\u001B[49m\u001B[43m.\u001B[49m\u001B[43mresult\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m)\n\u001B[32m 401\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m\n\u001B[32m 403\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m.after \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\concurrent\\futures\\_base.py:449\u001B[39m, in \u001B[36mFuture.result\u001B[39m\u001B[34m(self, timeout)\u001B[39m\n\u001B[32m 447\u001B[39m \u001B[38;5;28;01mraise\u001B[39;00m CancelledError()\n\u001B[32m 448\u001B[39m \u001B[38;5;28;01melif\u001B[39;00m \u001B[38;5;28mself\u001B[39m._state == FINISHED:\n\u001B[32m--> \u001B[39m\u001B[32m449\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m__get_result\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 451\u001B[39m \u001B[38;5;28mself\u001B[39m._condition.wait(timeout)\n\u001B[32m 453\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m._state \u001B[38;5;129;01min\u001B[39;00m [CANCELLED, CANCELLED_AND_NOTIFIED]:\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\concurrent\\futures\\_base.py:401\u001B[39m, in \u001B[36mFuture.__get_result\u001B[39m\u001B[34m(self)\u001B[39m\n\u001B[32m 399\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m._exception:\n\u001B[32m 400\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m401\u001B[39m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;28mself\u001B[39m._exception\n\u001B[32m 402\u001B[39m \u001B[38;5;28;01mfinally\u001B[39;00m:\n\u001B[32m 403\u001B[39m \u001B[38;5;66;03m# Break a reference cycle with the exception in self._exception\u001B[39;00m\n\u001B[32m 404\u001B[39m \u001B[38;5;28mself\u001B[39m = \u001B[38;5;28;01mNone\u001B[39;00m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\tenacity\\__init__.py:480\u001B[39m, in \u001B[36mRetrying.__call__\u001B[39m\u001B[34m(self, fn, *args, **kwargs)\u001B[39m\n\u001B[32m 478\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(do, DoAttempt):\n\u001B[32m 479\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m480\u001B[39m result = \u001B[43mfn\u001B[49m\u001B[43m(\u001B[49m\u001B[43m*\u001B[49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 481\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mBaseException\u001B[39;00m: \u001B[38;5;66;03m# noqa: B902\u001B[39;00m\n\u001B[32m 482\u001B[39m retry_state.set_exception(sys.exc_info()) \u001B[38;5;66;03m# type: ignore[arg-type]\u001B[39;00m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\langchain_google_genai\\chat_models.py:190\u001B[39m, in \u001B[36m_chat_with_retry.._chat_with_retry\u001B[39m\u001B[34m(**kwargs)\u001B[39m\n\u001B[32m 187\u001B[39m \u001B[38;5;129m@retry_decorator\u001B[39m\n\u001B[32m 188\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34m_chat_with_retry\u001B[39m(**kwargs: Any) -> Any:\n\u001B[32m 189\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m190\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mgeneration_method\u001B[49m\u001B[43m(\u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 191\u001B[39m \u001B[38;5;66;03m# Do not retry for these errors.\u001B[39;00m\n\u001B[32m 192\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m google.api_core.exceptions.FailedPrecondition \u001B[38;5;28;01mas\u001B[39;00m exc:\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\google\\ai\\generativelanguage_v1beta\\services\\generative_service\\client.py:867\u001B[39m, in \u001B[36mGenerativeServiceClient.generate_content\u001B[39m\u001B[34m(self, request, model, contents, retry, timeout, metadata)\u001B[39m\n\u001B[32m 864\u001B[39m \u001B[38;5;28mself\u001B[39m._validate_universe_domain()\n\u001B[32m 866\u001B[39m \u001B[38;5;66;03m# Send the request.\u001B[39;00m\n\u001B[32m--> \u001B[39m\u001B[32m867\u001B[39m response = \u001B[43mrpc\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 868\u001B[39m \u001B[43m \u001B[49m\u001B[43mrequest\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 869\u001B[39m \u001B[43m \u001B[49m\u001B[43mretry\u001B[49m\u001B[43m=\u001B[49m\u001B[43mretry\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 870\u001B[39m \u001B[43m \u001B[49m\u001B[43mtimeout\u001B[49m\u001B[43m=\u001B[49m\u001B[43mtimeout\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 871\u001B[39m \u001B[43m \u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m=\u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 872\u001B[39m \u001B[43m\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 874\u001B[39m \u001B[38;5;66;03m# Done; return the response.\u001B[39;00m\n\u001B[32m 875\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m response\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\google\\api_core\\gapic_v1\\method.py:131\u001B[39m, in \u001B[36m_GapicCallable.__call__\u001B[39m\u001B[34m(self, timeout, retry, compression, *args, **kwargs)\u001B[39m\n\u001B[32m 128\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m._compression \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[32m 129\u001B[39m kwargs[\u001B[33m\"\u001B[39m\u001B[33mcompression\u001B[39m\u001B[33m\"\u001B[39m] = compression\n\u001B[32m--> \u001B[39m\u001B[32m131\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mwrapped_func\u001B[49m\u001B[43m(\u001B[49m\u001B[43m*\u001B[49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\google\\api_core\\retry\\retry_unary.py:293\u001B[39m, in \u001B[36mRetry.__call__..retry_wrapped_func\u001B[39m\u001B[34m(*args, **kwargs)\u001B[39m\n\u001B[32m 289\u001B[39m target = functools.partial(func, *args, **kwargs)\n\u001B[32m 290\u001B[39m sleep_generator = exponential_sleep_generator(\n\u001B[32m 291\u001B[39m \u001B[38;5;28mself\u001B[39m._initial, \u001B[38;5;28mself\u001B[39m._maximum, multiplier=\u001B[38;5;28mself\u001B[39m._multiplier\n\u001B[32m 292\u001B[39m )\n\u001B[32m--> \u001B[39m\u001B[32m293\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mretry_target\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 294\u001B[39m \u001B[43m \u001B[49m\u001B[43mtarget\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 295\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_predicate\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 296\u001B[39m \u001B[43m \u001B[49m\u001B[43msleep_generator\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 297\u001B[39m \u001B[43m \u001B[49m\u001B[43mtimeout\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_timeout\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 298\u001B[39m \u001B[43m \u001B[49m\u001B[43mon_error\u001B[49m\u001B[43m=\u001B[49m\u001B[43mon_error\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 299\u001B[39m \u001B[43m\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\google\\api_core\\retry\\retry_unary.py:144\u001B[39m, in \u001B[36mretry_target\u001B[39m\u001B[34m(target, predicate, sleep_generator, timeout, on_error, exception_factory, **kwargs)\u001B[39m\n\u001B[32m 142\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m sleep \u001B[38;5;129;01min\u001B[39;00m sleep_generator:\n\u001B[32m 143\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m144\u001B[39m result = \u001B[43mtarget\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 145\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m inspect.isawaitable(result):\n\u001B[32m 146\u001B[39m warnings.warn(_ASYNC_RETRY_WARNING)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\google\\api_core\\timeout.py:130\u001B[39m, in \u001B[36mTimeToDeadlineTimeout.__call__..func_with_timeout\u001B[39m\u001B[34m(*args, **kwargs)\u001B[39m\n\u001B[32m 126\u001B[39m remaining_timeout = \u001B[38;5;28mself\u001B[39m._timeout\n\u001B[32m 128\u001B[39m kwargs[\u001B[33m\"\u001B[39m\u001B[33mtimeout\u001B[39m\u001B[33m\"\u001B[39m] = remaining_timeout\n\u001B[32m--> \u001B[39m\u001B[32m130\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mfunc\u001B[49m\u001B[43m(\u001B[49m\u001B[43m*\u001B[49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\google\\api_core\\grpc_helpers.py:76\u001B[39m, in \u001B[36m_wrap_unary_errors..error_remapped_callable\u001B[39m\u001B[34m(*args, **kwargs)\u001B[39m\n\u001B[32m 73\u001B[39m \u001B[38;5;129m@functools\u001B[39m.wraps(callable_)\n\u001B[32m 74\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34merror_remapped_callable\u001B[39m(*args, **kwargs):\n\u001B[32m 75\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m---> \u001B[39m\u001B[32m76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mcallable_\u001B[49m\u001B[43m(\u001B[49m\u001B[43m*\u001B[49m\u001B[43margs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43m*\u001B[49m\u001B[43m*\u001B[49m\u001B[43mkwargs\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 77\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m grpc.RpcError \u001B[38;5;28;01mas\u001B[39;00m exc:\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mraise\u001B[39;00m exceptions.from_grpc_error(exc) \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01mexc\u001B[39;00m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\grpc\\_interceptor.py:277\u001B[39m, in \u001B[36m_UnaryUnaryMultiCallable.__call__\u001B[39m\u001B[34m(self, request, timeout, metadata, credentials, wait_for_ready, compression)\u001B[39m\n\u001B[32m 268\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34m__call__\u001B[39m(\n\u001B[32m 269\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m 270\u001B[39m request: Any,\n\u001B[32m (...)\u001B[39m\u001B[32m 275\u001B[39m compression: Optional[grpc.Compression] = \u001B[38;5;28;01mNone\u001B[39;00m,\n\u001B[32m 276\u001B[39m ) -> Any:\n\u001B[32m--> \u001B[39m\u001B[32m277\u001B[39m response, ignored_call = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_with_call\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 278\u001B[39m \u001B[43m \u001B[49m\u001B[43mrequest\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 279\u001B[39m \u001B[43m \u001B[49m\u001B[43mtimeout\u001B[49m\u001B[43m=\u001B[49m\u001B[43mtimeout\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 280\u001B[39m \u001B[43m \u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m=\u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 281\u001B[39m \u001B[43m \u001B[49m\u001B[43mcredentials\u001B[49m\u001B[43m=\u001B[49m\u001B[43mcredentials\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 282\u001B[39m \u001B[43m \u001B[49m\u001B[43mwait_for_ready\u001B[49m\u001B[43m=\u001B[49m\u001B[43mwait_for_ready\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 283\u001B[39m \u001B[43m \u001B[49m\u001B[43mcompression\u001B[49m\u001B[43m=\u001B[49m\u001B[43mcompression\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 284\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 285\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m response\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\grpc\\_interceptor.py:329\u001B[39m, in \u001B[36m_UnaryUnaryMultiCallable._with_call\u001B[39m\u001B[34m(self, request, timeout, metadata, credentials, wait_for_ready, compression)\u001B[39m\n\u001B[32m 326\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m exception: \u001B[38;5;66;03m# pylint:disable=broad-except\u001B[39;00m\n\u001B[32m 327\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m _FailureOutcome(exception, sys.exc_info()[\u001B[32m2\u001B[39m])\n\u001B[32m--> \u001B[39m\u001B[32m329\u001B[39m call = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_interceptor\u001B[49m\u001B[43m.\u001B[49m\u001B[43mintercept_unary_unary\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 330\u001B[39m \u001B[43m \u001B[49m\u001B[43mcontinuation\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mclient_call_details\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mrequest\u001B[49m\n\u001B[32m 331\u001B[39m \u001B[43m\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 332\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m call.result(), call\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\google\\ai\\generativelanguage_v1beta\\services\\generative_service\\transports\\grpc.py:79\u001B[39m, in \u001B[36m_LoggingClientInterceptor.intercept_unary_unary\u001B[39m\u001B[34m(self, continuation, client_call_details, request)\u001B[39m\n\u001B[32m 64\u001B[39m grpc_request = {\n\u001B[32m 65\u001B[39m \u001B[33m\"\u001B[39m\u001B[33mpayload\u001B[39m\u001B[33m\"\u001B[39m: request_payload,\n\u001B[32m 66\u001B[39m \u001B[33m\"\u001B[39m\u001B[33mrequestMethod\u001B[39m\u001B[33m\"\u001B[39m: \u001B[33m\"\u001B[39m\u001B[33mgrpc\u001B[39m\u001B[33m\"\u001B[39m,\n\u001B[32m 67\u001B[39m \u001B[33m\"\u001B[39m\u001B[33mmetadata\u001B[39m\u001B[33m\"\u001B[39m: \u001B[38;5;28mdict\u001B[39m(request_metadata),\n\u001B[32m 68\u001B[39m }\n\u001B[32m 69\u001B[39m _LOGGER.debug(\n\u001B[32m 70\u001B[39m \u001B[33mf\u001B[39m\u001B[33m\"\u001B[39m\u001B[33mSending request for \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mclient_call_details.method\u001B[38;5;132;01m}\u001B[39;00m\u001B[33m\"\u001B[39m,\n\u001B[32m 71\u001B[39m extra={\n\u001B[32m (...)\u001B[39m\u001B[32m 76\u001B[39m },\n\u001B[32m 77\u001B[39m )\n\u001B[32m---> \u001B[39m\u001B[32m79\u001B[39m response = \u001B[43mcontinuation\u001B[49m\u001B[43m(\u001B[49m\u001B[43mclient_call_details\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mrequest\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 80\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m logging_enabled: \u001B[38;5;66;03m# pragma: NO COVER\u001B[39;00m\n\u001B[32m 81\u001B[39m response_metadata = response.trailing_metadata()\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\grpc\\_interceptor.py:315\u001B[39m, in \u001B[36m_UnaryUnaryMultiCallable._with_call..continuation\u001B[39m\u001B[34m(new_details, request)\u001B[39m\n\u001B[32m 306\u001B[39m (\n\u001B[32m 307\u001B[39m new_method,\n\u001B[32m 308\u001B[39m new_timeout,\n\u001B[32m (...)\u001B[39m\u001B[32m 312\u001B[39m new_compression,\n\u001B[32m 313\u001B[39m ) = _unwrap_client_call_details(new_details, client_call_details)\n\u001B[32m 314\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m315\u001B[39m response, call = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_thunk\u001B[49m\u001B[43m(\u001B[49m\u001B[43mnew_method\u001B[49m\u001B[43m)\u001B[49m\u001B[43m.\u001B[49m\u001B[43mwith_call\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 316\u001B[39m \u001B[43m \u001B[49m\u001B[43mrequest\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 317\u001B[39m \u001B[43m \u001B[49m\u001B[43mtimeout\u001B[49m\u001B[43m=\u001B[49m\u001B[43mnew_timeout\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 318\u001B[39m \u001B[43m \u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m=\u001B[49m\u001B[43mnew_metadata\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 319\u001B[39m \u001B[43m \u001B[49m\u001B[43mcredentials\u001B[49m\u001B[43m=\u001B[49m\u001B[43mnew_credentials\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 320\u001B[39m \u001B[43m \u001B[49m\u001B[43mwait_for_ready\u001B[49m\u001B[43m=\u001B[49m\u001B[43mnew_wait_for_ready\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 321\u001B[39m \u001B[43m \u001B[49m\u001B[43mcompression\u001B[49m\u001B[43m=\u001B[49m\u001B[43mnew_compression\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 322\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 323\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m _UnaryOutcome(response, call)\n\u001B[32m 324\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m grpc.RpcError \u001B[38;5;28;01mas\u001B[39;00m rpc_error:\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\grpc\\_channel.py:1195\u001B[39m, in \u001B[36m_UnaryUnaryMultiCallable.with_call\u001B[39m\u001B[34m(self, request, timeout, metadata, credentials, wait_for_ready, compression)\u001B[39m\n\u001B[32m 1183\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34mwith_call\u001B[39m(\n\u001B[32m 1184\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m 1185\u001B[39m request: Any,\n\u001B[32m (...)\u001B[39m\u001B[32m 1190\u001B[39m compression: Optional[grpc.Compression] = \u001B[38;5;28;01mNone\u001B[39;00m,\n\u001B[32m 1191\u001B[39m ) -> Tuple[Any, grpc.Call]:\n\u001B[32m 1192\u001B[39m (\n\u001B[32m 1193\u001B[39m state,\n\u001B[32m 1194\u001B[39m call,\n\u001B[32m-> \u001B[39m\u001B[32m1195\u001B[39m ) = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_blocking\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1196\u001B[39m \u001B[43m \u001B[49m\u001B[43mrequest\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mtimeout\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mmetadata\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcredentials\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mwait_for_ready\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcompression\u001B[49m\n\u001B[32m 1197\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1198\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m _end_unary_response_blocking(state, call, \u001B[38;5;28;01mTrue\u001B[39;00m, \u001B[38;5;28;01mNone\u001B[39;00m)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\grpc\\_channel.py:1162\u001B[39m, in \u001B[36m_UnaryUnaryMultiCallable._blocking\u001B[39m\u001B[34m(self, request, timeout, metadata, credentials, wait_for_ready, compression)\u001B[39m\n\u001B[32m 1145\u001B[39m state.target = _common.decode(\u001B[38;5;28mself\u001B[39m._target)\n\u001B[32m 1146\u001B[39m call = \u001B[38;5;28mself\u001B[39m._channel.segregated_call(\n\u001B[32m 1147\u001B[39m cygrpc.PropagationConstants.GRPC_PROPAGATE_DEFAULTS,\n\u001B[32m 1148\u001B[39m \u001B[38;5;28mself\u001B[39m._method,\n\u001B[32m (...)\u001B[39m\u001B[32m 1160\u001B[39m \u001B[38;5;28mself\u001B[39m._registered_call_handle,\n\u001B[32m 1161\u001B[39m )\n\u001B[32m-> \u001B[39m\u001B[32m1162\u001B[39m event = \u001B[43mcall\u001B[49m\u001B[43m.\u001B[49m\u001B[43mnext_event\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1163\u001B[39m _handle_event(event, state, \u001B[38;5;28mself\u001B[39m._response_deserializer)\n\u001B[32m 1164\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m state, call\n", "\u001B[36mFile \u001B[39m\u001B[32msrc\\\\python\\\\grpcio\\\\grpc\\\\_cython\\\\_cygrpc/channel.pyx.pxi:388\u001B[39m, in \u001B[36mgrpc._cython.cygrpc.SegregatedCall.next_event\u001B[39m\u001B[34m()\u001B[39m\n", "\u001B[36mFile \u001B[39m\u001B[32msrc\\\\python\\\\grpcio\\\\grpc\\\\_cython\\\\_cygrpc/channel.pyx.pxi:211\u001B[39m, in \u001B[36mgrpc._cython.cygrpc._next_call_event\u001B[39m\u001B[34m()\u001B[39m\n", "\u001B[36mFile \u001B[39m\u001B[32msrc\\\\python\\\\grpcio\\\\grpc\\\\_cython\\\\_cygrpc/channel.pyx.pxi:205\u001B[39m, in \u001B[36mgrpc._cython.cygrpc._next_call_event\u001B[39m\u001B[34m()\u001B[39m\n", "\u001B[36mFile \u001B[39m\u001B[32msrc\\\\python\\\\grpcio\\\\grpc\\\\_cython\\\\_cygrpc/completion_queue.pyx.pxi:78\u001B[39m, in \u001B[36mgrpc._cython.cygrpc._latent_event\u001B[39m\u001B[34m()\u001B[39m\n", "\u001B[36mFile \u001B[39m\u001B[32msrc\\\\python\\\\grpcio\\\\grpc\\\\_cython\\\\_cygrpc/completion_queue.pyx.pxi:61\u001B[39m, in \u001B[36mgrpc._cython.cygrpc._internal_latent_event\u001B[39m\u001B[34m()\u001B[39m\n", "\u001B[36mFile \u001B[39m\u001B[32msrc\\\\python\\\\grpcio\\\\grpc\\\\_cython\\\\_cygrpc/completion_queue.pyx.pxi:42\u001B[39m, in \u001B[36mgrpc._cython.cygrpc._next\u001B[39m\u001B[34m()\u001B[39m\n", "\u001B[31mKeyboardInterrupt\u001B[39m: " ] }, { "ename": "KeyboardInterrupt", "evalue": "", "output_type": "error", "traceback": [ "\u001B[31m---------------------------------------------------------------------------\u001B[39m", "\u001B[31mKeyboardInterrupt\u001B[39m Traceback (most recent call last)", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\async_helpers.py:128\u001B[39m, in \u001B[36m_pseudo_sync_runner\u001B[39m\u001B[34m(coro)\u001B[39m\n\u001B[32m 120\u001B[39m \u001B[38;5;250m\u001B[39m\u001B[33;03m\"\"\"\u001B[39;00m\n\u001B[32m 121\u001B[39m \u001B[33;03mA runner that does not really allow async execution, and just advance the coroutine.\u001B[39;00m\n\u001B[32m 122\u001B[39m \n\u001B[32m (...)\u001B[39m\u001B[32m 125\u001B[39m \u001B[33;03mCredit to Nathaniel Smith\u001B[39;00m\n\u001B[32m 126\u001B[39m \u001B[33;03m\"\"\"\u001B[39;00m\n\u001B[32m 127\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m128\u001B[39m \u001B[43mcoro\u001B[49m\u001B[43m.\u001B[49m\u001B[43msend\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43;01mNone\u001B[39;49;00m\u001B[43m)\u001B[49m\n\u001B[32m 129\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mStopIteration\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m exc:\n\u001B[32m 130\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m exc.value\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\interactiveshell.py:3384\u001B[39m, in \u001B[36mInteractiveShell.run_cell_async\u001B[39m\u001B[34m(self, raw_cell, store_history, silent, shell_futures, transformed_cell, preprocessing_exc_tuple, cell_id)\u001B[39m\n\u001B[32m 3380\u001B[39m exec_count = \u001B[38;5;28mself\u001B[39m.execution_count\n\u001B[32m 3381\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m result.error_in_exec:\n\u001B[32m 3382\u001B[39m \u001B[38;5;66;03m# Store formatted traceback and error details\u001B[39;00m\n\u001B[32m 3383\u001B[39m \u001B[38;5;28mself\u001B[39m.history_manager.exceptions[exec_count] = (\n\u001B[32m-> \u001B[39m\u001B[32m3384\u001B[39m \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_format_exception_for_storage\u001B[49m\u001B[43m(\u001B[49m\u001B[43mresult\u001B[49m\u001B[43m.\u001B[49m\u001B[43merror_in_exec\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 3385\u001B[39m )\n\u001B[32m 3387\u001B[39m \u001B[38;5;66;03m# Each cell is a *single* input, regardless of how many lines it has\u001B[39;00m\n\u001B[32m 3388\u001B[39m \u001B[38;5;28mself\u001B[39m.execution_count += \u001B[32m1\u001B[39m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\interactiveshell.py:3438\u001B[39m, in \u001B[36mInteractiveShell._format_exception_for_storage\u001B[39m\u001B[34m(self, exception, filename, running_compiled_code)\u001B[39m\n\u001B[32m 3435\u001B[39m stb = evalue._render_traceback_()\n\u001B[32m 3436\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m 3437\u001B[39m \u001B[38;5;66;03m# Otherwise, use InteractiveTB to format the traceback.\u001B[39;00m\n\u001B[32m-> \u001B[39m\u001B[32m3438\u001B[39m stb = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mInteractiveTB\u001B[49m\u001B[43m.\u001B[49m\u001B[43mstructured_traceback\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 3439\u001B[39m \u001B[43m \u001B[49m\u001B[43metype\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mevalue\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mtb\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mtb_offset\u001B[49m\u001B[43m=\u001B[49m\u001B[32;43m1\u001B[39;49m\n\u001B[32m 3440\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 3441\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m:\n\u001B[32m 3442\u001B[39m \u001B[38;5;66;03m# In case formatting fails, fallback to Python's built-in formatting.\u001B[39;00m\n\u001B[32m 3443\u001B[39m stb = traceback.format_exception(etype, evalue, tb)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\ultratb.py:1182\u001B[39m, in \u001B[36mAutoFormattedTB.structured_traceback\u001B[39m\u001B[34m(self, etype, evalue, etb, tb_offset, context)\u001B[39m\n\u001B[32m 1180\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m 1181\u001B[39m \u001B[38;5;28mself\u001B[39m.tb = etb\n\u001B[32m-> \u001B[39m\u001B[32m1182\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mFormattedTB\u001B[49m\u001B[43m.\u001B[49m\u001B[43mstructured_traceback\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1183\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43metype\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mevalue\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43metb\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mtb_offset\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcontext\u001B[49m\n\u001B[32m 1184\u001B[39m \u001B[43m\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\ultratb.py:1053\u001B[39m, in \u001B[36mFormattedTB.structured_traceback\u001B[39m\u001B[34m(self, etype, evalue, etb, tb_offset, context)\u001B[39m\n\u001B[32m 1050\u001B[39m mode = \u001B[38;5;28mself\u001B[39m.mode\n\u001B[32m 1051\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m mode \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mself\u001B[39m.verbose_modes:\n\u001B[32m 1052\u001B[39m \u001B[38;5;66;03m# Verbose modes need a full traceback\u001B[39;00m\n\u001B[32m-> \u001B[39m\u001B[32m1053\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mVerboseTB\u001B[49m\u001B[43m.\u001B[49m\u001B[43mstructured_traceback\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 1054\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43metype\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mevalue\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43metb\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mtb_offset\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcontext\u001B[49m\n\u001B[32m 1055\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 1056\u001B[39m \u001B[38;5;28;01melif\u001B[39;00m mode == \u001B[33m\"\u001B[39m\u001B[33mDocs\u001B[39m\u001B[33m\"\u001B[39m:\n\u001B[32m 1057\u001B[39m \u001B[38;5;66;03m# return DocTB\u001B[39;00m\n\u001B[32m 1058\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m DocTB(\n\u001B[32m 1059\u001B[39m theme_name=\u001B[38;5;28mself\u001B[39m._theme_name,\n\u001B[32m 1060\u001B[39m call_pdb=\u001B[38;5;28mself\u001B[39m.call_pdb,\n\u001B[32m (...)\u001B[39m\u001B[32m 1068\u001B[39m etype, evalue, etb, tb_offset, \u001B[32m1\u001B[39m\n\u001B[32m 1069\u001B[39m ) \u001B[38;5;66;03m# type: ignore[arg-type]\u001B[39;00m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\ultratb.py:861\u001B[39m, in \u001B[36mVerboseTB.structured_traceback\u001B[39m\u001B[34m(self, etype, evalue, etb, tb_offset, context)\u001B[39m\n\u001B[32m 852\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34mstructured_traceback\u001B[39m(\n\u001B[32m 853\u001B[39m \u001B[38;5;28mself\u001B[39m,\n\u001B[32m 854\u001B[39m etype: \u001B[38;5;28mtype\u001B[39m,\n\u001B[32m (...)\u001B[39m\u001B[32m 858\u001B[39m context: \u001B[38;5;28mint\u001B[39m = \u001B[32m5\u001B[39m,\n\u001B[32m 859\u001B[39m ) -> \u001B[38;5;28mlist\u001B[39m[\u001B[38;5;28mstr\u001B[39m]:\n\u001B[32m 860\u001B[39m \u001B[38;5;250m \u001B[39m\u001B[33;03m\"\"\"Return a nice text document describing the traceback.\"\"\"\u001B[39;00m\n\u001B[32m--> \u001B[39m\u001B[32m861\u001B[39m formatted_exceptions: \u001B[38;5;28mlist\u001B[39m[\u001B[38;5;28mlist\u001B[39m[\u001B[38;5;28mstr\u001B[39m]] = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mformat_exception_as_a_whole\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 862\u001B[39m \u001B[43m \u001B[49m\u001B[43metype\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mevalue\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43metb\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcontext\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mtb_offset\u001B[49m\n\u001B[32m 863\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 865\u001B[39m termsize = \u001B[38;5;28mmin\u001B[39m(\u001B[32m75\u001B[39m, get_terminal_size()[\u001B[32m0\u001B[39m])\n\u001B[32m 866\u001B[39m theme = theme_table[\u001B[38;5;28mself\u001B[39m._theme_name]\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\ultratb.py:773\u001B[39m, in \u001B[36mVerboseTB.format_exception_as_a_whole\u001B[39m\u001B[34m(self, etype, evalue, etb, context, tb_offset)\u001B[39m\n\u001B[32m 763\u001B[39m frames.append(\n\u001B[32m 764\u001B[39m theme_table[\u001B[38;5;28mself\u001B[39m._theme_name].format(\n\u001B[32m 765\u001B[39m [\n\u001B[32m (...)\u001B[39m\u001B[32m 770\u001B[39m )\n\u001B[32m 771\u001B[39m )\n\u001B[32m 772\u001B[39m skipped = \u001B[32m0\u001B[39m\n\u001B[32m--> \u001B[39m\u001B[32m773\u001B[39m frames.append(\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mformat_record\u001B[49m\u001B[43m(\u001B[49m\u001B[43mrecord\u001B[49m\u001B[43m)\u001B[49m)\n\u001B[32m 774\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m skipped:\n\u001B[32m 775\u001B[39m frames.append(\n\u001B[32m 776\u001B[39m theme_table[\u001B[38;5;28mself\u001B[39m._theme_name].format(\n\u001B[32m 777\u001B[39m [\n\u001B[32m (...)\u001B[39m\u001B[32m 782\u001B[39m )\n\u001B[32m 783\u001B[39m )\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\ultratb.py:651\u001B[39m, in \u001B[36mVerboseTB.format_record\u001B[39m\u001B[34m(self, frame_info)\u001B[39m\n\u001B[32m 648\u001B[39m result += \u001B[33m\"\u001B[39m\u001B[33m, \u001B[39m\u001B[33m\"\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m call \u001B[38;5;28;01melse\u001B[39;00m \u001B[33m\"\u001B[39m\u001B[33m\"\u001B[39m\n\u001B[32m 649\u001B[39m result += \u001B[33mf\u001B[39m\u001B[33m\"\u001B[39m\u001B[38;5;132;01m{\u001B[39;00mcall\u001B[38;5;132;01m}\u001B[39;00m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[33m\"\u001B[39m\n\u001B[32m 650\u001B[39m result += theme_table[\u001B[38;5;28mself\u001B[39m._theme_name].format(\n\u001B[32m--> \u001B[39m\u001B[32m651\u001B[39m \u001B[43m_format_traceback_lines\u001B[49m\u001B[43m(\u001B[49m\n\u001B[32m 652\u001B[39m \u001B[43m \u001B[49m\u001B[43mframe_info\u001B[49m\u001B[43m.\u001B[49m\u001B[43mlines\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 653\u001B[39m \u001B[43m \u001B[49m\u001B[43mtheme_table\u001B[49m\u001B[43m[\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_theme_name\u001B[49m\u001B[43m]\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 654\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mhas_colors\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 655\u001B[39m \u001B[43m \u001B[49m\u001B[43mlvals_toks\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 656\u001B[39m \u001B[43m \u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 657\u001B[39m )\n\u001B[32m 658\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m result\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\IPython\\core\\tbtools.py:99\u001B[39m, in \u001B[36m_format_traceback_lines\u001B[39m\u001B[34m(lines, theme, has_colors, lvals_toks)\u001B[39m\n\u001B[32m 96\u001B[39m \u001B[38;5;28;01mcontinue\u001B[39;00m\n\u001B[32m 98\u001B[39m lineno = stack_line.lineno\n\u001B[32m---> \u001B[39m\u001B[32m99\u001B[39m line = \u001B[43mstack_line\u001B[49m\u001B[43m.\u001B[49m\u001B[43mrender\u001B[49m\u001B[43m(\u001B[49m\u001B[43mpygmented\u001B[49m\u001B[43m=\u001B[49m\u001B[43mhas_colors\u001B[49m\u001B[43m)\u001B[49m.rstrip(\u001B[33m\"\u001B[39m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[33m\"\u001B[39m) + \u001B[33m\"\u001B[39m\u001B[38;5;130;01m\\n\u001B[39;00m\u001B[33m\"\u001B[39m\n\u001B[32m 100\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m stack_line.is_current:\n\u001B[32m 101\u001B[39m \u001B[38;5;66;03m# This is the line with the error\u001B[39;00m\n\u001B[32m 102\u001B[39m pad = numbers_width - \u001B[38;5;28mlen\u001B[39m(\u001B[38;5;28mstr\u001B[39m(lineno))\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\stack_data\\core.py:391\u001B[39m, in \u001B[36mLine.render\u001B[39m\u001B[34m(self, markers, strip_leading_indent, pygmented, escape_html)\u001B[39m\n\u001B[32m 389\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m pygmented \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;28mself\u001B[39m.frame_info.scope:\n\u001B[32m 390\u001B[39m assert_(\u001B[38;5;129;01mnot\u001B[39;00m markers, \u001B[38;5;167;01mValueError\u001B[39;00m(\u001B[33m\"\u001B[39m\u001B[33mCannot use pygmented with markers\u001B[39m\u001B[33m\"\u001B[39m))\n\u001B[32m--> \u001B[39m\u001B[32m391\u001B[39m start_line, lines = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mframe_info\u001B[49m\u001B[43m.\u001B[49m\u001B[43m_pygmented_scope_lines\u001B[49m\n\u001B[32m 392\u001B[39m result = lines[\u001B[38;5;28mself\u001B[39m.lineno - start_line]\n\u001B[32m 393\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m strip_leading_indent:\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\stack_data\\utils.py:145\u001B[39m, in \u001B[36mcached_property.cached_property_wrapper\u001B[39m\u001B[34m(self, obj, _cls)\u001B[39m\n\u001B[32m 142\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m obj \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28;01mNone\u001B[39;00m:\n\u001B[32m 143\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\n\u001B[32m--> \u001B[39m\u001B[32m145\u001B[39m value = obj.\u001B[34m__dict__\u001B[39m[\u001B[38;5;28mself\u001B[39m.func.\u001B[34m__name__\u001B[39m] = \u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mfunc\u001B[49m\u001B[43m(\u001B[49m\u001B[43mobj\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 146\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m value\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\stack_data\\core.py:824\u001B[39m, in \u001B[36mFrameInfo._pygmented_scope_lines\u001B[39m\u001B[34m(self)\u001B[39m\n\u001B[32m 821\u001B[39m ranges = []\n\u001B[32m 823\u001B[39m code = atext.get_text(scope)\n\u001B[32m--> \u001B[39m\u001B[32m824\u001B[39m lines = \u001B[43m_pygmented_with_ranges\u001B[49m\u001B[43m(\u001B[49m\u001B[43mformatter\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mcode\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mranges\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 826\u001B[39m start_line = \u001B[38;5;28mself\u001B[39m.source.line_range(scope)[\u001B[32m0\u001B[39m]\n\u001B[32m 828\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m start_line, lines\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\stack_data\\utils.py:164\u001B[39m, in \u001B[36m_pygmented_with_ranges\u001B[39m\u001B[34m(formatter, code, ranges)\u001B[39m\n\u001B[32m 161\u001B[39m length += \u001B[38;5;28mlen\u001B[39m(value)\n\u001B[32m 162\u001B[39m \u001B[38;5;28;01myield\u001B[39;00m ttype, value\n\u001B[32m--> \u001B[39m\u001B[32m164\u001B[39m lexer = \u001B[43mMyLexer\u001B[49m\u001B[43m(\u001B[49m\u001B[43mstripnl\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43;01mFalse\u001B[39;49;00m\u001B[43m)\u001B[49m\n\u001B[32m 165\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m 166\u001B[39m highlighted = pygments.highlight(code, lexer, formatter)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\lexer.py:660\u001B[39m, in \u001B[36mRegexLexerMeta.__call__\u001B[39m\u001B[34m(cls, *args, **kwds)\u001B[39m\n\u001B[32m 658\u001B[39m \u001B[38;5;28;01mpass\u001B[39;00m\n\u001B[32m 659\u001B[39m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m660\u001B[39m \u001B[38;5;28mcls\u001B[39m._tokens = \u001B[38;5;28;43mcls\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mprocess_tokendef\u001B[49m\u001B[43m(\u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43mcls\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mget_tokendefs\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 662\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mtype\u001B[39m.\u001B[34m__call__\u001B[39m(\u001B[38;5;28mcls\u001B[39m, *args, **kwds)\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\lexer.py:599\u001B[39m, in \u001B[36mRegexLexerMeta.process_tokendef\u001B[39m\u001B[34m(cls, name, tokendefs)\u001B[39m\n\u001B[32m 597\u001B[39m tokendefs = tokendefs \u001B[38;5;129;01mor\u001B[39;00m \u001B[38;5;28mcls\u001B[39m.tokens[name]\n\u001B[32m 598\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m state \u001B[38;5;129;01min\u001B[39;00m \u001B[38;5;28mlist\u001B[39m(tokendefs):\n\u001B[32m--> \u001B[39m\u001B[32m599\u001B[39m \u001B[38;5;28;43mcls\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_process_state\u001B[49m\u001B[43m(\u001B[49m\u001B[43mtokendefs\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mprocessed\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstate\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 600\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m processed\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\lexer.py:563\u001B[39m, in \u001B[36mRegexLexerMeta._process_state\u001B[39m\u001B[34m(cls, unprocessed, processed, state)\u001B[39m\n\u001B[32m 560\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(tdef, include):\n\u001B[32m 561\u001B[39m \u001B[38;5;66;03m# it's a state reference\u001B[39;00m\n\u001B[32m 562\u001B[39m \u001B[38;5;28;01massert\u001B[39;00m tdef != state, \u001B[33mf\u001B[39m\u001B[33m\"\u001B[39m\u001B[33mcircular state reference \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mstate\u001B[38;5;132;01m!r}\u001B[39;00m\u001B[33m\"\u001B[39m\n\u001B[32m--> \u001B[39m\u001B[32m563\u001B[39m tokens.extend(\u001B[38;5;28;43mcls\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_process_state\u001B[49m\u001B[43m(\u001B[49m\u001B[43munprocessed\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mprocessed\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 564\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43mstr\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43mtdef\u001B[49m\u001B[43m)\u001B[49m\u001B[43m)\u001B[49m)\n\u001B[32m 565\u001B[39m \u001B[38;5;28;01mcontinue\u001B[39;00m\n\u001B[32m 566\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(tdef, _inherit):\n\u001B[32m 567\u001B[39m \u001B[38;5;66;03m# should be processed already, but may not in the case of:\u001B[39;00m\n\u001B[32m 568\u001B[39m \u001B[38;5;66;03m# 1. the state has no counterpart in any parent\u001B[39;00m\n\u001B[32m 569\u001B[39m \u001B[38;5;66;03m# 2. the state includes more than one 'inherit'\u001B[39;00m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\lexer.py:563\u001B[39m, in \u001B[36mRegexLexerMeta._process_state\u001B[39m\u001B[34m(cls, unprocessed, processed, state)\u001B[39m\n\u001B[32m 560\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(tdef, include):\n\u001B[32m 561\u001B[39m \u001B[38;5;66;03m# it's a state reference\u001B[39;00m\n\u001B[32m 562\u001B[39m \u001B[38;5;28;01massert\u001B[39;00m tdef != state, \u001B[33mf\u001B[39m\u001B[33m\"\u001B[39m\u001B[33mcircular state reference \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mstate\u001B[38;5;132;01m!r}\u001B[39;00m\u001B[33m\"\u001B[39m\n\u001B[32m--> \u001B[39m\u001B[32m563\u001B[39m tokens.extend(\u001B[38;5;28;43mcls\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_process_state\u001B[49m\u001B[43m(\u001B[49m\u001B[43munprocessed\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mprocessed\u001B[49m\u001B[43m,\u001B[49m\n\u001B[32m 564\u001B[39m \u001B[43m \u001B[49m\u001B[38;5;28;43mstr\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43mtdef\u001B[49m\u001B[43m)\u001B[49m\u001B[43m)\u001B[49m)\n\u001B[32m 565\u001B[39m \u001B[38;5;28;01mcontinue\u001B[39;00m\n\u001B[32m 566\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(tdef, _inherit):\n\u001B[32m 567\u001B[39m \u001B[38;5;66;03m# should be processed already, but may not in the case of:\u001B[39;00m\n\u001B[32m 568\u001B[39m \u001B[38;5;66;03m# 1. the state has no counterpart in any parent\u001B[39;00m\n\u001B[32m 569\u001B[39m \u001B[38;5;66;03m# 2. the state includes more than one 'inherit'\u001B[39;00m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\lexer.py:579\u001B[39m, in \u001B[36mRegexLexerMeta._process_state\u001B[39m\u001B[34m(cls, unprocessed, processed, state)\u001B[39m\n\u001B[32m 576\u001B[39m \u001B[38;5;28;01massert\u001B[39;00m \u001B[38;5;28mtype\u001B[39m(tdef) \u001B[38;5;129;01mis\u001B[39;00m \u001B[38;5;28mtuple\u001B[39m, \u001B[33mf\u001B[39m\u001B[33m\"\u001B[39m\u001B[33mwrong rule def \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mtdef\u001B[38;5;132;01m!r}\u001B[39;00m\u001B[33m\"\u001B[39m\n\u001B[32m 578\u001B[39m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[32m--> \u001B[39m\u001B[32m579\u001B[39m rex = \u001B[38;5;28;43mcls\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43m_process_regex\u001B[49m\u001B[43m(\u001B[49m\u001B[43mtdef\u001B[49m\u001B[43m[\u001B[49m\u001B[32;43m0\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mrflags\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mstate\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 580\u001B[39m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mException\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m err:\n\u001B[32m 581\u001B[39m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mValueError\u001B[39;00m(\u001B[33mf\u001B[39m\u001B[33m\"\u001B[39m\u001B[33muncompilable regex \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mtdef[\u001B[32m0\u001B[39m]\u001B[38;5;132;01m!r}\u001B[39;00m\u001B[33m in state \u001B[39m\u001B[38;5;132;01m{\u001B[39;00mstate\u001B[38;5;132;01m!r}\u001B[39;00m\u001B[33m of \u001B[39m\u001B[38;5;132;01m{\u001B[39;00m\u001B[38;5;28mcls\u001B[39m\u001B[38;5;132;01m!r}\u001B[39;00m\u001B[33m: \u001B[39m\u001B[38;5;132;01m{\u001B[39;00merr\u001B[38;5;132;01m}\u001B[39;00m\u001B[33m\"\u001B[39m) \u001B[38;5;28;01mfrom\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34;01merr\u001B[39;00m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\lexer.py:507\u001B[39m, in \u001B[36mRegexLexerMeta._process_regex\u001B[39m\u001B[34m(cls, regex, rflags, state)\u001B[39m\n\u001B[32m 505\u001B[39m \u001B[38;5;250m\u001B[39m\u001B[33;03m\"\"\"Preprocess the regular expression component of a token definition.\"\"\"\u001B[39;00m\n\u001B[32m 506\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(regex, Future):\n\u001B[32m--> \u001B[39m\u001B[32m507\u001B[39m regex = \u001B[43mregex\u001B[49m\u001B[43m.\u001B[49m\u001B[43mget\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[32m 508\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m re.compile(regex, rflags).match\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\lexer.py:495\u001B[39m, in \u001B[36mwords.get\u001B[39m\u001B[34m(self)\u001B[39m\n\u001B[32m 494\u001B[39m \u001B[38;5;28;01mdef\u001B[39;00m\u001B[38;5;250m \u001B[39m\u001B[34mget\u001B[39m(\u001B[38;5;28mself\u001B[39m):\n\u001B[32m--> \u001B[39m\u001B[32m495\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[43mregex_opt\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mwords\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43mprefix\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43mprefix\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[43msuffix\u001B[49m\u001B[43m=\u001B[49m\u001B[38;5;28;43mself\u001B[39;49m\u001B[43m.\u001B[49m\u001B[43msuffix\u001B[49m\u001B[43m)\u001B[49m\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:91\u001B[39m, in \u001B[36mregex_opt\u001B[39m\u001B[34m(strings, prefix, suffix)\u001B[39m\n\u001B[32m 83\u001B[39m \u001B[38;5;250m\u001B[39m\u001B[33;03m\"\"\"Return a compiled regex that matches any string in the given list.\u001B[39;00m\n\u001B[32m 84\u001B[39m \n\u001B[32m 85\u001B[39m \u001B[33;03mThe strings to match must be literal strings, not regexes. They will be\u001B[39;00m\n\u001B[32m (...)\u001B[39m\u001B[32m 88\u001B[39m \u001B[33;03m*prefix* and *suffix* are pre- and appended to the final regex.\u001B[39;00m\n\u001B[32m 89\u001B[39m \u001B[33;03m\"\"\"\u001B[39;00m\n\u001B[32m 90\u001B[39m strings = \u001B[38;5;28msorted\u001B[39m(strings)\n\u001B[32m---> \u001B[39m\u001B[32m91\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m prefix + \u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[43mstrings\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m(\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m + suffix\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(regex_opt_inner(\u001B[38;5;28mlist\u001B[39m(group[\u001B[32m1\u001B[39m]), \u001B[33m'\u001B[39m\u001B[33m'\u001B[39m)\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36m\u001B[39m\u001B[34m(.0)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(\u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mlist\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43mgroup\u001B[49m\u001B[43m[\u001B[49m\u001B[32;43m1\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(regex_opt_inner(\u001B[38;5;28mlist\u001B[39m(group[\u001B[32m1\u001B[39m]), \u001B[33m'\u001B[39m\u001B[33m'\u001B[39m)\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36m\u001B[39m\u001B[34m(.0)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(\u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mlist\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43mgroup\u001B[49m\u001B[43m[\u001B[49m\u001B[32;43m1\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(regex_opt_inner(\u001B[38;5;28mlist\u001B[39m(group[\u001B[32m1\u001B[39m]), \u001B[33m'\u001B[39m\u001B[33m'\u001B[39m)\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36m\u001B[39m\u001B[34m(.0)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(\u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mlist\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43mgroup\u001B[49m\u001B[43m[\u001B[49m\u001B[32;43m1\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:63\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 59\u001B[39m plen = \u001B[38;5;28mlen\u001B[39m(prefix)\n\u001B[32m 60\u001B[39m \u001B[38;5;66;03m# we have a prefix for all strings\u001B[39;00m\n\u001B[32m 61\u001B[39m \u001B[38;5;66;03m# print '-> prefix:', prefix\u001B[39;00m\n\u001B[32m 62\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + escape(prefix) \\\n\u001B[32m---> \u001B[39m\u001B[32m63\u001B[39m + \u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[43m[\u001B[49m\u001B[43ms\u001B[49m\u001B[43m[\u001B[49m\u001B[43mplen\u001B[49m\u001B[43m:\u001B[49m\u001B[43m]\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43;01mfor\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43ms\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;129;43;01min\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43mstrings\u001B[49m\u001B[43m]\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m(?:\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m \\\n\u001B[32m 64\u001B[39m + close_paren\n\u001B[32m 65\u001B[39m \u001B[38;5;66;03m# is there a suffix?\u001B[39;00m\n\u001B[32m 66\u001B[39m strings_rev = [s[::-\u001B[32m1\u001B[39m] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings]\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:72\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 69\u001B[39m slen = \u001B[38;5;28mlen\u001B[39m(suffix)\n\u001B[32m 70\u001B[39m \u001B[38;5;66;03m# print '-> suffix:', suffix[::-1]\u001B[39;00m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m---> \u001B[39m\u001B[32m72\u001B[39m + \u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43msorted\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43ms\u001B[49m\u001B[43m[\u001B[49m\u001B[43m:\u001B[49m\u001B[43m-\u001B[49m\u001B[43mslen\u001B[49m\u001B[43m]\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43;01mfor\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43ms\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;129;43;01min\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43mstrings\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m(?:\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m 77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(regex_opt_inner(\u001B[38;5;28mlist\u001B[39m(group[\u001B[32m1\u001B[39m]), \u001B[33m'\u001B[39m\u001B[33m'\u001B[39m)\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(regex_opt_inner(\u001B[38;5;28mlist\u001B[39m(group[\u001B[32m1\u001B[39m]), \u001B[33m'\u001B[39m\u001B[33m'\u001B[39m)\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36m\u001B[39m\u001B[34m(.0)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(\u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[38;5;28;43mlist\u001B[39;49m\u001B[43m(\u001B[49m\u001B[43mgroup\u001B[49m\u001B[43m[\u001B[49m\u001B[32;43m1\u001B[39;49m\u001B[43m]\u001B[49m\u001B[43m)\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:63\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 59\u001B[39m plen = \u001B[38;5;28mlen\u001B[39m(prefix)\n\u001B[32m 60\u001B[39m \u001B[38;5;66;03m# we have a prefix for all strings\u001B[39;00m\n\u001B[32m 61\u001B[39m \u001B[38;5;66;03m# print '-> prefix:', prefix\u001B[39;00m\n\u001B[32m 62\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + escape(prefix) \\\n\u001B[32m---> \u001B[39m\u001B[32m63\u001B[39m + \u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[43m[\u001B[49m\u001B[43ms\u001B[49m\u001B[43m[\u001B[49m\u001B[43mplen\u001B[49m\u001B[43m:\u001B[49m\u001B[43m]\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;28;43;01mfor\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43ms\u001B[49m\u001B[43m \u001B[49m\u001B[38;5;129;43;01min\u001B[39;49;00m\u001B[43m \u001B[49m\u001B[43mstrings\u001B[49m\u001B[43m]\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m(?:\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m \\\n\u001B[32m 64\u001B[39m + close_paren\n\u001B[32m 65\u001B[39m \u001B[38;5;66;03m# is there a suffix?\u001B[39;00m\n\u001B[32m 66\u001B[39m strings_rev = [s[::-\u001B[32m1\u001B[39m] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings]\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:39\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 36\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + escape(first) + close_paren\n\u001B[32m 37\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;129;01mnot\u001B[39;00m first:\n\u001B[32m 38\u001B[39m \u001B[38;5;66;03m# print '-> first string empty'\u001B[39;00m\n\u001B[32m---> \u001B[39m\u001B[32m39\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \u001B[43mregex_opt_inner\u001B[49m\u001B[43m(\u001B[49m\u001B[43mstrings\u001B[49m\u001B[43m[\u001B[49m\u001B[32;43m1\u001B[39;49m\u001B[43m:\u001B[49m\u001B[43m]\u001B[49m\u001B[43m,\u001B[49m\u001B[43m \u001B[49m\u001B[33;43m'\u001B[39;49m\u001B[33;43m(?:\u001B[39;49m\u001B[33;43m'\u001B[39;49m\u001B[43m)\u001B[49m \\\n\u001B[32m 40\u001B[39m + \u001B[33m'\u001B[39m\u001B[33m?\u001B[39m\u001B[33m'\u001B[39m + close_paren\n\u001B[32m 41\u001B[39m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mlen\u001B[39m(first) == \u001B[32m1\u001B[39m:\n\u001B[32m 42\u001B[39m \u001B[38;5;66;03m# multiple one-char strings? make a charset\u001B[39;00m\n\u001B[32m 43\u001B[39m oneletter = []\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36mregex_opt_inner\u001B[39m\u001B[34m(strings, open_paren)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(regex_opt_inner(\u001B[38;5;28mlist\u001B[39m(group[\u001B[32m1\u001B[39m]), \u001B[33m'\u001B[39m\u001B[33m'\u001B[39m)\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[36mFile \u001B[39m\u001B[32m~\\PycharmProjects\\Final_Assignment\\.venv\\Lib\\site-packages\\pygments\\regexopt.py:77\u001B[39m, in \u001B[36m\u001B[39m\u001B[34m(.0)\u001B[39m\n\u001B[32m 71\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren \\\n\u001B[32m 72\u001B[39m + regex_opt_inner(\u001B[38;5;28msorted\u001B[39m(s[:-slen] \u001B[38;5;28;01mfor\u001B[39;00m s \u001B[38;5;129;01min\u001B[39;00m strings), \u001B[33m'\u001B[39m\u001B[33m(?:\u001B[39m\u001B[33m'\u001B[39m) \\\n\u001B[32m 73\u001B[39m + escape(suffix[::-\u001B[32m1\u001B[39m]) + close_paren\n\u001B[32m 74\u001B[39m \u001B[38;5;66;03m# recurse on common 1-string prefixes\u001B[39;00m\n\u001B[32m 75\u001B[39m \u001B[38;5;66;03m# print '-> last resort'\u001B[39;00m\n\u001B[32m 76\u001B[39m \u001B[38;5;28;01mreturn\u001B[39;00m open_paren + \\\n\u001B[32m---> \u001B[39m\u001B[32m77\u001B[39m \u001B[33m'\u001B[39m\u001B[33m|\u001B[39m\u001B[33m'\u001B[39m.join(regex_opt_inner(\u001B[38;5;28mlist\u001B[39m(group[\u001B[32m1\u001B[39m]), \u001B[33m'\u001B[39m\u001B[33m'\u001B[39m)\n\u001B[32m 78\u001B[39m \u001B[38;5;28;01mfor\u001B[39;00m group \u001B[38;5;129;01min\u001B[39;00m groupby(strings, \u001B[38;5;28;01mlambda\u001B[39;00m s: s[\u001B[32m0\u001B[39m] == first[\u001B[32m0\u001B[39m])) \\\n\u001B[32m 79\u001B[39m + close_paren\n", "\u001B[31mKeyboardInterrupt\u001B[39m: " ] } ], "execution_count": 1 }, { "metadata": {}, "cell_type": "code", "source": "search_docs = TavilySearchResults(max_results=3).invoke({'query': 'Friedrich Merz birthday'})", "id": "bf74512499009afd", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "serialized = \"\\n\\n\".join(\n", " (f\"\\nContent:\\n{search_docs.page_content}\")\n", " for doc in docs\n", " )\n", "serialized" ], "id": "a0c1339790a66002", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "search_docs = TavilySearchResults(max_results=3).invoke({'query': 'Friedrich Merz birthday'})\n", "id": "bdab71ec26eaadc0", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "for doc in search_docs:\n", " # print(f'Titel: {doc[\"title\"]}\\nContent: {doc[\"content\"]}')\n", " print(doc[\"url\"])" ], "id": "8a438fd3c32aec47", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": [ "formatted_search_docs = \"\\n\\n---\\n\\n\".join(\n", " [\n", " f'URL: {doc[\"url\"]}\\nTitle= {doc[\"title\"]}\\nContent: {doc[\"content\"]}'\n", " for doc in search_docs\n", " ])" ], "id": "ddc6663672322015", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "formatted_search_docs", "id": "ab516e3c391c5d6d", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "code", "source": "", "id": "5130c97cec9d8740", "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "markdown", "source": "# Youtube Tool", "id": "182a8f232f820d75" }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.685934Z", "start_time": "2025-04-30T12:15:55.581450Z" } }, "cell_type": "code", "source": [ "# %pip install --upgrade --quiet youtube-transcript-api\n", "from langchain_community.document_loaders import YoutubeLoader" ], "id": "3f9e10b56a2a57b9", "outputs": [], "execution_count": 1 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.687032Z", "start_time": "2025-04-30T11:59:06.756631Z" } }, "cell_type": "code", "source": "%pip install --upgrade --quiet youtube-transcript-api", "id": "ba6ab7c2464488f1", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Note: you may need to restart the kernel to use updated packages.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n", "[notice] A new release of pip is available: 23.2.1 -> 25.0.1\n", "[notice] To update, run: python.exe -m pip install --upgrade pip\n" ] } ], "execution_count": 3 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.688006Z", "start_time": "2025-04-30T12:15:59.476620Z" } }, "cell_type": "code", "source": [ "loader = YoutubeLoader.from_youtube_url(\n", " \"https://www.youtube.com/watch?v=Q56PMJbCFXQ\", add_video_info=False\n", ")" ], "id": "b9b299cb93c7fb79", "outputs": [], "execution_count": 2 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.688887Z", "start_time": "2025-04-30T12:24:33.059987Z" } }, "cell_type": "code", "source": [ "docs = loader.load()\n", "transcript = \"\\n\\n\".join(\n", " (f\"\\nContent:\\n{doc.page_content}\")\n", " for doc in docs\n", " )\n", "print(transcript)" ], "id": "f2f71b18ad1e73c3", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Content:\n", "This is Citicorp Center. In the summer of 1978, it had been open for less than a year when its structural\n", "engineer, Bill LeMessurier, made a terrifying discovery. His cutting edge skyscraper,\n", "an engineering marvel had a fatal flaw. Winds of just 110 kilometers per hour could cause it to collapse\n", "in the middle of Manhattan, potentially killing thousands. Over 200,000 people lived and worked in the surrounding area, and hurricane season was only weeks away. Here I am, the only man\n", "in the world who knew this. This thing is in real trouble. LeMessurier\n", "faced a stark choice. He could stay silent\n", "and hope for the best, or he could try to fix it and risk professional ruin and mass panic. But Citicorp Center had a 100% probability of total collapse by\n", "the end of the century. How could he save New York\n", "from a near certain disaster? And how was this allowed\n", "in the first place? Veritasium producer and\n", "engineer, Henry van Dyck, traveled to New York\n", "to investigate further. So in the 1960s, the\n", "financial giant, Citicorp, was trying to build a new\n", "headquarters in Manhattan. So just down the street from\n", "their original headquarters was this entire city block,\n", "which was up for sale. Well, everything except for\n", "this church, Saint Peter's. So Citicorp came to the\n", "pastor, Ralph Peterson, and asked, \"What's it gonna\n", "take for you guys to leave?\" And he came back and\n", "said, \"We're not leaving. Anything that Citicorp builds has to involve the church as part of it.\" What the pastor wanted was for the church to have its own separate identity. So eventually they agreed on two things. One was to replace this\n", "old crumbling gothic church with a brand new one, which\n", "you see in front of you. And the second thing was that the church had to be physically\n", "distinct from the new tower. In other words, it had to\n", "be completely independent. And again, most importantly,\n", "two thirds of the space above the church had to be\n", "free and clear, had to be open. Citicorp then\n", "hired architect Hugh Stubbins to design the tower and the church and Bill LeMessurier as\n", "the structural engineer, Stubbins explained the\n", "constraints they faced. The church needed to be\n", "in the exact same spot and they needed to build\n", "the tower around it. If they were to maximize the\n", "floor area, they would have to notch out one corner of\n", "the tower for the church. LeMessurier agreed that could work, but why not notch two, three,\n", "or even all four corners, essentially constructing\n", "the skyscraper on stilts. So it's probably the\n", "first time in history that an engineer has come\n", "to an architect and said, \"Let's make our job harder for us.\" The stilts would\n", "serve two main purposes. First, they would need\n", "to support at least half of the building's gravity load. The rest would be held up\n", "by a larger central column. Second, they would need\n", "to withstand the load due to high winds. But unlike an ordinary structure, the stilts wouldn't be at the corners. They would be at the center of each face. Imagine a chair, and\n", "instead of the columns or the supports on each\n", "corner of the chair, it's at the midpoint of each side. Obviously, it's not an ideal situation. It doesn't seem very stable. Exactly. So it created\n", "an engineering problem. As LeMessurier\n", "considered the problem, he suddenly had a flash of inspiration. He grabbed a napkin and\n", "sketched out an idea. He drew six layers of diagonal braces up\n", "each face of the tower. These chevrons would transfer\n", "the forces to the middle of each face and down to the stilts. Now we have to see the\n", "gravity loads, right? But now here's the trick. The gravity loads are\n", "coming down the column. When they get to the brace, they need to find their\n", "way into the brace. Okay.\n", "So what you do is you take out that column right there. There is no way that load can jump over and go to that column. And now they're coming\n", "down into the braces. They get down to the bottom here, and now they continue to go down. You take that column out, it has nowhere to go\n", "except into the brace. By removing the columns at the top and middle of each chevron, every tier acted as a separate unit. They were only connected to the braces and through the central core. So every eight stories,\n", "half of the gravity load would be forced through the chevrons to the midface columns,\n", "leading down to the stilts. Can you tell me how big\n", "of a new idea was this? Yeah, well, this particular\n", "system was entirely unique, driven by the placement of the columns, driven by the conditions of the building. As satisfied the chevrons\n", "could transfer the gravity load, LeMessurier turned his\n", "attention to the second problem, the wind. When wind hits the left\n", "side of a normal building with corner columns, the\n", "entire frame deforms like this. So to reduce this deformation, we could strengthen these\n", "joints, but there's a better way because beams and columns are\n", "much stronger in compression or tension than they\n", "are with bending loads. So if we add diagonal bracing, they can carry this horizontal load. The beams sort of act like springs, and when they're compressed,\n", "they push on the joints. When they're stretched, they pull inwards. With braces like these, the wind load compresses this diagonal and stretches this one. The left column pulls down in tension and the right column\n", "pushes up in compression. Where the braces meet, they both push the\n", "bottom beam to the right. This stretches the left side\n", "and compresses the right one. But this floor is the\n", "top of the next chevron, so this lower section\n", "is carrying the force from the layer above it and the normal wind load from the side. And this keeps happening at every chevron so the wind load builds up\n", "as you go down the building. But Citicorp can't have\n", "corner columns like this because of the gravity load. So in the wind, this entire triangle wants to rotate like this and to prevent that from happening, this chevron pulls down going into tension and the far chevron\n", "pushes up in compression. The top and bottom beams are again forced into\n", "compression and tension. The wind load ends up wrapping\n", "around the entire building. So every chevron works\n", "to transfer the wind load to the section below. When we think about skyscrapers, like how big of a deal is wind? If we made a skyscraper here, you know, out of all these different\n", "things, you push with your phone, you get a certain amount of force, but then you push on my phone as well with a certain amount of force, but your phone is also\n", "pushing on my phone. And so that's the shear in the building, what we call the building shear. It increases as you go down the building. You know, at the 10th floor, you may have a smaller force\n", "than at the 60th floor, but the total force of the 10th floor is like carrying everything above it. So it's much bigger than what's\n", "going on on the 60th floor. So these chevrons were key to LeMessurier's design, but the braces were massive, almost 40 meters long end to end. So even if you could fabricate\n", "a steel brace that long, there would be no way to\n", "get it through Manhattan. So instead it was sent in pieces to be welded together on site. The chevron bracing solved the\n", "wind and gravity load issues, but it also created a different problem. Because of the chevron bracing system, they were able to save a\n", "lot of money and weight. It was a lighter construct\n", "than most other buildings in New York, I think it was\n", "22 pounds a square foot, which is very light. Unfortunately, that made\n", "the building swayable, it could move in the wind. That wasn't necessarily a\n", "structural problem, it was just, it could have been\n", "uncomfortable for the patrons. The way they could solve this was just let's add more structural steel\n", "and make it a lot stiffer. But the solution that\n", "LeMessurier came up with was far more elegant. He adopted something that\n", "had been regularly used in bridges, power lines and ships, but never before in a building:\n", "a tuned mass damper or TMD. So we're here at Stark Laboratories, and I'm not with Iron Man, but instead the Columbia Space Initiative, the student team here on\n", "campus who has helped us build this incredible tuned mass\n", "damper kind of system. We'll use this cart to\n", "represent a building. By pulling it back and releasing it, we can excite its resonant frequency, And then we'll put on a\n", "little pendulum, aluminum rod, and a mass at the bottom. As the building sways, it transfers some of its\n", "kinetic energy to the pendulum, which starts to swing. Then some of its energy is\n", "dissipated through friction at the hinge. The pendulum and the building oscillate out of phase from each other. So every time the building\n", "pulls the pendulum in a different direction,\n", "more energy is lost, significantly damping\n", "the sway of the tower. But this system needs\n", "to be carefully tuned so it has the same frequency\n", "as the building itself and the right amount of friction. So first, the mass needs\n", "to be at least one to 5% of the building's weight to be effective. And we tune the frequency of the TMD by adjusting the length of the pendulum. I assume engineers do\n", "math around this thing, but we're just doing it by feel. (both laugh) Second, by loosening\n", "or tightening the bolt, we can tune the amount of damping. We need to dissipate more energy\n", "from friction at the hinge to stop the swaying faster. We just tighten the top bolt, make the whole system a little bit, you know, add a little\n", "bit more resistance, and we'll see if we can\n", "dampen it now further. Woohoo.\n", "Much different. Yeah. Yeah, that looked\n", "great. That was so quick. Yeah, that was. It is cool when an experiment works. Does not always happen. There are many\n", "different types of TMDs, like pendulums, liquid columns,\n", "and a large mass on springs. LeMessurier used this\n", "last one in Citicorp. What you see\n", "is a mass of concrete, which is 29 feet square\n", "and about eight feet thick and weighs 400 tons. It was installed on the top floor and it's affectionately known\n", "as that great block of cheese. As Citicorp sways to one side, the block starts to move\n", "in the same direction. Some energy is dissipated\n", "through separate viscous dampers. Citicorp's oscillations are damped through those energy losses\n", "as the block oscillates out of phase to the building's motion. LeMessurier expected the\n", "damper to reduce the amplitude of swaying by roughly 50%, and he saved around $4 million by not needing an additional\n", "2,800 tons of structural steel. With both the chevron bracing to channel forces to the stilts and the tuned mass damper to reduce sway, LeMessurier was convinced the building was structurally sound. On Citicorp Center's opening day in 1977, it was the 11th tallest\n", "building in the world. It was described by the press as an acrobatic act of architecture. Later, the American\n", "Institute of Architects even gave it an honor award,\n", "calling it a tour de force as a stylish silhouette in the skyline, and, for the pedestrian, a\n", "hovering cantilevered hulk. So then, it's going\n", "swimmingly for years, right? Well, it's going\n", "swimmingly for about a year. The first hint of\n", "trouble came in May, 1978. LeMessurier was talking\n", "with another client about welding similar chevron braces. The architect and the\n", "steel fabricator said, \"Tell me, how did those\n", "welded braces work out?\" Seems like overkill, they thought. And LeMessurier says,\n", "\"Yeah, they were fine. Let me call my guys in\n", "New York and I'll check.\" So he put the call into\n", "his office in New York and they say, \"Oh, Bill, didn't you know? We bolted those connections.\" The contractor\n", "had suggested saving a quarter of a million\n", "dollars by using bolts to attach the braces instead of welds. And LeMessurier's firm had agreed. There is nothing that\n", "says a bolt is inherently worse or better than a weld. You use them in different circumstances for different reasons, but it's a little surprising to find out, I thought the connections\n", "in this tour de force, one of a kind skyscraper, you know, that's on the cutting edge\n", "of structural engineering, was connected one way, but apparently it's connected another way. But if the braces are going like this, where are they gonna go? You know, you only need the weld when the braces are going like this. Since the gravity load was always compressing the\n", "braces, some of the chevrons only went into tension\n", "under very high winds. And even then, it wasn't a lot of tension. LeMessurier trusted that his team did the right calculations,\n", "and the substitution was fine, logical, even. (phone ringing) But around a month later, LeMessurier got a phone\n", "call from a student who wanted to ask some questions\n", "about the Citicorp Center. And his teacher said to him, \"That engineer didn't know what he's doing and nobody should put the\n", "columns in the middle. They should put 'em in the\n", "corners. That's silly.\" And I told the student, I said, \"Well, you're a professor's full of it. He doesn't understand the\n", "problem we had to solve.\" LeMessurier went\n", "through the calculations with the student to reassure him the stilts\n", "were in the right place. But the interesting thing\n", "is, is in that moment, he's thinking about wind\n", "loads from all directions. You know, late spring,\n", "early summer of 1978, Bill LeMessurier is working\n", "on the back of a Hilton Hotel that, in plan, forms a\n", "triangle, not a rectangle. Now you got a triangle. What's\n", "your orthogonal direction? You just have to give up and say, \"We're gonna analyze it\n", "from every direction.\" That's going on the moment\n", "that Bill LeMessurier gets this phone call. Then I called him back\n", "and pointed it out to him that there's some peculiar\n", "things about this building. The worst loading case\n", "was not the diagonal, but it was the ordinary wind\n", "that everybody thinks about. The wind pushes straight on the building. That was the critical case. He said, you know what, I've been getting all these\n", "calls from all these people. I'm gonna sit down and explain this thing. He decided to double check what happens to the\n", "building if wind is hitting a corner of the building, not\n", "straight on one of the faces. These are also known as quartering winds. So he split the wind into\n", "its perpendicular components. So the west side and north\n", "side are hit by the force divided by the square root of two. He computed the forces for\n", "each, as we did before, and summed up the result, but then he noticed something strange. Then now we\n", "look at the diagonals, the stresses in half of them vanish, and in the other half, double. Since the force on each side was F over the square root of two, these beams get double that. Compared to LeMessurier calculations for the perpendicular wind load, the forces here were 40% higher. So 1.4 by itself is not\n", "enough to wreck havoc. Okay? It may be, but it may not be. Okay.\n", "So then the question is, well, what happens? This increase in\n", "forces wouldn't have mattered in the original design since the chevrons were\n", "fully welded together. But that wasn't the case anymore. LeMessurier remembered\n", "his earlier phone call. The welds holding the chevrons together were swapped for bolts. How did his team calculate\n", "the number of bolts per joint? Did they consider quartering winds? It would be a miracle if\n", "they ever thought that through, to think about the diagonal wind. It just wasn't in the nature of anybody. So I had a bit of a worry. I didn't panic right away, but I decided to go down\n", "to New York to my office. LeMessurier\n", "requested the building diagrams and poured over all of the connections. He looked at how his firm\n", "calculated the number of bolts. There was no question, they\n", "had taken straight on wind, not the diagonal wind. Although wind speed is highest at the top of the tower, the wind shear builds up as you go lower. Looking at this brace around\n", "halfway down the tower, the perpendicular wind load is 454 tons. Because of the skipped columns, all of these braces carry\n", "the same gravity load, just 340 tons, from the\n", "eight stories above. The gravity load builds\n", "up in the center column, not in the braces, which means there are 114\n", "tons of tension in this brace. If each bolt can withstand around 28 tons, that would require four bolts. The original calculations said\n", "just four bolts were enough. So that was all they used. But when he added quartering winds, LeMessurier's calculations\n", "showed there were some braces that needed far more bolts. At this particular part of the building, which I can show you on my\n", "calculations is right about here, and Bill LeMessurier talked\n", "about the 30th floor, and I always wondered why\n", "was it the 30th floor? The 40% increase\n", "from quartering winds means that this brace has\n", "a wind load of 635 tons. The tension in the brace is now 295 tons, over double the original calculation. So these braces actually need\n", "around 10 bolts, not four. But then it turned out\n", "they had done something else. LeMessurier's\n", "firm considered the braces to be minor structural elements. They didn't use the right factor of safety to calculate the number of bolts. They should have overestimated\n", "the tension in the brace by underestimating the gravity load. With only 75% of the gravity load, the tension in the beam is now 380 tons. So they really needed 14\n", "bolts, but they used only four. I thought this\n", "thing is in real trouble. Imagine, you know, what Bill LeMessurier was\n", "thinking at that moment. You see that number and you're like, \"Oh my God, this is serious.\n", "It's really serious.\" LeMessurier\n", "was starting to panic. He didn't wanna rush to conclusions, so he flew to Canada to\n", "check his calculations with Alan Davenport at the\n", "Boundary Layer Wind Tunnel. After running more tests, they found that it was even\n", "worse than LeMessurier thought. The estimated 40% increase in stress was technically correct, but LeMessurier made his calculations assuming the building wasn't moving. This is called static conditions. But the wind tunnel gave\n", "LeMessurier a dynamic analysis, how the forces change when\n", "the building is moving around. To LeMessurier's horror,\n", "the wind tunnel analysis showed that the stresses could increase up to 60% more than\n", "originally anticipated. LeMessurier squirreled\n", "himself away in Maine and worked through the data\n", "from the wind tunnel again, joint by joint on every floor. The weakest joints were at\n", "the building's 30th floor. If those failed, the\n", "entire building would fall. But what were the chances\n", "that a storm strong enough to topple the building would\n", "pass through New York City? LeMessurier dug through the\n", "historical weather reports. On average, a storm strong\n", "enough to tear the building apart occurred every 67 years. But only if the tuned\n", "mass damper was working. If a storm knocked out power, then even 110 kilometer per hour winds blowing for just five minutes\n", "would collapse the building. In any given year, the chance of a storm that\n", "size happening was one in 16. Just one year before\n", "Citicorp was completed, wind gusts of 110 kilometers per hour roared through New York City as Hurricane Belle passed through. What do you think this moment\n", "was like for LeMessurier, when he ran these calculations, like- Oh, it must have been devastating. I mean, it just must have\n", "been, I can't imagine the fear. I can't imagine the feelings. I mean, like, it just must have been truly a moment he never thought\n", "he would live through. That storm was gonna\n", "fall down in my lifetime. And since this was July, it could fall down the summer of 1978. LeMessurier needed to\n", "decide and decide fast. But revealing this mistake\n", "could mean lawsuits, bankruptcy and professional ruin. He could stay silent, only Davenport knew and he\n", "wouldn't reveal anything, or he could entirely disappear. In a later interview he\n", "admitted, \"I did say to myself, I could drive down the Maine Turnpike at a hundred miles an hour and deliberately drive\n", "into a bridge abutment. That would be the end and\n", "all of this would go away. I thought about that.\" But there was a 1 in 16 chance\n", "of collapse that very fall. With thousands of lives at risk, there was never any\n", "other choice but to act. After speaking to a few lawyers and other engineering experts, LeMessurier told the architect,\n", "Stubbins, and together they informed Citicorp's\n", "chairman, Walter Wriston. Within hours of that meeting, LeMessurier acquired emergency generators for the tuned mass damper. The TMD was originally\n", "designed to stabilize any swaying for comfort,\n", "but now it became the crutch that the tower leaned on. LeMessurier pinned all his hopes on it. He called the confidential\n", "repair plan Project Pandora, but that sounded ominous, so he came up with the\n", "Special Engineering Review of Events Nobody Envisioned,\n", "or Project Serene for short. Each night, welders\n", "would enter the building after everyone left,\n", "rip off the sheet rock around the chevron beams, and then weld two five-centimeter thick, two-meter long steel plates on each joint. Like Band-Aids, literally Band-Aids, on both sides of these joints. After, they'd replaced the wall and clean everything up\n", "before the office workers came back the next morning, They needed to weld over 200 joints and LeMessurier ranked them by importance, starting with the ones on the 30th floor. But the repairs wouldn't be completed before hurricane season. So Citicorp worked with the Red Cross to develop a 10 block evacuation plan. Like, how many people\n", "were at risk in the building and if it fell, would it\n", "affect other buildings? Like, were there chances of it leading to something more disastrous? Absolutely, this would have toppled and it would've toppled\n", "into another building, which would've toppled\n", "into another building, which would've continued\n", "a horrific process. So it was untold what the\n", "ultimate effects could have been. I mean, like,\n", "just the evacuation plans were how many people? Thousands, the building\n", "itself housed thousands and then the residents and the businesses surrounding the building,\n", "it was into the thousands. Despite the risk, they decided not to tell the public or even the office\n", "workers in the building. No one wanted a mass panic. Instead, they fitted strain gauges on important structural members. The gauges monitored the\n", "skyscrapers every bend and twist from a comm center eight blocks away. At least that would give\n", "them a little bit of warning. But this plan required new telephone lines, and the phone company wouldn't get around to doing this for months. So Citicorp's chairman immediately called AT&T's president and the lines were\n", "installed the next morning. Now you might not be able to install emergency telephone lines at a whim, but you can still stay\n", "connected no matter what. (phone ringing) It's probably not that important. Henry, can you hear me? Hello! Team Veritasium travels all\n", "over the globe for our videos We traveled here to New York\n", "to visit the Citicorp Center, and there's one really annoying problem. It's hard to stay connected\n", "with the rest of the team while we're on site. We either have to pay\n", "ridiculous roaming charges, find a local SIM card and\n", "hope it actually works, or search around for public Wi-Fi that might not be the most secure. That's not something we\n", "wanna be dealing with while making a video. So Saily makes it incredibly\n", "easy and affordable to stay connected while abroad. Download it once and use\n", "it in over 180 countries. You choose how much data\n", "you want and for how long. It's much cheaper than roaming\n", "and super quick to set up. I just select the country and plan, then activate the e-SIM before\n", "I take off and I'm done. Then when I land, I'll\n", "automatically connect to a local network with no hidden charges and be able to do the important things, like access maps, book\n", "a car or call your boss. So if you've got travel plans coming up, scan this QR code to download the app. Choose a plan in the\n", "country you're going to and, here's the important thing, use our code, Veritasium, at checkout to get an exclusive 15%\n", "off your first purchase. Again, check out with code, Veritasium, and get connected no matter where you are. Thank you Saily for sponsoring this video. And now back to Project Serene. (phone ringing) (sighs) I mean, should probably take this. (phone beeps) But even though LeMessurier tried to keep Project Serene under wraps, people started asking questions. On August 8th, Citicorp\n", "released a statement about the repairs. Now, we had to cook up a\n", "line of bull, I'll tell you. And white lies at this\n", "point are entirely moral. (class laughs)\n", "You don't wanna spread terror in the community to people that\n", "don't need to be terrorized. We were terrorized, no\n", "question about that. Several\n", "newspapers reported on it, but they didn't have the details. Then LeMessurier got a message. The New York Times\n", "was trying to reach him. If he didn't respond, they\n", "would know something was up. So I mixed a martini for myself and it's one minute past six. I dialed The New York Times. I pick it up the phone,\n", "they pick up the phone, it's a tape recorder saying, The New York Times has gone\n", "on strike as of six o'clock. (class laughs) Not only did The New\n", "York Times go on strike, but all the newspapers in\n", "New York went on strike until October. So we had a press blackout and that was the greatest\n", "thing that ever happened. (class laughs) The press was off their back and the weather was beautiful. The repair work continued smoothly. But late August brought the\n", "news everyone had been dreading. Hurricane Ella starts\n", "brewing in the Caribbean. And this is the one storm\n", "that they're nervous about. The repairs\n", "were halfway done by now. I think it was a one in 200 year storm that it could withstand, but LeMessurier wasn't taking chances 'cause he didn't know the\n", "intensity of the storm. And this was a strong storm. So there was, there was a chance. There was absolutely a chance and they had to prepare for that chance. By Friday, September 1st, Ella was making her way toward New York, with winds reaching 200\n", "kilometers per hour. City officials braced\n", "to start the evacuation. Police would go door to\n", "door to get everyone out within a 10 block radius. For 24 tense hours, Ella\n", "stalled around North Carolina. Like LeMessurier said,\n", "we were sweating blood. But sometime in the night, Hurricane Ella veered off into\n", "the sea at the last minute. It intensified and hit Canada with peak winds of 225\n", "kilometers per hour. But Citicorp was safe. LeMessurier described that\n", "next morning in New York as the most beautiful day\n", "that the world's ever seen. They completed the repairs in October, just six weeks after\n", "LeMessurier told Citicorp. Now the building,\n", "according to LeMessurier, can withstand a one in 1000 storm. The repairs cost\n", "between $4 and $5 million, but LeMessurier argued\n", "that Citicorp approved an earlier building design\n", "that cost $5 to $6 million more, so they were willing to spend that much on the skyscraper anyway. And for almost two decades, the secret was confined\n", "to a small inner circle. But in 1995, \"The New Yorker\" finally brought Project\n", "Serene into the light. Far from being vilified, LeMessurier was praised for owning up to his mistake and fixing the issue as soon as possible. After the article, New\n", "York updated the building code to require quartering wind calculations. And since that\n", "first damper in Citicorp, TMDs have spread across the globe. allowing architects to push\n", "skyscrapers taller and slimmer. It's in the first tall\n", "building in the world ever built with mechanical help\n", "to make the structure work. That's remarkable. Incidentally, that has been now copied a hundred times in Japan,\n", "this is ubiquitous, and when I go to Japan,\n", "I'm treated like a tin god 'cause I'm the father of\n", "the tuned mass damper. I said, \"Really?\" Of the 20 tallest\n", "buildings in the world, six include the tuned mass damper, and they're especially critical in typhoon or earthquake-prone regions. For example, Taipei 101 has\n", "a massive 660 ton pendulum that stabilizes the building. It can withstand up to 200\n", "kilometer per hour winds and earthquakes with magnitudes over 6.8. But the legacy of this building is still steeped in controversy. First, who was the mysterious\n", "student that started it all? I think it was spring of 1978. There's a student at Princeton,\n", "an undergraduate student by the name of Diane Hartley, and she's studying structural engineering. It was time for her to\n", "consider a senior thesis, and then they decided that a study of the new Citicorp\n", "Tower would be wonderful. It's a remarkable thesis. It contains a lot of the\n", "original engineering calculations by the engineers. She's looking through the documentation, where did they consider quartering winds? And she's not seeing it\n", "\"I must be wrong,\" she says. She's just an undergraduate student and you guys are award-winning\n", "structural engineers. The engineer explains to Diane Hartley, quartering winds are not\n", "a factor in this building. So she's satisfied. She\n", "graduates, that's it. Doesn't think about it again. But a year after \"The\n", "New Yorker\" article, the BBC released a\n", "documentary on the crisis. And so she, she was holding her baby and she turned on the\n", "television, and lo and behold, she heard them reference a\n", "conversation with a student, an engineering student from New Jersey reaching out to LeMessurier. And she said, \"I almost\n", "dropped my baby.\" And then so she just assumed\n", "for years afterwards, she assumed that it wasn't me because I didn't speak to LeMessurier. But then in 2003,\n", "her thesis advisor told Diane that he checked all the\n", "other New Jersey engineering and architecture programs, and no one else was working on a project\n", "about Citicorp in 1978. She was the only one. She never spoke to\n", "LeMessurier personally. She never claimed to speak\n", "to LeMessurier personally. The assumption was that either\n", "LeMessurier was mistaken and that it was Diane\n", "Hartley who made the call, it was a female, or more likely that LeMessurier was basically tipped off by his New York engineers. Then, in 2011, a man named Lee DeCarolis came forward. And the phone call, as we understand it, came from a student at the New Jersey Institute of Technology. His name is Lee DeCarolis. He's not asking for money, he's not asking for fame or glory. He's just saying, \"This is interesting. And I'm the guy who made this call.\" And he said, \"Yeah, I had a conversation\n", "with Bill LeMessurier.\" And he pretty much lined up with what LeMessurier himself said. Sadly, LeMessurier\n", "passed away in 2007 before he could confirm\n", "the student's identity. Believe it or not, 40\n", "years later, there's still, I learned, a lot of raw\n", "feeling still on this. People aren't anxious to talk about this, especially people that\n", "were involved in it, even people that weren't involved in it but were tangentially involved in it. We reached out to a\n", "LeMessurier Associates and they refused to\n", "respond to our request. You think that the namesake\n", "for their company stood up and did the right thing, but I don't think they wanna\n", "be associated with mistakes. Their project\n", "description for Citicorp doesn't even mention the repairs. The building was sold to\n", "Boston Properties in 2001, who renamed it 601 Lexington. They also didn't respond\n", "to our request for comment and refused to let us\n", "film inside the building. Further questions arose\n", "in 2021, with a new study from the National Institute\n", "of Standards and Technology. They wanted to see if quartering\n", "winds were more demanding for a building like Citicorp, Although they did conclude that the pressure from\n", "perpendicular winds was greater, their analysis didn't include\n", "any internal structure specific to Citicorp. As for LeMessurier,\n", "the engineering field still regards his actions as upstanding. And the Citicorp case is\n", "taught all over the world as a case of good engineering ethics. In fact, in my own\n", "engineering ethics course, I learned about the Citicorp building. And every structural\n", "engineer experiences this. When you actually feel the\n", "weight of the responsibility, you're saying, \"Based on my engineering, that building is gonna stand up.\" Nobody else worries about it. And so if you think about\n", "the emotional pressure that Bill LeMessurier was under and then needing to come back\n", "and do something about it and to mobilize and to hold\n", "that during this entire process, it's truly a remarkable story. I mean, I can't imagine\n", "it. I can't imagine it. I said, look, if you got\n", "a license from the state and a certification from university first, then now you're gonna use that license to hold yourself out as a professional, you have a responsibility beyond yourself. If you see something\n", "that is a social risk, good heavens, this thing\n", "would kill thousands, you must do something,\n", "you must do something.\n" ] } ], "execution_count": 13 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.690452Z", "start_time": "2025-04-30T12:27:19.741664Z" } }, "cell_type": "code", "source": "res = graph.invoke({\"messages\": [HumanMessage(content=\"Examine the video at https://www.youtube.com/watch?v=1htKBjuUWec. What does Teal'c say in response to the question \"\"Isn't that hot?\"),]})", "id": "635cd683f3ff1354", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "-------------------- Starting to create a plan --------------------\n", "\n", "The plan is: 1. Watch the video at the provided URL.\n", "2. Identify the moment when someone asks, \"Isn't that hot?\"\n", "3. Note Teal'c's immediate response to that question.\n", "4. Write down Teal'c's exact response.\n", "\n", "-------------------- Agent has been called -----------------------------------\n", "\n", "Waiting for 5 seconds...\n", "Agent has made a decision:\n", " [{'name': 'youtube_transcript', 'args': {'url': 'https://www.youtube.com/watch?v=1htKBjuUWec'}, 'id': 'f3ea2c05-bca3-4186-b96d-dffd51b6857a', 'type': 'tool_call'}]\n", "\n", "-------------------- Decision of forwarding has been made --------------------\n", "\n", "This is round: 2\n", "The last message is: content='' additional_kwargs={'function_call': {'name': 'youtube_transcript', 'arguments': '{\"url\": \"https://www.youtube.com/watch?v=1htKBjuUWec\"}'}} response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings': []}, 'finish_reason': 'STOP', 'model_name': 'gemini-2.0-flash', 'safety_ratings': []} id='run-6dcf8097-fe72-4906-bc96-dd92fed51918-0' tool_calls=[{'name': 'youtube_transcript', 'args': {'url': 'https://www.youtube.com/watch?v=1htKBjuUWec'}, 'id': 'f3ea2c05-bca3-4186-b96d-dffd51b6857a', 'type': 'tool_call'}] usage_metadata={'input_tokens': 594, 'output_tokens': 22, 'total_tokens': 616, 'input_token_details': {'cache_read': 0}}\n", "\n", "-------------------- Tool (YouTube Transcript) has been called --------------------\n", "\n", "\n", "-------------------- Agent has been called -----------------------------------\n", "\n", "Waiting for 5 seconds...\n", "Agent has made a decision:\n", " extremely []\n", "\n", "-------------------- Decision of forwarding has been made --------------------\n", "\n", "This is round: 3\n", "The last message is: content='extremely' additional_kwargs={} response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings': []}, 'finish_reason': 'STOP', 'model_name': 'gemini-2.0-flash', 'safety_ratings': []} id='run-9e51af7f-3cf6-4bed-ae36-1797f60a652a-0' usage_metadata={'input_tokens': 665, 'output_tokens': 2, 'total_tokens': 667, 'input_token_details': {'cache_read': 0}}\n", "\n", "-------------------- Generating Answer -----------------------------------\n", "\n", "Waiting for 5 seconds...\n", "The final answer is: extremely\n" ] } ], "execution_count": 2 }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": "", "id": "993e1e7a8ec05fff" }, { "metadata": {}, "cell_type": "markdown", "source": "# Assembly AI", "id": "6df1762bcce7593e" }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.691455Z", "start_time": "2025-04-30T12:55:07.155179Z" } }, "cell_type": "code", "source": [ "import requests\n", "from langchain_community.document_loaders import AssemblyAIAudioTranscriptLoader\n", "import assemblyai as aai\n", "import tempfile\n", "import os\n", "from dotenv import load_dotenv\n", "\n", "load_dotenv()\n" ], "id": "e27e107d54b381df", "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 15 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.692386Z", "start_time": "2025-04-30T12:40:16.914256Z" } }, "cell_type": "code", "source": [ "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3\"\n", "\n", "qs = requests.get(f\"{url}/questions\").json()\n", "\n", "file = requests.get(f\"{url}/files/{task_id}\").content\n" ], "id": "aac5535533ce0799", "outputs": [], "execution_count": 6 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.693236Z", "start_time": "2025-04-30T12:46:33.146187Z" } }, "cell_type": "code", "source": [ "# --- Dein Code zum Abrufen der Datei ---\n", "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3\"\n", "\n", "try:\n", " response = requests.get(f\"{url}/files/{task_id}\")\n", " response.raise_for_status() # Stellt sicher, dass der Request erfolgreich war (Status Code 2xx)\n", " mp3_content = response.content\n", "except requests.exceptions.RequestException as e:\n", " print(f\"Fehler beim Abrufen der MP3-Datei: {e}\")\n", " exit() # Beenden, wenn die Datei nicht geladen werden konnte" ], "id": "ee9a1a4c4697a386", "outputs": [], "execution_count": 9 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.694065Z", "start_time": "2025-04-30T12:56:06.012180Z" } }, "cell_type": "code", "source": [ "# --- Temporäre Datei erstellen und Bytes schreiben ---\n", "temp_file_path = None\n", "try:\n", " # Erstelle eine benannte temporäre Datei mit der Endung .mp3\n", " # delete=False sorgt dafür, dass die Datei nicht sofort gelöscht wird,\n", " # wenn der 'with'-Block verlassen wird. Wir löschen sie manuell.\n", " with tempfile.NamedTemporaryFile(suffix=\".mp3\", delete=False) as temp_audio_file:\n", " temp_audio_file.write(mp3_content)\n", " temp_file_path = temp_audio_file.name # Hol den Pfad zur temporären Datei\n", "\n", " print(f\"MP3-Inhalt wurde temporär gespeichert unter: {temp_file_path}\")\n", " aai.settings.api_key = os.environ[\"ASSEMBLYAI_API_KEY\"]\n", "\n", " loader = AssemblyAIAudioTranscriptLoader(file_path=temp_file_path)\n", "\n", " docs = loader.load()\n", "\n", "finally:\n", " # --- Temporäre Datei aufräumen ---\n", " if temp_file_path and os.path.exists(temp_file_path):\n", " print(f\"Lösche temporäre Datei: {temp_file_path}\")\n", " os.remove(temp_file_path)" ], "id": "55017338ea90f3a", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "MP3-Inhalt wurde temporär gespeichert unter: C:\\Users\\DENNIS~1.BIN\\AppData\\Local\\Temp\\tmp9hggjvry.mp3\n", "Lösche temporäre Datei: C:\\Users\\DENNIS~1.BIN\\AppData\\Local\\Temp\\tmp9hggjvry.mp3\n" ] } ], "execution_count": 17 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.694872Z", "start_time": "2025-04-30T12:57:50.885966Z" } }, "cell_type": "code", "source": [ "for doc in docs:\n", " print(doc.page_content)" ], "id": "51672ebf8ed917fb", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "In a saucepan, combine ripe strawberries, granulated sugar, freshly squeezed lemon juice and cornstarch. Cook the mixture over medium heat, stirring constantly, until it thickens to a smooth consistency. Remove from heat and stir in a dash of pure vanilla extract. Allow the strawberry pie filling to cool before using it as a delicious and fruity filling for your pie crust.\n" ] } ], "execution_count": 19 }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.695702Z", "start_time": "2025-04-30T13:03:39.945166Z" } }, "cell_type": "code", "source": "response.headers.get(\"Content-Type\")", "id": "cab3b9c717270399", "outputs": [ { "data": { "text/plain": [ "'audio/mpeg'" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 21 }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": "", "id": "61af75adbc305848" }, { "metadata": { "ExecuteTime": { "end_time": "2025-05-03T15:20:07.696589Z", "start_time": "2025-04-30T13:30:02.301925Z" } }, "cell_type": "code", "source": [ "question = \"\"\"Hi, I'm making a pie but I could use some help with my shopping list. I have everything I need for the crust, but I'm not sure about the filling. I got the recipe from my friend Aditi, but she left it as a voice memo and the speaker on my phone is buzzing so I can't quite make out what she's saying. Could you please listen to the recipe and list all of the ingredients that my friend described? I only want the ingredients for the filling, as I have everything I need to make my favorite pie crust. I've attached the recipe as Strawberry pie.mp3.\\n\\nIn your response, please only list the ingredients, not any measurements. So if the recipe calls for \"a pinch of salt\" or \"two cups of ripe strawberries\" the ingredients on the list would be \"salt\" and \"ripe strawberries\".\\n\\nPlease format your response as a comma separated list of ingredients. Also, please alphabetize the ingredients.\"\"\"\n", "\n", "\n", "url = \"https://agents-course-unit4-scoring.hf.space\"\n", "task_id = \"99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3\"\n", "\n", "content = requests.get(f\"{url}/files/{task_id}\").content\n", "\n", "\n", "load_dotenv()\n", "# --- Temporäre Datei erstellen und Bytes schreiben ---\n", "temp_file_path = None\n", "try:\n", " # Erstelle eine benannte temporäre Datei mit der Endung .mp3\n", " # delete=False sorgt dafür, dass die Datei nicht sofort gelöscht wird,\n", " # wenn der 'with'-Block verlassen wird. Wir löschen sie manuell.\n", " with tempfile.NamedTemporaryFile(suffix=\".mp3\", delete=False) as temp_audio_file:\n", " temp_audio_file.write(content)\n", " temp_file_path = temp_audio_file.name # Hol den Pfad zur temporären Datei\n", "\n", " print(f\"MP3-Inhalt wurde temporär gespeichert unter: {temp_file_path}\")\n", " aai.settings.api_key = os.environ[\"ASSEMBLYAI_API_KEY\"]\n", "\n", " loader = AssemblyAIAudioTranscriptLoader(file_path=temp_file_path)\n", "\n", " docs = loader.load()\n", " transcript = \"\\n\\n\".join(\n", " (f\"\\nTranscript:\\n{doc.page_content}\")\n", " for doc in docs\n", " )\n", " response = graph.invoke({\"messages\": [HumanMessage(content=question), HumanMessage(content=transcript),]})\n", "\n", "finally:\n", " # --- Temporäre Datei aufräumen ---\n", " if temp_file_path and os.path.exists(temp_file_path):\n", " print(f\"Lösche temporäre Datei: {temp_file_path}\")\n", " os.remove(temp_file_path)" ], "id": "577b57828fda080f", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "MP3-Inhalt wurde temporär gespeichert unter: C:\\Users\\DENNIS~1.BIN\\AppData\\Local\\Temp\\tmpwi8s8ny2.mp3\n", "\n", "-------------------- Starting to create a plan --------------------\n", "\n", "The plan is: 1. Extract the ingredients from the transcript.\n", "2. Remove any quantities or adjectives from the ingredients.\n", "3. Alphabetize the ingredients.\n", "4. Format the ingredients as a comma-separated list.\n", "\n", "-------------------- Agent has been called -----------------------------------\n", "\n", "Waiting for 5 seconds...\n", "Agent has made a decision:\n", " cornstarch, granulated sugar, lemon juice, ripe strawberries, vanilla extract []\n", "\n", "-------------------- Decision of forwarding has been made --------------------\n", "\n", "This is round: 2\n", "The last message is: content='cornstarch, granulated sugar, lemon juice, ripe strawberries, vanilla extract' additional_kwargs={} response_metadata={'prompt_feedback': {'block_reason': 0, 'safety_ratings': []}, 'finish_reason': 'STOP', 'model_name': 'gemini-2.0-flash', 'safety_ratings': []} id='run-5f798ac5-3001-4442-8b03-5cf6afedf416-0' usage_metadata={'input_tokens': 819, 'output_tokens': 15, 'total_tokens': 834, 'input_token_details': {'cache_read': 0}}\n", "\n", "-------------------- Generating Answer -----------------------------------\n", "\n", "Waiting for 5 seconds...\n", "The final answer is: cornstarch, granulated sugar, lemon juice, ripe strawberries, vanilla extract\n", "Lösche temporäre Datei: C:\\Users\\DENNIS~1.BIN\\AppData\\Local\\Temp\\tmpwi8s8ny2.mp3\n" ] } ], "execution_count": 22 }, { "metadata": {}, "cell_type": "code", "outputs": [], "execution_count": null, "source": "", "id": "172512566b7e69ad" } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 5 }