|
235 | 235 | }, |
236 | 236 | { |
237 | 237 | "cell_type": "code", |
238 | | - "execution_count": 6, |
| 238 | + "execution_count": 7, |
239 | 239 | "id": "918ded26", |
240 | 240 | "metadata": {}, |
241 | 241 | "outputs": [], |
242 | 242 | "source": [ |
243 | 243 | "from azure.search.documents.agent import KnowledgeAgentRetrievalClient\n", |
244 | 244 | "from azure.search.documents.agent.models import KnowledgeAgentRetrievalRequest, KnowledgeAgentMessage, KnowledgeAgentMessageTextContent, KnowledgeAgentIndexParams\n", |
245 | | - "import azure.search.documents._utils\n", |
246 | 245 | "\n", |
247 | | - "agent_client = KnowledgeAgentRetrievalClient(endpoint=endpoint, agent_name=agent_name, authentication_policy=azure.search.documents._utils.get_authentication_policy(credential))\n", |
| 246 | + "agent_client = KnowledgeAgentRetrievalClient(endpoint=endpoint, agent_name=agent_name, credential=credential)\n", |
248 | 247 | "\n", |
249 | 248 | "messages.append({\n", |
250 | 249 | " \"role\": \"user\",\n", |
|
276 | 275 | }, |
277 | 276 | { |
278 | 277 | "cell_type": "code", |
279 | | - "execution_count": 7, |
| 278 | + "execution_count": 8, |
280 | 279 | "id": "d4d78fbe", |
281 | 280 | "metadata": {}, |
282 | 281 | "outputs": [ |
|
334 | 333 | }, |
335 | 334 | { |
336 | 335 | "cell_type": "code", |
337 | | - "execution_count": 8, |
| 336 | + "execution_count": 9, |
338 | 337 | "id": "7fccf4b0", |
339 | 338 | "metadata": {}, |
340 | 339 | "outputs": [ |
|
348 | 347 | " \"id\": 0,\n", |
349 | 348 | " \"type\": \"ModelQueryPlanning\",\n", |
350 | 349 | " \"input_tokens\": 1407,\n", |
351 | | - " \"output_tokens\": 318\n", |
| 350 | + " \"output_tokens\": 311\n", |
352 | 351 | " },\n", |
353 | 352 | " {\n", |
354 | 353 | " \"id\": 1,\n", |
|
357 | 356 | " \"query\": {\n", |
358 | 357 | " \"search\": \"suburban belts December brightening urban cores light levels\"\n", |
359 | 358 | " },\n", |
360 | | - " \"query_time\": \"2025-05-02T04:50:56.846Z\",\n", |
361 | | - " \"elapsed_ms\": 611\n", |
| 359 | + " \"query_time\": \"2025-05-06T15:43:41.162Z\",\n", |
| 360 | + " \"elapsed_ms\": 714\n", |
362 | 361 | " },\n", |
363 | 362 | " {\n", |
364 | 363 | " \"id\": 2,\n", |
|
367 | 366 | " \"query\": {\n", |
368 | 367 | " \"search\": \"Phoenix nighttime street grid visibility from space\"\n", |
369 | 368 | " },\n", |
370 | | - " \"query_time\": \"2025-05-02T04:50:57.331Z\",\n", |
| 369 | + " \"query_time\": \"2025-05-06T15:43:41.683Z\",\n", |
371 | 370 | " \"count\": 2,\n", |
372 | | - " \"elapsed_ms\": 485\n", |
| 371 | + " \"elapsed_ms\": 520\n", |
373 | 372 | " }\n", |
374 | 373 | "]\n", |
375 | 374 | "Results\n", |
|
408 | 407 | }, |
409 | 408 | { |
410 | 409 | "cell_type": "code", |
411 | | - "execution_count": 9, |
| 410 | + "execution_count": 10, |
412 | 411 | "id": "da260539", |
413 | 412 | "metadata": {}, |
414 | 413 | "outputs": [], |
|
434 | 433 | }, |
435 | 434 | { |
436 | 435 | "cell_type": "code", |
437 | | - "execution_count": 10, |
| 436 | + "execution_count": 11, |
438 | 437 | "id": "b2dea5c2", |
439 | 438 | "metadata": {}, |
440 | 439 | "outputs": [ |
441 | 440 | { |
442 | 441 | "name": "stdout", |
443 | 442 | "output_type": "stream", |
444 | 443 | "text": [ |
445 | | - "Suburban belts display larger December brightening than urban cores because seasonal lighting, such\n", |
446 | | - "as holiday decorations, tends to be more prevalent in residential areas where individual homes often\n", |
447 | | - "contribute significantly to increased brightness. In contrast, urban cores, while having higher\n", |
448 | | - "absolute light levels, don't experience as much variability due to the consistent presence of\n", |
449 | | - "streetlights, commercial lighting, and less individual contribution to seasonal displays [ref_id:0].\n", |
450 | | - "The Phoenix nighttime street grid is sharply visible from space because it is laid out in a regular\n", |
451 | | - "grid of city blocks and streets, typical of western U.S. cities. This lighting pattern is evident\n", |
452 | | - "from the low-Earth-orbit vantage point and highlights the extensive spread of urbanization. In\n", |
453 | | - "contrast, large stretches of interstate between midwestern cities remain comparatively dim as these\n", |
454 | | - "areas primarily consist of long, undeveloped stretches without urban lighting patterns, typical of\n", |
455 | | - "agricultural or undeveloped land [ref_id:1].\n" |
| 444 | + "Suburban belts tend to display larger December brightening compared to urban cores even though the\n", |
| 445 | + "absolute light levels are higher downtown because suburban areas often have more residential\n", |
| 446 | + "Christmas lighting during the holiday season. In contrast, urban cores have more constant commercial\n", |
| 447 | + "lighting throughout the year, which changes less dramatically in December [Source 0]. The Phoenix\n", |
| 448 | + "nighttime street grid is sharply visible from space because the city's urban layout follows a\n", |
| 449 | + "regular grid pattern typical of many Western U.S. cities. This grid pattern, along with the street\n", |
| 450 | + "lighting, becomes distinctly visible from space. In contrast, large stretches of interstate between\n", |
| 451 | + "Midwestern cities are dimmer due to lower population density and reduced road lighting, as they pass\n", |
| 452 | + "through more rural areas without the extensive grid-like street lighting found in metropolitan areas\n", |
| 453 | + "like Phoenix [Source 1].\n" |
456 | 454 | ] |
457 | 455 | } |
458 | 456 | ], |
|
476 | 474 | }, |
477 | 475 | { |
478 | 476 | "cell_type": "code", |
479 | | - "execution_count": 11, |
| 477 | + "execution_count": 12, |
480 | 478 | "id": "9126b4ce", |
481 | 479 | "metadata": {}, |
482 | 480 | "outputs": [ |
483 | 481 | { |
484 | 482 | "name": "stdout", |
485 | 483 | "output_type": "stream", |
486 | 484 | "text": [ |
487 | | - "Suburban belts display larger December brightening compared to urban cores even though absolute\n", |
488 | | - "light levels are higher downtown due to the widespread use of decorative lighting during the holiday\n", |
489 | | - "season. Suburban areas tend to have more residential properties where festive lighting is commonly\n", |
490 | | - "used, contributing to this phenomenon. Additionally, suburban development often spreads outward,\n", |
491 | | - "leading to a more extensive area where lighting may be present compared to the concentrated urban\n", |
492 | | - "cores {ref_id: 0}. Regarding Phoenix's sharply visible nighttime street grid from space, Phoenix\n", |
493 | | - "and many cities in the western United States feature a regular grid layout of city blocks and\n", |
494 | | - "streets. This grid is particularly evident at night because street lighting creates a clear and\n", |
495 | | - "sharp pattern visible from space. In contrast, the interstate between midwestern cities may appear\n", |
496 | | - "dimmer because these areas generally have less consistent lighting and lower population density,\n", |
497 | | - "causing stretches of roadway to be less illuminated {ref_id: 1}.\n" |
| 485 | + "Suburban areas often display larger December brightening compared to urban cores because of\n", |
| 486 | + "widespread decorative lighting practices during the holiday season in residential neighborhoods,\n", |
| 487 | + "whereas urban cores, despite having higher absolute light levels, may not experience as pronounced\n", |
| 488 | + "increases due to the density and type of lighting already present there [ref_id: 1]. The reason the\n", |
| 489 | + "Phoenix nighttime street grid is so sharply visible from space is due to its regular grid layout of\n", |
| 490 | + "city blocks and streets, which highlight street lighting patterns. This structure, common to many\n", |
| 491 | + "central and western U.S. cities, facilitates easy visibility from space, making individual lights\n", |
| 492 | + "and intersections conspicuous. This contrasts with large stretches of interstate between midwestern\n", |
| 493 | + "cities, which often remain dim due to fewer intersections or less dense lighting along rural or\n", |
| 494 | + "undeveloped areas [ref_id: 0].\n" |
498 | 495 | ] |
499 | 496 | } |
500 | 497 | ], |
|
518 | 515 | }, |
519 | 516 | { |
520 | 517 | "cell_type": "code", |
521 | | - "execution_count": 12, |
| 518 | + "execution_count": 13, |
522 | 519 | "id": "7034e480", |
523 | 520 | "metadata": {}, |
524 | 521 | "outputs": [], |
|
550 | 547 | }, |
551 | 548 | { |
552 | 549 | "cell_type": "code", |
553 | | - "execution_count": 13, |
| 550 | + "execution_count": 14, |
554 | 551 | "id": "35a1bfcb", |
555 | 552 | "metadata": {}, |
556 | 553 | "outputs": [ |
|
693 | 690 | }, |
694 | 691 | { |
695 | 692 | "cell_type": "code", |
696 | | - "execution_count": 14, |
| 693 | + "execution_count": 15, |
697 | 694 | "id": "6f74c2c3", |
698 | 695 | "metadata": {}, |
699 | 696 | "outputs": [ |
|
707 | 704 | " \"id\": 0,\n", |
708 | 705 | " \"type\": \"ModelQueryPlanning\",\n", |
709 | 706 | " \"input_tokens\": 2283,\n", |
710 | | - " \"output_tokens\": 110\n", |
| 707 | + " \"output_tokens\": 207\n", |
711 | 708 | " },\n", |
712 | 709 | " {\n", |
713 | 710 | " \"id\": 1,\n", |
|
716 | 713 | " \"query\": {\n", |
717 | 714 | " \"search\": \"how to locate lava flows at night\"\n", |
718 | 715 | " },\n", |
719 | | - " \"query_time\": \"2025-05-02T04:51:05.929Z\",\n", |
| 716 | + " \"query_time\": \"2025-05-06T15:44:00.218Z\",\n", |
720 | 717 | " \"count\": 6,\n", |
721 | | - " \"elapsed_ms\": 346\n", |
| 718 | + " \"elapsed_ms\": 497\n", |
| 719 | + " },\n", |
| 720 | + " {\n", |
| 721 | + " \"id\": 2,\n", |
| 722 | + " \"type\": \"AzureSearchQuery\",\n", |
| 723 | + " \"target_index\": \"earth_at_night\",\n", |
| 724 | + " \"query\": {\n", |
| 725 | + " \"search\": \"best practices for observing lava at night\"\n", |
| 726 | + " },\n", |
| 727 | + " \"query_time\": \"2025-05-06T15:44:00.571Z\",\n", |
| 728 | + " \"elapsed_ms\": 352\n", |
722 | 729 | " }\n", |
723 | 730 | "]\n", |
724 | 731 | "Results\n", |
|
0 commit comments