Commit ce7b5b1
Python: Fix
* Fix as_agent() not defaulting name/description from client properties
AzureAIClient.as_agent() and AzureAIAgentClient.as_agent() now fall back
to self.agent_name and self.agent_description when name/description are
not explicitly passed. This ensures Agent.name is populated for
telemetry spans without requiring callers to repeat the name.
Fixes #4471
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address review: use is None checks instead of truthiness
Switch from name or self.agent_name to explicit is None checks so
that callers can intentionally pass empty strings without them being
replaced by client defaults. Added edge-case tests for empty strings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update docstrings to document name/description defaulting behavior
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>as_agent() not defaulting name/description from client properties (#4484)1 parent 8bf4235 commit ce7b5b1
File tree
4 files changed
+94
-8
lines changed- python/packages/azure-ai
- agent_framework_azure_ai
- tests
4 files changed
+94
-8
lines changedLines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1461 | 1461 | | |
1462 | 1462 | | |
1463 | 1463 | | |
1464 | | - | |
1465 | | - | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
1466 | 1467 | | |
1467 | 1468 | | |
1468 | 1469 | | |
| |||
1475 | 1476 | | |
1476 | 1477 | | |
1477 | 1478 | | |
1478 | | - | |
1479 | | - | |
| 1479 | + | |
| 1480 | + | |
1480 | 1481 | | |
1481 | 1482 | | |
1482 | 1483 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1189 | 1189 | | |
1190 | 1190 | | |
1191 | 1191 | | |
1192 | | - | |
1193 | | - | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
1194 | 1195 | | |
1195 | 1196 | | |
1196 | 1197 | | |
| |||
1203 | 1204 | | |
1204 | 1205 | | |
1205 | 1206 | | |
1206 | | - | |
1207 | | - | |
| 1207 | + | |
| 1208 | + | |
1208 | 1209 | | |
1209 | 1210 | | |
1210 | 1211 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
512 | 554 | | |
513 | 555 | | |
514 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
549 | 591 | | |
550 | 592 | | |
551 | 593 | | |
| |||
0 commit comments