-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
The sample provided in the Create and Manage Persistent Agents shows the following code:
async with (
AzureCliCredential() as credential,
AIProjectClient(
endpoint=os.environ["AZURE_AI_PROJECT_ENDPOINT"],
credential=credential
) as project_client,
):
# Create a persistent agent
created_agent = await project_client.agents.create_agent(
model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
name="PersistentAgent",
instructions="You are a helpful assistant."
)When trying this the create_agent method is not found for the project_client.agents.
After searching through the repository, it looks like the Provider-pattern should be used nowadays. Maybe the code is referring to an old version of the package?
When changing my code to use the provider pattern I get no squiglies anymore.:
async with AzureCliCredential() as credential:
async with AzureAIAgentsProvider(
credential=credential
) as provider:
calculator_agent = await provider.create_agent(
model=os.environ["AZURE_AI_MODEL_DEPLOYMENT_NAME"],
name="CalculatorAgent",
instructions="You are a helpful assistant."
)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels