Spaces:
Build error
Build error
Commit ·
cd48814
1
Parent(s): 87e0ee4
test wiki search tool
Browse files- playground.ipynb +76 -7
- requirements.txt +4 -1
playground.ipynb
CHANGED
|
@@ -836,7 +836,7 @@
|
|
| 836 |
},
|
| 837 |
{
|
| 838 |
"cell_type": "code",
|
| 839 |
-
"execution_count":
|
| 840 |
"metadata": {},
|
| 841 |
"outputs": [],
|
| 842 |
"source": [
|
|
@@ -871,7 +871,7 @@
|
|
| 871 |
},
|
| 872 |
{
|
| 873 |
"cell_type": "code",
|
| 874 |
-
"execution_count":
|
| 875 |
"metadata": {},
|
| 876 |
"outputs": [
|
| 877 |
{
|
|
@@ -880,7 +880,7 @@
|
|
| 880 |
"'Working...\\nPlease wait patiently...\\n0\\n'"
|
| 881 |
]
|
| 882 |
},
|
| 883 |
-
"execution_count":
|
| 884 |
"metadata": {},
|
| 885 |
"output_type": "execute_result"
|
| 886 |
}
|
|
@@ -1008,7 +1008,7 @@
|
|
| 1008 |
},
|
| 1009 |
{
|
| 1010 |
"cell_type": "code",
|
| 1011 |
-
"execution_count":
|
| 1012 |
"metadata": {},
|
| 1013 |
"outputs": [],
|
| 1014 |
"source": [
|
|
@@ -1128,9 +1128,65 @@
|
|
| 1128 |
},
|
| 1129 |
{
|
| 1130 |
"cell_type": "code",
|
| 1131 |
-
"execution_count":
|
| 1132 |
"metadata": {},
|
| 1133 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1134 |
"source": [
|
| 1135 |
"def wiki_search(query: str) -> str:\n",
|
| 1136 |
" \"\"\"\n",
|
|
@@ -1147,8 +1203,21 @@
|
|
| 1147 |
" ]\n",
|
| 1148 |
" )\n",
|
| 1149 |
" except Exception as e:\n",
|
| 1150 |
-
" return f\"Error during Wikipedia search: {str(e)}\""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1151 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1152 |
}
|
| 1153 |
],
|
| 1154 |
"metadata": {
|
|
|
|
| 836 |
},
|
| 837 |
{
|
| 838 |
"cell_type": "code",
|
| 839 |
+
"execution_count": 7,
|
| 840 |
"metadata": {},
|
| 841 |
"outputs": [],
|
| 842 |
"source": [
|
|
|
|
| 871 |
},
|
| 872 |
{
|
| 873 |
"cell_type": "code",
|
| 874 |
+
"execution_count": 8,
|
| 875 |
"metadata": {},
|
| 876 |
"outputs": [
|
| 877 |
{
|
|
|
|
| 880 |
"'Working...\\nPlease wait patiently...\\n0\\n'"
|
| 881 |
]
|
| 882 |
},
|
| 883 |
+
"execution_count": 8,
|
| 884 |
"metadata": {},
|
| 885 |
"output_type": "execute_result"
|
| 886 |
}
|
|
|
|
| 1008 |
},
|
| 1009 |
{
|
| 1010 |
"cell_type": "code",
|
| 1011 |
+
"execution_count": 1,
|
| 1012 |
"metadata": {},
|
| 1013 |
"outputs": [],
|
| 1014 |
"source": [
|
|
|
|
| 1128 |
},
|
| 1129 |
{
|
| 1130 |
"cell_type": "code",
|
| 1131 |
+
"execution_count": 2,
|
| 1132 |
"metadata": {},
|
| 1133 |
+
"outputs": [
|
| 1134 |
+
{
|
| 1135 |
+
"name": "stdout",
|
| 1136 |
+
"output_type": "stream",
|
| 1137 |
+
"text": [
|
| 1138 |
+
"<Document source=\"https://en.wikipedia.org/wiki/Dinosaur_(2000_film)\" page=\"\"/>\n",
|
| 1139 |
+
"Dinosaur is a 2000 American live-action/animated adventure drama film produced by Walt Disney Feature Animation in association with The Secret Lab, and released by Walt Disney Pictures. The film was directed by Ralph Zondag and Eric Leighton and produced by Pam Marsden, from a screenplay written by John Harrison, Robert Nelson Jacobs, and Walon Green, and a story by the trio alongside Zondag and Thom Enriquez. It features the voices of D. B. Sweeney, Alfre Woodard, Ossie Davis, Max Casella, Hayden Panettiere, Samuel E. Wright, Julianna Margulies, Peter Siragusa, Joan Plowright, and Della Reese. The story follows a young Iguanodon who was adopted and raised by a family of lemurs on a tropical island. They are forced to the mainland by a catastrophic meteorite impact; setting out to find a new home, they join a herd of dinosaurs heading for the \"Nesting Grounds\", but must contend with the group's harsh leader, as well as external dangers such as predatory Carnotaurus.\n",
|
| 1140 |
+
"The initial idea was conceived in 1986 by Phil Tippett and Paul Verhoeven, which they conceived as a darker, naturalistic film about dinosaurs. The project underwent numerous iterations with multiple directors attached. In 1994, Walt Disney Feature Animation began development on the project and spent several years developing the software to create the dinosaurs. The characters in Dinosaur are computer-generated. However, most of the backgrounds are live-action and were filmed on location. A number of backgrounds were found in various continents such as the Americas and Asia; various tepuis and Angel Falls also appear in the film. With a budget of $127.5 million, Dinosaur was reportedly the most expensive computer-animated film at the time. Dinosaur is also the first film from Walt Disney Feature Animation to be 3D animated.\n",
|
| 1141 |
+
"Dinosaur was released on May 19, 2000, to generally positive reviews from critics, who praised the film's opening sequence, soundtrack and animation, but criticized the story for its lack of originality. The film grossed $349 million worldwide, becoming the fifth highest-grossing film of 2000. It became the fourth best-selling home video release of 2001, selling 10.6 million copies and garnering $198 million in sales.\n",
|
| 1142 |
+
"\n",
|
| 1143 |
+
"\n",
|
| 1144 |
+
"== Plot ==\n",
|
| 1145 |
+
"A Carnotaurus hunts a herd of dinosaurs, destroys an Iguanodon nest, and kills a Pachyrhinosaurus. The lone surviving Iguanodon egg is stolen by an Oviraptor, and journeys to an island inhabited by prehistoric lemurs. Plio, the daughter of lemur patriarch Yar, names the newly-hatched baby Aladar and raises him alongside her daughter Suri, over Yar's initial objections.\n",
|
| 1146 |
+
"Several years later, a fully grown Aladar watches the lemurs take part in a mating ritual, in which Plio's awkward teenage brother Zini fails to attract a mate. Moments after the ritual ends, they are interrupted by a meteorite crashing into the Earth, creating an explosive shockwave that destroys the island. Aladar and Yar's family flee the island and jump across the sea to the mainland. Being the only survivors, they mourn their losses, before moving inland.\n",
|
| 1147 |
+
"While crossing the burnt desert left by the meteorite, the group is attacked by a pack of Velociraptor. They escape by joining a multi-species herd of dinosaur refugees heading for the communal Nesting Grounds, a sanctuary left undevestated by the meteor. After encountering the callous Iguanodon herd leader Kron, they retreat to the end of the line, and befriend the old Styracosaurus Eema, her pet Ankylosaurus Url, and her equally elderly friend Baylene, a Brachiosaurus. The herd travels for days without water to the site of a lake, only to find it seemingly dried up. Kron orders the herd to move on and let the weakest perish, but Aladar stays behind with a struggling Eema. He and Baylene dig until they reach the water table. The rest of the herd follows suit, and Kron's sister Neera, impressed by Aladar's compassion, begins to grow closer to him. However, Kron sees Aladar's increasing popularity\n",
|
| 1148 |
+
"</Document>\n",
|
| 1149 |
+
"\n",
|
| 1150 |
+
"---\n",
|
| 1151 |
+
"\n",
|
| 1152 |
+
"<Document source=\"https://en.wikipedia.org/wiki/Ryan_North\" page=\"\"/>\n",
|
| 1153 |
+
"Ryan North (born October 20, 1980) is a Canadian writer and computer programmer.\n",
|
| 1154 |
+
"He is the creator and author of Dinosaur Comics, and has written for the comic series of Adventure Time and Marvel Comics' The Unbeatable Squirrel Girl and Fantastic Four. His works have won multiple Eisner Awards and Harvey Awards and made New York Times Bestseller lists.\n",
|
| 1155 |
+
"\n",
|
| 1156 |
+
"\n",
|
| 1157 |
+
"== Comics ==\n",
|
| 1158 |
+
"\n",
|
| 1159 |
+
"\n",
|
| 1160 |
+
"=== Webcomics ===\n",
|
| 1161 |
+
"\n",
|
| 1162 |
+
"North started the webcomic Dinosaur Comics in 2003, during the last year of his undergraduate degree. Dinosaur Comics is a fixed-art webcomic which uses the same base art for every strip. As of 2025 North has produced more than 4,300 strips.\n",
|
| 1163 |
+
"Dinosaur Comics was named one of the best webcomics of 2004 and 2005 by The Webcomics Examiner. Wired listed Dinosaur Comics as one of \"Five Webcomics You Can Share With Your Kids\" and PC Magazine included the comic in its \"10 Wicked Awesome Webcomics\" list. Cracked.com named Dinosaur Comics one of the 8 funniest webcomics on the internet. In 2005, it won \"Outstanding Anthropomorphic Comic\" in the Web Cartoonists' Choice Awards.\n",
|
| 1164 |
+
"As well as Dinosaur Comics, North also created Whispered Apologies, a site where users could submit comic art without text and others would write text to match the art.\n",
|
| 1165 |
+
"Canada's The Globe and Mail described North as a \"pioneering webcomic creator\".\n",
|
| 1166 |
+
"\n",
|
| 1167 |
+
"\n",
|
| 1168 |
+
"=== Printed comics and graphic novels ===\n",
|
| 1169 |
+
"North was the writer of the Adventure Time comic book series from 2012 to 2014. In 2013 the series won an Eisner Award (Best Publication for Kids) and a Harvey Award (Best Original Graphic Publication For Younger Readers).\n",
|
| 1170 |
+
"North has written for several Marvel Comics series, including The Unbeatable Squirrel Girl, Power Pack, and Inhumans: Once and Future Kings.\n",
|
| 1171 |
+
"On January 21, 2013, Shiftylook.com launched Galaga, a comic written by North and illustrated by Christopher Hastings and colored by Anthony Clark, the creators of The Adventures of Dr. McNinja. The comic is based on the 1981 arcade shooter of the same name.\n",
|
| 1172 |
+
"On July 21, 2017, two of North's projects were awarded Eisner Awards: \"Best Publication for Teens (ages 13-17)\" for The Unbeatable Squirrel Girl (with Erica Henderson), and \"Best Humor Publication\" for Jughead (with Chip Zdarsky, Henderson, and Derek Charm).\n",
|
| 1173 |
+
"On September 15, 2020, Archaia published a graphic novel adaptation of Kurt Vonnegut's Slaughterhouse-Five, which was adapted by North and illustrated by Albert Monteys.\n",
|
| 1174 |
+
"In July 2022, North announced two upcoming comics projects via his newsletter. The first is Star Trek: Lower Decks —a limited series based on the animated series of the same name—with artist Chris Fenoglio; the first issue is scheduled to be published in September 2022 by IDW Publishing. The second is a YA graphic novel, titled Danger and Other Unknown Risks, with artist Henderson; North and Henderson were co-creators on Squirrel Girl. This graphic novel is described as a \"dystopian fantasy\" and is scheduled to be published in April 2023 by Penguin Teen.\n",
|
| 1175 |
+
"In November 2022, North launched a new volume of Fantastic Four with artist Iban Coello.\n",
|
| 1176 |
+
"In October 2024, at New York Comic Con, it was announced that North was heading up Marvel's 2025 event One World Under Doom. The event will follow Doctor Doom who, after being granted the title of Sorcerer Supreme during the events of Blood Hunt, has declared himself emperor of the world. The event will begin in February 2025 with the main miniseries written by North and drawn by R.B. Silva.\n",
|
| 1177 |
+
"\n",
|
| 1178 |
+
"\n",
|
| 1179 |
+
"=== Webcomic tools ===\n",
|
| 1180 |
+
"North created three tools to aid webcomic authors: Oh No Robot, a webcomic transcription tool that creates searchable text databases for comics; RSSpect, a method of creating RSS feeds for websites; and Project Wonderful, a pay-per-day auction-based ad serving system. The first two were free, whereas the last took 25% of each sale. Only Oh No Robot remains.\n",
|
| 1181 |
+
"\n",
|
| 1182 |
+
"\n",
|
| 1183 |
+
"== Books and other writing ==\n",
|
| 1184 |
+
"During his academic career, North co-authored three papers on computational linguistics.\n",
|
| 1185 |
+
"Some of North's original comedy writin\n",
|
| 1186 |
+
"</Document>\n"
|
| 1187 |
+
]
|
| 1188 |
+
}
|
| 1189 |
+
],
|
| 1190 |
"source": [
|
| 1191 |
"def wiki_search(query: str) -> str:\n",
|
| 1192 |
" \"\"\"\n",
|
|
|
|
| 1203 |
" ]\n",
|
| 1204 |
" )\n",
|
| 1205 |
" except Exception as e:\n",
|
| 1206 |
+
" return f\"Error during Wikipedia search: {str(e)}\"\n",
|
| 1207 |
+
"\n",
|
| 1208 |
+
"# Test\n",
|
| 1209 |
+
"query = \"Who nominated the only Featured Article on English Wikipedia about a dinosaur that was promoted in November 2016?\"\n",
|
| 1210 |
+
"\n",
|
| 1211 |
+
"result = wiki_search(query)\n",
|
| 1212 |
+
"print(result)"
|
| 1213 |
]
|
| 1214 |
+
},
|
| 1215 |
+
{
|
| 1216 |
+
"cell_type": "code",
|
| 1217 |
+
"execution_count": null,
|
| 1218 |
+
"metadata": {},
|
| 1219 |
+
"outputs": [],
|
| 1220 |
+
"source": []
|
| 1221 |
}
|
| 1222 |
],
|
| 1223 |
"metadata": {
|
requirements.txt
CHANGED
|
@@ -24,4 +24,7 @@ langgraph-cli[inmem]
|
|
| 24 |
|
| 25 |
# arxiv dependsencies
|
| 26 |
arxiv
|
| 27 |
-
pymupdf
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# arxiv dependsencies
|
| 26 |
arxiv
|
| 27 |
+
pymupdf
|
| 28 |
+
|
| 29 |
+
#wikipedia
|
| 30 |
+
wikipedia
|