Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agent-samples/openai/OpenAIAssistants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ model:
topP: 0.95
connection:
kind: ApiKey
key: =Env.OPENAI_APIKEY
key: =Env.OPENAI_API_KEY
outputSchema:
properties:
language:
Expand Down
2 changes: 1 addition & 1 deletion agent-samples/openai/OpenAIChat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ model:
topP: 0.95
connection:
kind: ApiKey
key: =Env.OPENAI_APIKEY
key: =Env.OPENAI_API_KEY
outputSchema:
properties:
language:
Expand Down
2 changes: 1 addition & 1 deletion agent-samples/openai/OpenAIResponses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ model:
topP: 0.95
connection:
kind: ApiKey
key: =Env.OPENAI_APIKEY
key: =Env.OPENAI_API_KEY
outputSchema:
properties:
language:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using OpenAI;

var endpoint = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_OPENAI_ENDPOINT") ?? throw new InvalidOperationException("AZURE_FOUNDRY_OPENAI_ENDPOINT is not set.");
var apiKey = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_OPENAI_APIKEY");
var apiKey = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_OPENAI_API_KEY");
var model = Environment.GetEnvironmentVariable("AZURE_FOUNDRY_MODEL_DEPLOYMENT") ?? "Phi-4-mini-instruct";

// Since we are using the OpenAI Client SDK, we need to override the default endpoint to point to Azure Foundry.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Set the following environment variables:
$env:AZURE_FOUNDRY_OPENAI_ENDPOINT="https://ai-foundry-<myresourcename>.services.ai.azure.com/openai/v1/"

# Optional, defaults to using Azure CLI for authentication if not provided
$env:AZURE_FOUNDRY_OPENAI_APIKEY="************"
$env:AZURE_FOUNDRY_OPENAI_API_KEY="************"

# Optional, defaults to Phi-4-mini-instruct
$env:AZURE_FOUNDRY_MODEL_DEPLOYMENT="Phi-4-mini-instruct"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.Agents.AI;
using OpenAI;

var apiKey = Environment.GetEnvironmentVariable("OPENAI_APIKEY") ?? throw new InvalidOperationException("OPENAI_APIKEY is not set.");
var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set.");
var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini";

const string JokerName = "Joker";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Before you begin, ensure you have the following prerequisites:
Set the following environment variables:

```powershell
$env:OPENAI_APIKEY="*****" # Replace with your OpenAI API key
$env:OPENAI_API_KEY="*****" # Replace with your OpenAI API key
$env:OPENAI_MODEL="gpt-4o-mini" # Optional, defaults to gpt-4o-mini
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Extensions.AI;
using OpenAI;

var apiKey = Environment.GetEnvironmentVariable("OPENAI_APIKEY") ?? throw new InvalidOperationException("OPENAI_APIKEY is not set.");
var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set.");
var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini";

AIAgent agent = new OpenAIClient(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Before you begin, ensure you have the following prerequisites:
Set the following environment variables:

```powershell
$env:OPENAI_APIKEY="*****" # Replace with your OpenAI api key
$env:OPENAI_API_KEY="*****" # Replace with your OpenAI api key
$env:OPENAI_MODEL="gpt-4o-mini" # Optional, defaults to gpt-4o-mini
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.Agents.AI;
using OpenAI;

var apiKey = Environment.GetEnvironmentVariable("OPENAI_APIKEY") ?? throw new InvalidOperationException("OPENAI_APIKEY is not set.");
var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set.");
var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-4o-mini";

AIAgent agent = new OpenAIClient(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Before you begin, ensure you have the following prerequisites:
Set the following environment variables:

```powershell
$env:OPENAI_APIKEY="*****" # Replace with your OpenAI api key
$env:OPENAI_API_KEY="*****" # Replace with your OpenAI api key
$env:OPENAI_MODEL="gpt-4o-mini" # Optional, defaults to gpt-4o-mini
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using OpenAI;
using OpenAI.Responses;

var apiKey = Environment.GetEnvironmentVariable("OPENAI_APIKEY") ?? throw new InvalidOperationException("OPENAI_APIKEY is not set.");
var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") ?? throw new InvalidOperationException("OPENAI_API_KEY is not set.");
var model = Environment.GetEnvironmentVariable("OPENAI_MODEL") ?? "gpt-5";

var client = new OpenAIClient(apiKey)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
.AsIChatClient("claude-sonnet-4-20250514");

IChatClient openai = new OpenAI.OpenAIClient(
Environment.GetEnvironmentVariable("OPENAI_APIKEY")!).GetChatClient("gpt-4o-mini")
Environment.GetEnvironmentVariable("OPENAI_API_KEY")!).GetChatClient("gpt-4o-mini")
.AsIChatClient();

// Define our agents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ internal static class PromptAgents
topP: 0.95
connection:
kind: apiKey
key: =Env.OPENAI_APIKEY
key: =Env.OPENAI_API_KEY
outputSchema:
properties:
language:
Expand Down
2 changes: 1 addition & 1 deletion python/samples/getting_started/declarative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ model:
Each sample can be run independently. Make sure you have the required environment variables set:

- For Azure samples: Ensure you're logged in via Azure CLI (`az login`)
- For OpenAI samples: Set `OPENAI_APIKEY` environment variable
- For OpenAI samples: Set `OPENAI_API_KEY` environment variable

```bash
# Run a specific sample
Expand Down
Loading