-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add custom copilot assistant with assistants api template (#10906)
* feat: add custom copilot assistant with assistants api template
- Loading branch information
Showing
69 changed files
with
2,793 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
templates/js/custom-copilot-assistant-assistants-api/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# TeamsFx files | ||
env/.env.*.user | ||
env/.env.local | ||
appPackage/build | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# misc | ||
.env | ||
.deployment | ||
.DS_Store | ||
|
||
# build | ||
lib/ | ||
|
||
# devTools | ||
devTools/ | ||
|
||
# Local data | ||
.localConfigs | ||
.localConfigs.testTool | ||
.notification.localstore.json | ||
.notification.testtoolstore.json |
5 changes: 5 additions & 0 deletions
5
templates/js/custom-copilot-assistant-assistants-api/.localConfigs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# A gitignored place holder file for local runtime configurations | ||
BOT_ID= | ||
BOT_PASSWORD= | ||
OPENAI_API_KEY= | ||
OPENAI_ASSISTANT_ID= |
6 changes: 6 additions & 0 deletions
6
templates/js/custom-copilot-assistant-assistants-api/.localConfigs.testTool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# A gitignored place holder file for local runtime configurations | ||
BOT_ID= | ||
BOT_PASSWORD= | ||
OPENAI_API_KEY= | ||
OPENAI_ASSISTANT_ID= | ||
TEAMSFX_NOTIFICATION_STORE_FILENAME=.notification.testtoolstore.json |
5 changes: 5 additions & 0 deletions
5
templates/js/custom-copilot-assistant-assistants-api/.vscode/extensions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"TeamsDevApp.ms-teams-vscode-extension" | ||
] | ||
} |
122 changes: 122 additions & 0 deletions
122
templates/js/custom-copilot-assistant-assistants-api/.vscode/launch.json.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Remote (Edge)", | ||
"type": "msedge", | ||
"request": "launch", | ||
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}", | ||
"presentation": { | ||
"group": "3-remote", | ||
"order": 1 | ||
}, | ||
"internalConsoleOptions": "neverOpen" | ||
}, | ||
{ | ||
"name": "Launch Remote (Chrome)", | ||
"type": "chrome", | ||
"request": "launch", | ||
"url": "https://teams.microsoft.com/l/app/${{TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}", | ||
"presentation": { | ||
"group": "3-remote", | ||
"order": 2 | ||
}, | ||
"internalConsoleOptions": "neverOpen" | ||
}, | ||
{ | ||
"name": "Launch App (Edge)", | ||
"type": "msedge", | ||
"request": "launch", | ||
"url": "https://teams.microsoft.com/l/app/${{local:TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}", | ||
"cascadeTerminateToConfigurations": [ | ||
"Attach to Local Service" | ||
], | ||
"presentation": { | ||
"group": "all", | ||
"hidden": true | ||
}, | ||
"internalConsoleOptions": "neverOpen" | ||
}, | ||
{ | ||
"name": "Launch App (Chrome)", | ||
"type": "chrome", | ||
"request": "launch", | ||
"url": "https://teams.microsoft.com/l/app/${{local:TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}", | ||
"cascadeTerminateToConfigurations": [ | ||
"Attach to Local Service" | ||
], | ||
"presentation": { | ||
"group": "all", | ||
"hidden": true | ||
}, | ||
"internalConsoleOptions": "neverOpen" | ||
}, | ||
{ | ||
"name": "Attach to Local Service", | ||
"type": "node", | ||
"request": "attach", | ||
"port": 9239, | ||
"restart": true, | ||
"presentation": { | ||
"group": "all", | ||
"hidden": true | ||
}, | ||
"internalConsoleOptions": "neverOpen" | ||
} | ||
], | ||
"compounds": [ | ||
{ | ||
"name": "Debug in Teams (Edge)", | ||
"configurations": [ | ||
"Launch App (Edge)", | ||
"Attach to Local Service" | ||
], | ||
"preLaunchTask": "Start Teams App Locally", | ||
"presentation": { | ||
{{#enableTestToolByDefault}} | ||
"group": "2-local", | ||
{{/enableTestToolByDefault}} | ||
{{^enableTestToolByDefault}} | ||
"group": "1-local", | ||
{{/enableTestToolByDefault}} | ||
"order": 1 | ||
}, | ||
"stopAll": true | ||
}, | ||
{ | ||
"name": "Debug in Teams (Chrome)", | ||
"configurations": [ | ||
"Launch App (Chrome)", | ||
"Attach to Local Service" | ||
], | ||
"preLaunchTask": "Start Teams App Locally", | ||
"presentation": { | ||
{{#enableTestToolByDefault}} | ||
"group": "2-local", | ||
{{/enableTestToolByDefault}} | ||
{{^enableTestToolByDefault}} | ||
"group": "1-local", | ||
{{/enableTestToolByDefault}} | ||
"order": 2 | ||
}, | ||
"stopAll": true | ||
}, | ||
{ | ||
"name": "Debug in Test Tool (Preview)", | ||
"configurations": [ | ||
"Attach to Local Service" | ||
], | ||
"preLaunchTask": "Start Teams App (Test Tool)", | ||
"presentation": { | ||
{{#enableTestToolByDefault}} | ||
"group": "1-local", | ||
{{/enableTestToolByDefault}} | ||
{{^enableTestToolByDefault}} | ||
"group": "2-local", | ||
{{/enableTestToolByDefault}} | ||
"order": 1 | ||
}, | ||
"stopAll": true | ||
} | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
templates/js/custom-copilot-assistant-assistants-api/.vscode/settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"debug.onTaskErrors": "abort", | ||
"json.schemas": [ | ||
{ | ||
"fileMatch": [ | ||
"/aad.*.json" | ||
], | ||
"schema": {} | ||
} | ||
] | ||
} |
204 changes: 204 additions & 0 deletions
204
templates/js/custom-copilot-assistant-assistants-api/.vscode/tasks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
// This file is automatically generated by Teams Toolkit. | ||
// The teamsfx tasks defined in this file require Teams Toolkit version >= 5.0.0. | ||
// See https://aka.ms/teamsfx-tasks for details on how to customize each task. | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Start Teams App (Test Tool)", | ||
"dependsOn": [ | ||
"Validate prerequisites (Test Tool)", | ||
"Deploy (Test Tool)", | ||
"Start application (Test Tool)", | ||
"Start Test Tool", | ||
], | ||
"dependsOrder": "sequence" | ||
}, | ||
{ | ||
// Check all required prerequisites. | ||
// See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args. | ||
"label": "Validate prerequisites (Test Tool)", | ||
"type": "teamsfx", | ||
"command": "debug-check-prerequisites", | ||
"args": { | ||
"prerequisites": [ | ||
"nodejs", // Validate if Node.js is installed. | ||
"portOccupancy" // Validate available ports to ensure those debug ones are not occupied. | ||
], | ||
"portOccupancy": [ | ||
3978, // app service port | ||
9239, // app inspector port for Node.js debugger | ||
56150, // test tool port | ||
] | ||
} | ||
}, | ||
{ | ||
// Build project. | ||
// See https://aka.ms/teamsfx-tasks/deploy to know the details and how to customize the args. | ||
"label": "Deploy (Test Tool)", | ||
"type": "teamsfx", | ||
"command": "deploy", | ||
"args": { | ||
"env": "testtool", | ||
} | ||
}, | ||
{ | ||
"label": "Start application (Test Tool)", | ||
"type": "shell", | ||
"command": "npm run dev:teamsfx:testtool", | ||
"isBackground": true, | ||
"options": { | ||
"cwd": "${workspaceFolder}", | ||
}, | ||
"problemMatcher": { | ||
"pattern": [ | ||
{ | ||
"regexp": "^.*$", | ||
"file": 0, | ||
"location": 1, | ||
"message": 2 | ||
} | ||
], | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": "[nodemon] starting", | ||
"endsPattern": "restify listening to|Bot/ME service listening at|[nodemon] app crashed" | ||
} | ||
} | ||
}, | ||
{ | ||
"label": "Start Test Tool", | ||
"type": "shell", | ||
"command": "npm run dev:teamsfx:launch-testtool", | ||
"isBackground": true, | ||
"options": { | ||
"env": { | ||
"PATH": "${workspaceFolder}/devTools/teamsapptester/node_modules/.bin:${env:PATH}" | ||
} | ||
}, | ||
"windows": { | ||
"options": { | ||
"env": { | ||
"PATH": "${workspaceFolder}/devTools/teamsapptester/node_modules/.bin;${env:PATH}" | ||
} | ||
} | ||
}, | ||
"problemMatcher": { | ||
"pattern": [ | ||
{ | ||
"regexp": "^.*$", | ||
"file": 0, | ||
"location": 1, | ||
"message": 2 | ||
} | ||
], | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": ".*", | ||
"endsPattern": "Listening on" | ||
} | ||
}, | ||
"presentation": { | ||
"panel": "dedicated", | ||
"reveal": "silent" | ||
} | ||
}, | ||
{ | ||
"label": "Start Teams App Locally", | ||
"dependsOn": [ | ||
"Validate prerequisites", | ||
"Start local tunnel", | ||
"Provision", | ||
"Deploy", | ||
"Start application" | ||
], | ||
"dependsOrder": "sequence" | ||
}, | ||
{ | ||
// Check all required prerequisites. | ||
// See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args. | ||
"label": "Validate prerequisites", | ||
"type": "teamsfx", | ||
"command": "debug-check-prerequisites", | ||
"args": { | ||
"prerequisites": [ | ||
"nodejs", // Validate if Node.js is installed. | ||
"m365Account", // Sign-in prompt for Microsoft 365 account, then validate if the account enables the sideloading permission. | ||
"portOccupancy" // Validate available ports to ensure those debug ones are not occupied. | ||
], | ||
"portOccupancy": [ | ||
3978, // app service port | ||
9239 // app inspector port for Node.js debugger | ||
] | ||
} | ||
}, | ||
{ | ||
// Start the local tunnel service to forward public URL to local port and inspect traffic. | ||
// See https://aka.ms/teamsfx-tasks/local-tunnel for the detailed args definitions. | ||
"label": "Start local tunnel", | ||
"type": "teamsfx", | ||
"command": "debug-start-local-tunnel", | ||
"args": { | ||
"type": "dev-tunnel", | ||
"ports": [ | ||
{ | ||
"portNumber": 3978, | ||
"protocol": "http", | ||
"access": "public", | ||
"writeToEnvironmentFile": { | ||
"endpoint": "BOT_ENDPOINT", // output tunnel endpoint as BOT_ENDPOINT | ||
"domain": "BOT_DOMAIN" // output tunnel domain as BOT_DOMAIN | ||
} | ||
} | ||
], | ||
"env": "local" | ||
}, | ||
"isBackground": true, | ||
"problemMatcher": "$teamsfx-local-tunnel-watch" | ||
}, | ||
{ | ||
// Create the debug resources. | ||
// See https://aka.ms/teamsfx-tasks/provision to know the details and how to customize the args. | ||
"label": "Provision", | ||
"type": "teamsfx", | ||
"command": "provision", | ||
"args": { | ||
"env": "local" | ||
} | ||
}, | ||
{ | ||
// Build project. | ||
// See https://aka.ms/teamsfx-tasks/deploy to know the details and how to customize the args. | ||
"label": "Deploy", | ||
"type": "teamsfx", | ||
"command": "deploy", | ||
"args": { | ||
"env": "local" | ||
} | ||
}, | ||
{ | ||
"label": "Start application", | ||
"type": "shell", | ||
"command": "npm run dev:teamsfx", | ||
"isBackground": true, | ||
"options": { | ||
"cwd": "${workspaceFolder}" | ||
}, | ||
"problemMatcher": { | ||
"pattern": [ | ||
{ | ||
"regexp": "^.*$", | ||
"file": 0, | ||
"location": 1, | ||
"message": 2 | ||
} | ||
], | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": "[nodemon] starting", | ||
"endsPattern": "restify listening to|Bot/ME service listening at|[nodemon] app crashed" | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.