File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
integrations/microsoft-agent-framework/python/examples/agents Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 4444print (f"AZURE_CLIENT_ID: { 'SET' if os .getenv ('AZURE_CLIENT_ID' ) else 'MISSING' } " )
4545print (f"AZURE_TENANT_ID: { 'SET' if os .getenv ('AZURE_TENANT_ID' ) else 'MISSING' } " )
4646print (f"AZURE_CLIENT_SECRET: { 'SET' if os .getenv ('AZURE_CLIENT_SECRET' ) else 'MISSING' } " )
47+ print (f"OPENAI_API_KEY: { 'SET' if os .getenv ('OPENAI_API_KEY' ) else 'MISSING' } " )
4748
4849# Resolve deployment name with fallback to support both Python and .NET env var naming
4950deployment_name = os .getenv ("AZURE_OPENAI_CHAT_DEPLOYMENT_NAME" )
5859else :
5960 print ("WARNING: AZURE_OPENAI_ENDPOINT not set" )
6061
62+ api_key = os .getenv ("OPENAI_API_KEY" )
63+
6164# Create a shared chat client for all agents
6265# You can use different chat clients for different agents:
6366
7174
7275# If using api_key authentication remove the credential parameter
7376# Explicitly pass deployment_name to align with .NET behavior and support both env var names
74- chat_client = AzureOpenAIChatClient (
75- credential = DefaultAzureCredential (),
76- deployment_name = deployment_name ,
77- endpoint = endpoint ,
77+ chat_client = OpenAIChatClient (
78+ model_id = deployment_name ,
79+ api_key = api_key ,
7880)
7981
8082# Agentic Chat - simple_agent
You can’t perform that action at this time.
0 commit comments