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
14 changes: 7 additions & 7 deletions nodejs/openai/sample-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"@microsoft/agents-a365-tooling": "^0.1.0-preview.30",
"@microsoft/agents-a365-tooling-extensions-openai": "^0.1.0-preview.30",
"@microsoft/agents-a365-observability-extensions-openai": "^0.1.0-preview.30",
"@openai/agents": "0.1.11",
"@openai/agents": "^0.1.11",
"openai": "^4.77.0",
"dotenv": "^17.2.2",
"express": "^5.1.0"
},
Expand All @@ -36,11 +37,10 @@
"rimraf": "^5.0.0",
"ts-node": "^10.9.2",
"typescript": "^5.9.2"
}
,
"pnpm": {
"overrides": {
"@openai/agents-core": "0.1.11"
}
},
"overrides": {
"@openai/agents-core": "$@openai/agents",
"@openai/agents-openai": "$@openai/agents",
"openai": "$openai"
}
}
5 changes: 5 additions & 0 deletions nodejs/openai/sample-agent/src/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

// IMPORTANT: Load environment variables FIRST before any other imports
// This ensures AZURE_OPENAI_* and other config is available when packages initialize
import { configDotenv } from 'dotenv';
configDotenv();

import { Agent, run } from '@openai/agents';
import { Authorization, TurnContext } from '@microsoft/agents-hosting';

Expand Down
5 changes: 4 additions & 1 deletion nodejs/openai/sample-agent/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

// Note: dotenv is loaded in agent.ts before AgentApplication is instantiated
// IMPORTANT: Load environment variables FIRST before any other imports
// This ensures all config is available when packages initialize at import time
import { configDotenv } from 'dotenv';
configDotenv();

import { AuthConfiguration, authorizeJWT, CloudAdapter, loadAuthConfigFromEnv, Request } from '@microsoft/agents-hosting';
import express, { Response } from 'express'
Expand Down