Skip to content
Discussion options

You must be logged in to vote

Hi @UtkarshMishra-Microsoft, this behavior is by design, as the agents are designed to be persistent.

If you want to clean-up after the agent is used, then you can simply use the delete_agent() method, as described in the documentation

# Delete the agent when done
project_client.agents.delete_agent(agent.id)
print("Deleted agent")

An alternative approach is to check for the existence of the agent each time, and only create a new one if it doesn't already exist. There's a good example of how to do this in @nicholasdbrady's demo here. I've found this method works well for interactive chat apps, where the user may terminate the app unexpectedly.

AGENT_NAME = "my-enterprise-agent"
found_agen…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@UtkarshMishra-Microsoft
Comment options

Answer selected by leestott
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment