mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Removed DefaultAzureCredential (#490)
* Removed DefaultAzureCredential * Renamed ad_credential to credential
This commit is contained in:
committed by
GitHub
Unverified
parent
20d861076a
commit
fa88641263
@@ -4,7 +4,7 @@ import asyncio
|
||||
|
||||
from agent_framework.foundry import FoundryChatClient
|
||||
from agent_framework.openai import OpenAIChatClient
|
||||
from azure.identity.aio import DefaultAzureCredential
|
||||
from azure.identity.aio import AzureCliCredential
|
||||
|
||||
|
||||
async def suspend_resume_service_managed_thread() -> None:
|
||||
@@ -13,9 +13,11 @@ async def suspend_resume_service_managed_thread() -> None:
|
||||
|
||||
# Foundry Chat Client is used as an example here,
|
||||
# other chat clients can be used as well.
|
||||
# For authentication, run `az login` command in terminal or replace AzureCliCredential with preferred
|
||||
# authentication option.
|
||||
async with (
|
||||
DefaultAzureCredential() as credential,
|
||||
FoundryChatClient(async_ad_credential=credential).create_agent(
|
||||
AzureCliCredential() as credential,
|
||||
FoundryChatClient(async_credential=credential).create_agent(
|
||||
name="Joker", instructions="You are good at telling jokes."
|
||||
) as agent,
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user