Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] fix: local debug environment variables location in teams chef bot sample #2240

Merged
merged 3 commits into from
Jan 8, 2025
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
4 changes: 2 additions & 2 deletions js/samples/04.ai-apps/a.teamsChefBot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ If you are using Azure OpenAI then follow these steps:
AZURE_OPENAI_ENDPOINT: ${{SECRET_AZURE_OPENAI_ENDPOINT}}
```

- Open `./infra/azure.bicep` and comment out lines 72-75 and uncomment lines 76-83.
- Open `./infra/azure.parameters.json` and replace lines 20-22 with:
- Open `./infra/azure.bicep` and comment out lines of 'OPENAI_KEY' section and uncomment lines of 'AZURE_OPENAI_KEY' and 'AZURE_OPENAI_ENDPOINT' sections.
- Open `./infra/azure.parameters.json` and replace lines of "openAIKey" section with:

```json
"azureOpenAIKey": {
Expand Down
1 change: 0 additions & 1 deletion js/samples/04.ai-apps/a.teamsChefBot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@microsoft/teams-ai": "~1.7.2",
"@microsoft/teams-js": "^2.32.0",
"botbuilder": "^4.23.1",
"dotenv": "^16.4.5",
corinagum marked this conversation as resolved.
Show resolved Hide resolved
"openai": "4.77.4",
"replace": "~1.2.0",
"restify": "~11.1.0",
Expand Down
11 changes: 3 additions & 8 deletions js/samples/04.ai-apps/a.teamsChefBot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

// Import required packages
import { config } from 'dotenv';
import * as path from 'path';
import * as restify from 'restify';

Expand All @@ -11,22 +10,18 @@ import * as restify from 'restify';
import { ConfigurationServiceClientCredentialFactory, MemoryStorage, TurnContext } from 'botbuilder';

import {
ActionPlanner,
AI,
Application,
ActionPlanner,
OpenAIModel,
PromptManager,
TurnState,
TeamsAdapter
TeamsAdapter,
TurnState
} from '@microsoft/teams-ai';

import { addResponseFormatter } from './responseFormatter';
import { VectraDataSource } from './VectraDataSource';

// Read botFilePath and botFileSecret from .env file.
const ENV_FILE = path.join(__dirname, '..', '.env');
config({ path: ENV_FILE });

// Create adapter.
// See https://aka.ms/about-bot-adapter to learn more about how bots work.
const adapter = new TeamsAdapter(
Expand Down
2 changes: 1 addition & 1 deletion js/samples/04.ai-apps/a.teamsChefBot/teamsapp.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ deploy:
# Provides the Teams Toolkit .env file values to the apps runtime so they can be accessed with `process.env`.
- uses: file/createOrUpdateEnvironmentFile
with:
target: ./.env
target: ./.localConfigs
corinagum marked this conversation as resolved.
Show resolved Hide resolved
envs:
BOT_ID: ${{BOT_ID}}
BOT_PASSWORD: ${{SECRET_BOT_PASSWORD}}
Expand Down
Loading