|
109 | 109 | },
|
110 | 110 | {
|
111 | 111 | "cell_type": "code",
|
112 |
| - "execution_count": 30, |
| 112 | + "execution_count": 1, |
113 | 113 | "metadata": {},
|
114 | 114 | "outputs": [],
|
115 | 115 | "source": [
|
|
130 | 130 | },
|
131 | 131 | {
|
132 | 132 | "cell_type": "code",
|
133 |
| - "execution_count": 31, |
| 133 | + "execution_count": 2, |
134 | 134 | "metadata": {},
|
135 | 135 | "outputs": [],
|
136 | 136 | "source": [
|
|
152 | 152 | },
|
153 | 153 | {
|
154 | 154 | "cell_type": "code",
|
155 |
| - "execution_count": 32, |
| 155 | + "execution_count": 3, |
156 | 156 | "metadata": {},
|
157 | 157 | "outputs": [],
|
158 | 158 | "source": [
|
159 | 159 | "from julep import Client\n",
|
160 | 160 | "import os\n",
|
161 | 161 | "\n",
|
162 |
| - "JULEP_API_KEY = \"YOUR_JULEP_API_KEY\"\n", |
| 162 | + "JULEP_API_KEY = os.environ['JULEP_API_KEY']\n", |
163 | 163 | "\n",
|
164 | 164 | "# Create a client\n",
|
165 | 165 | "client = Client(api_key=JULEP_API_KEY, environment=\"production\")"
|
|
178 | 178 | },
|
179 | 179 | {
|
180 | 180 | "cell_type": "code",
|
181 |
| - "execution_count": 33, |
| 181 | + "execution_count": 4, |
182 | 182 | "metadata": {},
|
183 | 183 | "outputs": [],
|
184 | 184 | "source": [
|
|
210 | 210 | },
|
211 | 211 | {
|
212 | 212 | "cell_type": "code",
|
213 |
| - "execution_count": 34, |
| 213 | + "execution_count": 5, |
214 | 214 | "metadata": {},
|
215 | 215 | "outputs": [],
|
216 | 216 | "source": [
|
|
246 | 246 | " integration:\n",
|
247 | 247 | " provider: brave\n",
|
248 | 248 | " setup:\n",
|
249 |
| - " api_key: \"{BRAVE_API_KEY}\"\n", |
| 249 | + " brave_api_key: \"{BRAVE_API_KEY}\"\n", |
250 | 250 | "\n",
|
251 | 251 | "########################################################\n",
|
252 | 252 | "####################### MAIN WORKFLOW ##################\n",
|
|
299 | 299 | },
|
300 | 300 | {
|
301 | 301 | "cell_type": "code",
|
302 |
| - "execution_count": 35, |
| 302 | + "execution_count": 6, |
303 | 303 | "metadata": {},
|
304 | 304 | "outputs": [],
|
305 | 305 | "source": [
|
|
324 | 324 | },
|
325 | 325 | {
|
326 | 326 | "cell_type": "code",
|
327 |
| - "execution_count": 36, |
| 327 | + "execution_count": 7, |
328 | 328 | "metadata": {},
|
329 | 329 | "outputs": [],
|
330 | 330 | "source": [
|
|
360 | 360 | },
|
361 | 361 | {
|
362 | 362 | "cell_type": "code",
|
363 |
| - "execution_count": 51, |
| 363 | + "execution_count": 8, |
364 | 364 | "metadata": {},
|
365 | 365 | "outputs": [
|
366 | 366 | {
|
367 | 367 | "name": "stdout",
|
368 | 368 | "output_type": "stream",
|
369 | 369 | "text": [
|
370 |
| - "Based on the recent news about Tottenham Hotspur, let me craft a sarcastic headline for you:\n", |
| 370 | + "\"Genius Billionaire Desperately Attempts Comedy, Proves Money Can't Buy Sense of Humor\"\n", |
371 | 371 | "\n",
|
372 |
| - "\"BREAKING: Tottenham Fans Shocked to Discover Their Team's Trophy Cabinet Still Has Same Amount of Dust as Last Season\"\n", |
| 372 | + "\"Breaking: World's Richest Man Still Can't Figure Out How to Make People Genuinely Like Him\"\n", |
373 | 373 | "\n",
|
374 |
| - "Alternative sarcastic headlines:\n", |
| 374 | + "\"Shocking Report: Man Who Named Child 'X Æ A-12' May Not Be Most Stable CEO\"\n", |
375 | 375 | "\n",
|
376 |
| - "\"EXCLUSIVE: Spurs Players Perfect the Art of 'Almost Winning' in Revolutionary Training Session\"\n", |
| 376 | + "\"Former Trump Officials Suggest Drug Tests for Musk; Musk Agrees, Proving He Might Actually Need One\"\n", |
377 | 377 | "\n",
|
378 |
| - "\"REPORT: Scientific Study Confirms Supporting Tottenham Linked to Increased Heart Medication Sales\"\n", |
| 378 | + "\"Billionaire Space Enthusiast Too Busy Being 'Funny' on Twitter to Notice Everyone's Cringing\"\n", |
379 | 379 | "\n",
|
380 |
| - "\"SHOCKING: Tottenham's GPS Data Reveals Players Expertly Avoiding Trophy-Winning Positions\"\n", |
| 380 | + "\"Studies Show Being Worth $180 Billion Still Won't Make Your Memes Any Better\"\n", |
381 | 381 | "\n",
|
382 |
| - "These headlines play on Tottenham's notorious reputation for coming close but not quite winning major trophies, despite being one of England's biggest clubs. They maintain their status as every neutral's favorite \"almost there\" team!\n", |
| 382 | + "\"Man Who Could End World Hunger Chooses to Post Dad Jokes on Social Media Instead\"\n", |
383 | 383 | "\n",
|
384 |
| - "Would you like me to generate more sarcastic headlines about any specific aspect of Tottenham Hotspur?\n" |
| 384 | + "\"Breaking: Local Attention-Seeking Billionaire Still Seeking Attention, More at 11\"\n" |
385 | 385 | ]
|
386 | 386 | }
|
387 | 387 | ],
|
388 | 388 | "source": [
|
389 |
| - "# Get execution details\n", |
| 389 | + "import time\n", |
| 390 | + "\n", |
| 391 | + "execution = client.executions.get(execution.id)\n", |
| 392 | + "\n", |
| 393 | + "while execution.status != \"succeeded\":\n", |
| 394 | + " time.sleep(5)\n", |
| 395 | + " execution = client.executions.get(execution.id)\n", |
| 396 | + " print(\"Execution status: \", execution.status)\n", |
| 397 | + " print(\"-\"*50)\n", |
| 398 | + "\n", |
390 | 399 | "execution = client.executions.get(execution.id)\n",
|
391 |
| - "# Print the output\n", |
| 400 | + "\n", |
392 | 401 | "print(execution.output)"
|
393 | 402 | ]
|
394 | 403 | },
|
395 | 404 | {
|
396 | 405 | "cell_type": "code",
|
397 |
| - "execution_count": 48, |
| 406 | + "execution_count": 9, |
398 | 407 | "metadata": {},
|
399 | 408 | "outputs": [
|
400 | 409 | {
|
401 | 410 | "name": "stdout",
|
402 | 411 | "output_type": "stream",
|
403 | 412 | "text": [
|
404 | 413 | "Transition type: init\n",
|
405 |
| - "Transition output: {'topic': 'Tottenham Hotspur'}\n", |
| 414 | + "Transition output: {'topic': 'Elon Musk'}\n", |
406 | 415 | "--------------------------------------------------\n",
|
407 | 416 | "Transition type: step\n",
|
408 |
| - "Transition output: {'result': [{'link': 'https://www.tottenhamhotspur.com/news/', 'title': 'News | Tottenham Hotspur', 'snippet': 'Latest official <strong>news</strong> and video from <strong>Tottenham</strong> <strong>Hotspur</strong>'}, {'link': 'https://www.football.london/tottenham-hotspur-fc/', 'title': 'Tottenham Hotspur FC - latest news, pictures, video comment - Football.london', 'snippet': 'The latest <strong>Tottenham</strong> <strong>news</strong>, transfers, fixtures and more. Including Live blogs, pictures, video, podcasts, polls and indepth analysis from our dedicated Spurs writers.'}, {'link': 'https://www.nytimes.com/athletic/football/team/tottenham-hotspur/', 'title': 'Tottenham Hotspur - News, Schedule, Scores, Roster, and Stats - The Athletic', 'snippet': 'Breaking <strong>Tottenham</strong> <strong>Hotspur</strong> <strong>news</strong> and in-depth analysis from the best newsroom in sports. Follow your favorite clubs. Get the latest injury updates, player <strong>news</strong> and more from around the league.'}]}\n", |
| 417 | + "Transition output: {'result': [{'link': 'https://9gag.com/tag/elon-musk', 'title': 'Best Elon Musk Memes and Images - 9GAG', 'snippet': 'Enjoy the best of new <strong>funny</strong> cursed meme images about <strong>Elon</strong> <strong>Musk</strong>, Twitter, $8 verified badge, Tesla, the Boring Company and more on 9GAG. Never run out of hilarious cursed memes to share.'}, {'link': 'https://www.youtube.com/watch?v=ukxf9AqLsPY', 'title': 'Elon FINALLY Gets the HUMILIATION He Deserves in Front of MILLIONS - YouTube', 'snippet': 'Comedian Bill Burr roasts <strong>Elon</strong> <strong>Musk</strong>, MAGA melts down over SNL, and protesters hit Trump where it hurts—his billionaire bestie's wallet. Gabe Sanchez reports ...'}, {'link': 'https://gizmodo.com/elon-musk-is-annoying-unfunny-and-should-probably-take-a-drug-test-trump-officials-reportedly-say-2000587948', 'title': 'Elon Musk Is Annoying, Unfunny, and Should Probably Take a Drug Test, Trump Officials Reportedly Say', 'snippet': 'Administration officials joked to one another about subjecting <strong>Musk</strong> to mandatory drug testing, which <strong>Musk</strong> himself has said would be a “great idea” for federal employees. It gets worse. “I have been in the same room with <strong>Elon</strong>, and he always tries to be <strong>funny</strong>.'}]}\n", |
409 | 418 | "--------------------------------------------------\n",
|
410 | 419 | "Transition type: step\n",
|
411 |
| - "Transition output: {'search_results': [{'title': 'News | Tottenham Hotspur', 'snippet': 'Latest official <strong>news</strong> and video from <strong>Tottenham</strong> <strong>Hotspur</strong>'}, {'title': 'Tottenham Hotspur FC - latest news, pictures, video comment - Football.london', 'snippet': 'The latest <strong>Tottenham</strong> <strong>news</strong>, transfers, fixtures and more. Including Live blogs, pictures, video, podcasts, polls and indepth analysis from our dedicated Spurs writers.'}, {'title': 'Tottenham Hotspur - News, Schedule, Scores, Roster, and Stats - The Athletic', 'snippet': 'Breaking <strong>Tottenham</strong> <strong>Hotspur</strong> <strong>news</strong> and in-depth analysis from the best newsroom in sports. Follow your favorite clubs. Get the latest injury updates, player <strong>news</strong> and more from around the league.'}]}\n", |
| 420 | + "Transition output: {'search_results': [{'title': 'Best Elon Musk Memes and Images - 9GAG', 'snippet': 'Enjoy the best of new <strong>funny</strong> cursed meme images about <strong>Elon</strong> <strong>Musk</strong>, Twitter, $8 verified badge, Tesla, the Boring Company and more on 9GAG. Never run out of hilarious cursed memes to share.'}, {'title': 'Elon FINALLY Gets the HUMILIATION He Deserves in Front of MILLIONS - YouTube', 'snippet': 'Comedian Bill Burr roasts <strong>Elon</strong> <strong>Musk</strong>, MAGA melts down over SNL, and protesters hit Trump where it hurts—his billionaire bestie's wallet. Gabe Sanchez reports ...'}, {'title': 'Elon Musk Is Annoying, Unfunny, and Should Probably Take a Drug Test, Trump Officials Reportedly Say', 'snippet': 'Administration officials joked to one another about subjecting <strong>Musk</strong> to mandatory drug testing, which <strong>Musk</strong> himself has said would be a “great idea” for federal employees. It gets worse. “I have been in the same room with <strong>Elon</strong>, and he always tries to be <strong>funny</strong>.'}]}\n", |
412 | 421 | "--------------------------------------------------\n",
|
413 | 422 | "Transition type: finish\n",
|
414 |
| - "Transition output: Based on the recent news about Tottenham Hotspur, let me craft a sarcastic headline for you:\n", |
| 423 | + "Transition output: \"Genius Billionaire Desperately Attempts Comedy, Proves Money Can't Buy Sense of Humor\"\n", |
415 | 424 | "\n",
|
416 |
| - "\"BREAKING: Tottenham Fans Shocked to Discover Their Team's Trophy Cabinet Still Has Same Amount of Dust as Last Season\"\n", |
| 425 | + "\"Breaking: World's Richest Man Still Can't Figure Out How to Make People Genuinely Like Him\"\n", |
417 | 426 | "\n",
|
418 |
| - "Alternative sarcastic headlines:\n", |
| 427 | + "\"Shocking Report: Man Who Named Child 'X Æ A-12' May Not Be Most Stable CEO\"\n", |
419 | 428 | "\n",
|
420 |
| - "\"EXCLUSIVE: Spurs Players Perfect the Art of 'Almost Winning' in Revolutionary Training Session\"\n", |
| 429 | + "\"Former Trump Officials Suggest Drug Tests for Musk; Musk Agrees, Proving He Might Actually Need One\"\n", |
421 | 430 | "\n",
|
422 |
| - "\"REPORT: Scientific Study Confirms Supporting Tottenham Linked to Increased Heart Medication Sales\"\n", |
| 431 | + "\"Billionaire Space Enthusiast Too Busy Being 'Funny' on Twitter to Notice Everyone's Cringing\"\n", |
423 | 432 | "\n",
|
424 |
| - "\"SHOCKING: Tottenham's GPS Data Reveals Players Expertly Avoiding Trophy-Winning Positions\"\n", |
| 433 | + "\"Studies Show Being Worth $180 Billion Still Won't Make Your Memes Any Better\"\n", |
425 | 434 | "\n",
|
426 |
| - "These headlines play on Tottenham's notorious reputation for coming close but not quite winning major trophies, despite being one of England's biggest clubs. They maintain their status as every neutral's favorite \"almost there\" team!\n", |
| 435 | + "\"Man Who Could End World Hunger Chooses to Post Dad Jokes on Social Media Instead\"\n", |
427 | 436 | "\n",
|
428 |
| - "Would you like me to generate more sarcastic headlines about any specific aspect of Tottenham Hotspur?\n", |
| 437 | + "\"Breaking: Local Attention-Seeking Billionaire Still Seeking Attention, More at 11\"\n", |
429 | 438 | "--------------------------------------------------\n"
|
430 | 439 | ]
|
431 | 440 | }
|
|
457 | 466 | },
|
458 | 467 | {
|
459 | 468 | "cell_type": "code",
|
460 |
| - "execution_count": 39, |
| 469 | + "execution_count": 10, |
461 | 470 | "metadata": {},
|
462 | 471 | "outputs": [],
|
463 | 472 | "source": [
|
|
471 | 480 | },
|
472 | 481 | {
|
473 | 482 | "cell_type": "code",
|
474 |
| - "execution_count": 49, |
| 483 | + "execution_count": 11, |
475 | 484 | "metadata": {},
|
476 | 485 | "outputs": [
|
477 | 486 | {
|
478 | 487 | "name": "stdout",
|
479 | 488 | "output_type": "stream",
|
480 | 489 | "text": [
|
481 |
| - "Based on the recent news about Tottenham Hotspur, let me craft a sarcastic headline for you:\n", |
482 |
| - "\n", |
483 |
| - "\"BREAKING: Tottenham Fans Shocked to Discover Their Team's Trophy Cabinet Still Has Same Amount of Dust as Last Season\"\n", |
484 |
| - "\n", |
485 |
| - "Alternative sarcastic headlines:\n", |
| 490 | + "Execution status: succeeded\n", |
| 491 | + "--------------------------------------------------\n", |
| 492 | + "\"In Shocking Display of Stockholm Syndrome, Former Arsenal Executive Defects to Tottenham\"\n", |
486 | 493 | "\n",
|
487 |
| - "\"EXCLUSIVE: Spurs Players Perfect the Art of 'Almost Winning' in Revolutionary Training Session\"\n", |
| 494 | + "\"Desperate Spurs Hire Ex-Arsenal CEO, Proving There's No Rock Bottom They Won't Explore\"\n", |
488 | 495 | "\n",
|
489 |
| - "\"REPORT: Scientific Study Confirms Supporting Tottenham Linked to Increased Heart Medication Sales\"\n", |
| 496 | + "\"Local Man Voluntarily Leaves Success to Join Eternal Trophy Drought: A London Tale\"\n", |
490 | 497 | "\n",
|
491 |
| - "\"SHOCKING: Tottenham's GPS Data Reveals Players Expertly Avoiding Trophy-Winning Positions\"\n", |
| 498 | + "\"Tottenham Finally Wins Something: The Heart of Arsenal's Former CEO\"\n", |
492 | 499 | "\n",
|
493 |
| - "These headlines play on Tottenham's notorious reputation for coming close but not quite winning major trophies, despite being one of England's biggest clubs. They maintain their status as every neutral's favorite \"almost there\" team!\n", |
| 500 | + "\"North London Rivalry Takes Bizarre Turn as Spurs Resort to Executive Poaching Instead of Trophy Hunting\"\n", |
494 | 501 | "\n",
|
495 |
| - "Would you like me to generate more sarcastic headlines about any specific aspect of Tottenham Hotspur?\n" |
| 502 | + "Pick any of these sarcastic headlines that capture the irony of Tottenham hiring their rival Arsenal's former CEO, while playfully jabbing at Spurs' notorious trophy drought and the historic rivalry between the two clubs! 😏\n" |
496 | 503 | ]
|
497 | 504 | }
|
498 | 505 | ],
|
499 | 506 | "source": [
|
| 507 | + "import time\n", |
| 508 | + "\n", |
| 509 | + "execution = client.executions.get(execution.id)\n", |
| 510 | + "\n", |
| 511 | + "while execution.status != \"succeeded\":\n", |
| 512 | + " time.sleep(5)\n", |
| 513 | + " execution = client.executions.get(execution.id)\n", |
| 514 | + " print(\"Execution status: \", execution.status)\n", |
| 515 | + " print(\"-\"*50)\n", |
| 516 | + "\n", |
500 | 517 | "execution = client.executions.get(execution.id)\n",
|
| 518 | + "\n", |
501 | 519 | "print(execution.output)"
|
502 | 520 | ]
|
503 | 521 | },
|
|
512 | 530 | },
|
513 | 531 | {
|
514 | 532 | "cell_type": "code",
|
515 |
| - "execution_count": 50, |
| 533 | + "execution_count": 12, |
516 | 534 | "metadata": {},
|
517 | 535 | "outputs": [
|
518 | 536 | {
|
519 | 537 | "data": {
|
520 | 538 | "text/plain": [
|
521 |
| - "{'search_results': [{'title': 'News | Tottenham Hotspur',\n", |
522 |
| - " 'snippet': 'Latest official <strong>news</strong> and video from <strong>Tottenham</strong> <strong>Hotspur</strong>'},\n", |
523 |
| - " {'title': 'Tottenham Hotspur FC - latest news, pictures, video comment - Football.london',\n", |
| 539 | + "{'search_results': [{'title': 'Tottenham Hotspur FC - latest news, pictures, video comment - Football.london',\n", |
524 | 540 | " 'snippet': 'The latest <strong>Tottenham</strong> <strong>news</strong>, transfers, fixtures and more. Including Live blogs, pictures, video, podcasts, polls and indepth analysis from our dedicated Spurs writers.'},\n",
|
525 |
| - " {'title': 'Tottenham Hotspur - News, Schedule, Scores, Roster, and Stats - The Athletic',\n", |
526 |
| - " 'snippet': 'Breaking <strong>Tottenham</strong> <strong>Hotspur</strong> <strong>news</strong> and in-depth analysis from the best newsroom in sports. Follow your favorite clubs. Get the latest injury updates, player <strong>news</strong> and more from around the league.'}]}" |
| 541 | + " {'title': 'Spurs Media Watch, News and Stories',\n", |
| 542 | + " 'snippet': 'These stories have been specially selected from today's media. They do not necessarily represent the views or position of <strong>Tottenham</strong> <strong>Hotspur</strong> Football Club. For total Spurs <strong>news</strong> coverage, visit NewsNow.co.uk, the UK's #1 football <strong>news</strong> aggregator.'},\n", |
| 543 | + " {'title': 'Tottenham Hotspur FC - Transfer news, results, fixtures, video and audio',\n", |
| 544 | + " 'snippet': 'Having left Arsenal at the end of the 2023-24 campaign, Venkatesham has bided his time before returning to football. <strong>Tottenham confirmed Venkatesham's appointment as their next CEO on Friday</strong>, in news that arrived with an element of surprise given his previous ties with Spurs' rivals.'}]}" |
527 | 545 | ]
|
528 | 546 | },
|
529 |
| - "execution_count": 50, |
| 547 | + "execution_count": 12, |
530 | 548 | "metadata": {},
|
531 | 549 | "output_type": "execute_result"
|
532 | 550 | }
|
|
0 commit comments