Python: Added parameter to disable agent cleanup in AzureAIAgentClient (#1882)

* Removed automatic agent cleanup in AzureAIAgentClient

* Revert "Removed automatic agent cleanup in AzureAIAgentClient"

This reverts commit 89846c7212.

* Exposed boolean flag to control deletion behavior

* Update sample
This commit is contained in:
Dmytro Struk
2025-11-05 08:56:19 -08:00
committed by GitHub
Unverified
parent b03a4fb95e
commit 14aee7e334
3 changed files with 72 additions and 98 deletions
@@ -41,6 +41,7 @@ async def main() -> None:
model_deployment_name=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
async_credential=credential,
agent_name="WeatherAgent",
should_cleanup_agent=True, # Set to False if you want to disable automatic agent cleanup
),
instructions="You are a helpful weather agent.",
tools=get_weather,