diff --git a/samples/da-CareerCoach/.gitignore b/samples/da-CareerCoach/.gitignore new file mode 100644 index 0000000..e567799 --- /dev/null +++ b/samples/da-CareerCoach/.gitignore @@ -0,0 +1,13 @@ +# TeamsFx files +env/.env.*.user +env/.env.local +.localConfigs +appPackage/build + +# dependencies +node_modules/ + +# misc +.env +.deployment +.DS_Store diff --git a/samples/da-CareerCoach/.vscode/extensions.json b/samples/da-CareerCoach/.vscode/extensions.json new file mode 100644 index 0000000..aac0a6e --- /dev/null +++ b/samples/da-CareerCoach/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "TeamsDevApp.ms-teams-vscode-extension" + ] +} diff --git a/samples/da-CareerCoach/.vscode/launch.json b/samples/da-CareerCoach/.vscode/launch.json new file mode 100644 index 0000000..de1b02e --- /dev/null +++ b/samples/da-CareerCoach/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Preview in Copilot (Edge)", + "type": "msedge", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 1 + }, + "internalConsoleOptions": "neverOpen" + }, + { + "name": "Preview in Copilot (Chrome)", + "type": "chrome", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 2 + }, + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/samples/da-CareerCoach/.vscode/settings.json b/samples/da-CareerCoach/.vscode/settings.json new file mode 100644 index 0000000..4299620 --- /dev/null +++ b/samples/da-CareerCoach/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "debug.onTaskErrors": "abort", + "json.schemas": [ + { + "fileMatch": [ + "/aad.*.json" + ], + "schema": {} + } + ] +} diff --git a/samples/da-CareerCoach/README.md b/samples/da-CareerCoach/README.md new file mode 100644 index 0000000..3ea41d4 --- /dev/null +++ b/samples/da-CareerCoach/README.md @@ -0,0 +1,55 @@ +# Overview of the Career Coach declarative agent sample +![CareerCoach Start Screen](assets/CareerCoach1.png) + +The "Career Coach" Declarative Agent is an open-source AI-driven tool designed to assist professionals in their career development. This agent provides personalized suggestions and actionable plans to help users learn and grow in their careers. By leveraging data such as the user's current role, skills, and career aspirations, the Career Coach offers tailored advice on skill development, learning opportunities, and career transitions. It maintains a professional and supportive tone, ensuring that interactions are contextual and relevant. The agent integrates with OneDrive, SharePoint, and Graph Connectors to enhance its capabilities. Key features include creating detailed career development plans, performing skill gap analyses, recommending learning resources, and offering networking strategies. This open-source project aims to empower individuals to achieve their career goals through structured guidance and support. + + +## Build a basic declarative agent + +With the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot. + +## Get started with the template + +> **Prerequisites** +> +> To run this app template in your local dev machine, you will need: +> +> - [Node.js](https://nodejs.org/), supported versions: 16, 18 +> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts). +> - [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli) +> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites) + +![CareerCoach in Action](assets/CareerCoach2.png) + +1. First, select the Teams Toolkit icon on the left in the VS Code toolbar. +2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already. +3. Create Teams app by clicking `Provision` in "Lifecycle" section. +4. Select `Preview in Copilot (Edge)` or `Preview in Copilot (Chrome)` from the launch configuration dropdown. +5. Once the Copilot app is loaded in the browser, click on the "…" menu and select "Copilot chats". You will see your declarative agent on the right rail. Clicking on it will change the experience to showcase the logo and name of your declarative agent. +6. Ask a question to your declarative agent and it should respond based on the instructions provided. + +## What's included in the template + +| Folder | Contents | +| ------------ | ---------------------------------------------------------------------------------------- | +| `.vscode` | VSCode files for debugging | +| `appPackage` | Templates for the Teams application manifest, the GPT manifest and the API specification | +| `env` | Environment files | + +The following files can be customized and demonstrate an example implementation to get you started. + +| File | Contents | +| ------------------------------------ | ------------------------------------------------------------------------------ | +| `appPackage/declarativeAgent.json` | Define the behaviour and configurations of the declarative agent. | +| `appPackage/instruction.txt` | Specific instruction for the declarative agent. In a TXT file for ease of edition automatically scafold by TTK when solution is provisionned. | +| `appPackage/manifest.json` | Teams application manifest that defines metadata for your declarative agent. | + +The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works. + +| File | Contents | +| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `teamsapp.yml` | This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. | + +## Addition information and references + +- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent) diff --git a/samples/da-CareerCoach/appPackage/color.png b/samples/da-CareerCoach/appPackage/color.png new file mode 100644 index 0000000..18cb2b6 Binary files /dev/null and b/samples/da-CareerCoach/appPackage/color.png differ diff --git a/samples/da-CareerCoach/appPackage/declarativeAgent.json b/samples/da-CareerCoach/appPackage/declarativeAgent.json new file mode 100644 index 0000000..0412597 --- /dev/null +++ b/samples/da-CareerCoach/appPackage/declarativeAgent.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://aka.ms/json-schemas/copilot/declarative-agent/v1.0/schema.json", + "version": "v1.0", + "name": "Career Coach", + "description": "Career Coach is a declarative Agent that provides professionals with personalized suggestions on how they can continue to learn and grow in their careers.", + "instructions": "$[file('instruction.txt')]", + "capabilities": [ + { + "name": "OneDriveAndSharePoint" + }, + { + "name": "GraphConnectors" + } + ], + "conversation_starters": [ + { + "title": "Career development plan", + "text": "Help me create a detailed career development plan based on my current role and future goals." + }, + { + "title": "Skill gap analysis", + "text": "Analyze my current skills and identify any gaps that I need to fill to advance in my career." + }, + { + "title": "Learning opportunities", + "text": "What courses, certifications, or workshops would you recommend for someone in my role to grow professionally?" + }, + { + "title": "Career transition advice", + "text": "I am considering a career transition. How can I make this change successfully?" + }, + { + "title": "Networking strategies", + "text": "How can I leverage my professional network to help?" + }, + { + "title": "Performance improvement", + "text": "How can I improve my performance in my current role to prepare for future opportunities?" + } + ] +} \ No newline at end of file diff --git a/samples/da-CareerCoach/appPackage/instruction.txt b/samples/da-CareerCoach/appPackage/instruction.txt new file mode 100644 index 0000000..e1d5acf --- /dev/null +++ b/samples/da-CareerCoach/appPackage/instruction.txt @@ -0,0 +1,22 @@ +Purpose: +You are an expert Career Coach. Your role is to provide professionals with personalized suggestions on how they can continue to learn and grow in their careers. + +Goals: +* Understand user's current role: You will use all available data such as user's title and other corporate information to learn about the user current role and provide that as a first response. You will tailor your advice based on the user current role, considering the future steps that are possible in their career path, and help them create a plan of action. Start by asking the user to describe their current role, including their responsibilities, skills, and any challenges they face. +* Identify Career Goals: Ask the user about their short-term and long-term career goals. What positions or roles are they aiming for in the future? +* Assess Skills and Gaps: Evaluate the skills the user currently possesses and identify any gaps that need to be filled to achieve their career goals. +* Suggest Learning Opportunities: Provide recommendations using internal resources for courses, certifications, workshops, or other learning opportunities that can help the user acquire the necessary skills and ensure these are tailored to the user. +* Create a Plan of Action: Help the user develop a step-by-step plan to achieve their career goals. This plan should include specific actions, timelines, and milestones. Start by asking the user to describe their current role and career aspirations. If asked to provide a detailed career development plan, always provide a very detailed plan with Immediate Actions, Next 3 Months, Next 6 Months, Next 1-2 Years and Ongoing. +* Career transition: When asked to give career transition advice, your first question should be: What new position is the user looking to achieve? Your second question should be: In what timeframe? Based on the answers, create a detailed career transition plan that aligns with the specified timeframe. Your response should include a Company Support section that includes specific company information and links to documents on how the company will support career transitions. + +Overall direction: +* Always make your responses contextual and relevant to the role the user is currently working on, or the types of roles I want to work in. +* Never overwhelm me with multiple questions at once. +* Make sure to ask clarifying and follow-up questions. +* Always be encouraging. +* Maintain a professional and supportive tone throughout our interactions. +* Keep context across the entire conversation, ensuring that the ideas and responses are related to all the previous turns of conversation. +* After discussing each subtopic, you will ask if I have any follow-up questions or need any further help. +* If greeted or asked what you can do, please briefly explain your purpose. Keep it concise and to the point, giving some short examples. +* If you are asked to answer questions unrelated to your purpose, you can answer but try to get the user back to focus on your purpose and goals. Always try to keep the focus of the conversation about career and career progression. +* At end of each conversation ask how you did and encourage the use of the thumbs up or down option for feedback. \ No newline at end of file diff --git a/samples/da-CareerCoach/appPackage/manifest.json b/samples/da-CareerCoach/appPackage/manifest.json new file mode 100644 index 0000000..4bdd792 --- /dev/null +++ b/samples/da-CareerCoach/appPackage/manifest.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json", + "manifestVersion": "1.19", + "version": "1.0.0", + "id": "${{TEAMS_APP_ID}}", + "developer": { + "name": "Teams App, Inc.", + "websiteUrl": "https://www.example.com", + "privacyUrl": "https://www.example.com/privacy", + "termsOfUseUrl": "https://www.example.com/termofuse" + }, + "icons": { + "color": "color.png", + "outline": "outline.png" + }, + "name": { + "short": "Career Coach", + "full": "Career Coach" + }, + "description": { + "short": "Elevate your career with Career Coach", + "full": "Career Coach is designed to guide you through every step of your professional journey. Whether you're looking to advance in your current role, explore new opportunities, or bridge skill gaps, Career Coach provides personalized, actionable advice tailored to your unique career path. Career Coach is designed to work with Microsoft 365 Copilot." + }, + "accentColor": "#FFFFFF", + "composeExtensions": [], + "permissions": [ + "identity", + "messageTeamMembers" + ], + "copilotAgents": { + "declarativeAgents": [ + { + "id": "declarativeAgent", + "file": "declarativeAgent.json" + } + ] + }, + "validDomains": [] +} \ No newline at end of file diff --git a/samples/da-CareerCoach/appPackage/outline.png b/samples/da-CareerCoach/appPackage/outline.png new file mode 100644 index 0000000..7a54e1a Binary files /dev/null and b/samples/da-CareerCoach/appPackage/outline.png differ diff --git a/samples/da-CareerCoach/assets/CareerCoach1.png b/samples/da-CareerCoach/assets/CareerCoach1.png new file mode 100644 index 0000000..3f20e8d Binary files /dev/null and b/samples/da-CareerCoach/assets/CareerCoach1.png differ diff --git a/samples/da-CareerCoach/assets/CareerCoach2.png b/samples/da-CareerCoach/assets/CareerCoach2.png new file mode 100644 index 0000000..567351d Binary files /dev/null and b/samples/da-CareerCoach/assets/CareerCoach2.png differ diff --git a/samples/da-CareerCoach/assets/sample.json b/samples/da-CareerCoach/assets/sample.json new file mode 100644 index 0000000..f963fd0 --- /dev/null +++ b/samples/da-CareerCoach/assets/sample.json @@ -0,0 +1,68 @@ +[ + { + "name": "pnp-copilot-pro-dev-CareerCoach", + "source": "pnp", + "title": "Career Coach Declarative Agent for Microsoft 365 Copilot Sample", + "shortDescription": "First Party Declarative Agent Career Coach shared as a sample", + "url": "https://github.com/pnp/copilot-pro-dev-samples/tree/main/samples/da-repairs-oauth", + "downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/copilot-pro-dev-samples/tree/main/samples/da-repairs-oauth", + "longDescription": [ + "The \"Career Coach\" Declarative Agent is an open-source AI-driven tool designed to assist professionals in their career development. This agent provides personalized suggestions and actionable plans to help users learn and grow in their careers. By leveraging data such as the user's current role, skills, and career aspirations, the Career Coach offers tailored advice on skill development, learning opportunities, and career transitions. It maintains a professional and supportive tone, ensuring that interactions are contextual and relevant. The agent integrates with OneDrive, SharePoint, and Graph Connectors to enhance its capabilities. Key features include creating detailed career development plans, performing skill gap analyses, recommending learning resources, and offering networking strategies. This open-source project aims to empower individuals to achieve their career goals through structured guidance and support. With the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot. To run this app template in your local dev machine, you will need Node.js (supported versions: 16, 18), a Microsoft 365 account for development, Teams Toolkit Visual Studio Code Extension version 5.0.0 and higher or Teams Toolkit CLI, and a Microsoft 365 Copilot license. First, select the Teams Toolkit icon on the left in the VS Code toolbar. In the Account section, sign in with your Microsoft 365 account if you haven't already. Create Teams app by clicking `Provision` in \"Lifecycle\" section. Select `Preview in Copilot (Edge)` or `Preview" + ], + "creationDateTime": "2024-10-04", + "updateDateTime": "2024-10-04", + "products": [ + "Microsoft 365 Copilot" + ], + "metadata": [ + { + "key": "PLATFORM", + "value": "Node.js" + }, + { + "key": "LANGUAGE", + "value": "TypeScript" + }, + { + "key": "API-PLUGIN", + "value": "Yes" + }, + { + "key": "GRAPH-CONNECTOR", + "value": "No" + } + ], + "thumbnails": [ + { + "type": "image", + "order": 100, + "url": "https://github.com/pnp/copilot-pro-dev-samples/raw/main/samples/da-repairs-oauth/assets/screenshot.png", + "alt": "Declarative agent answering questions about repairs using the information from an API secured with OAuth" + } + ], + "authors": [ + { + "gitHubAccount": "waldekmastykarz", + "pictureUrl": "https://github.com/waldekmastykarz.png", + "name": "Waldek Mastykarz" + } + ], + "references": [ + { + "name": "Microsoft 365 Copilot extensibility", + "description": "Learn more about what Microsoft 365 Copilot and how you can extend it.", + "url": "https://learn.microsoft.com/microsoft-365-copilot/extensibility/" + }, + { + "name": "Declarative agents for Microsoft 365 Copilot overview", + "description": "Learn more about what declarative agents for Microsoft 365 Copilot are.", + "url": "https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-declarative-agent" + }, + { + "name": "Build a declarative agent for Microsoft 365 Copilot", + "description": "Learn how to build a declarative agent for Microsoft 365 Copilot.", + "url": "https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents" + } + ] + } + ] \ No newline at end of file diff --git a/samples/da-CareerCoach/env/.env.dev b/samples/da-CareerCoach/env/.env.dev new file mode 100644 index 0000000..c53ffe2 --- /dev/null +++ b/samples/da-CareerCoach/env/.env.dev @@ -0,0 +1,8 @@ +# This file includes environment variables that will be committed to git by default. + +# Built-in environment variables +TEAMSFX_ENV=dev +APP_NAME_SUFFIX=dev + +# Generated during provision, you can also add your own variables. +TEAMS_APP_ID= \ No newline at end of file diff --git a/samples/da-CareerCoach/teamsapp.yml b/samples/da-CareerCoach/teamsapp.yml new file mode 100644 index 0000000..ccef0c8 --- /dev/null +++ b/samples/da-CareerCoach/teamsapp.yml @@ -0,0 +1,81 @@ +# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json +# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file +# Visit https://aka.ms/teamsfx-actions for details on actions +version: v1.7 + +environmentFolderPath: ./env + +# Triggered when 'teamsapp provision' is executed +provision: + # Creates a Teams app + - uses: teamsApp/create + with: + # Teams app name + name: Career Coach${{APP_NAME_SUFFIX}} + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + teamsAppId: TEAMS_APP_ID + + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your Teams app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 + with: + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID + +# Triggered when 'teamsapp publish' is executed +publish: + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Publish the app to + # Teams Admin Center (https://admin.teams.microsoft.com/policies/manage-apps) + # for review and approval + - uses: teamsApp/publishAppPackage + with: + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + publishedAppId: TEAMS_APP_PUBLISHED_APP_ID +projectId: cd59d156-059c-499a-a296-c8a794c20ceb diff --git a/samples/da-IdeaCoach/.gitignore b/samples/da-IdeaCoach/.gitignore new file mode 100644 index 0000000..e567799 --- /dev/null +++ b/samples/da-IdeaCoach/.gitignore @@ -0,0 +1,13 @@ +# TeamsFx files +env/.env.*.user +env/.env.local +.localConfigs +appPackage/build + +# dependencies +node_modules/ + +# misc +.env +.deployment +.DS_Store diff --git a/samples/da-IdeaCoach/.vscode/extensions.json b/samples/da-IdeaCoach/.vscode/extensions.json new file mode 100644 index 0000000..aac0a6e --- /dev/null +++ b/samples/da-IdeaCoach/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "TeamsDevApp.ms-teams-vscode-extension" + ] +} diff --git a/samples/da-IdeaCoach/.vscode/launch.json b/samples/da-IdeaCoach/.vscode/launch.json new file mode 100644 index 0000000..de1b02e --- /dev/null +++ b/samples/da-IdeaCoach/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Preview in Copilot (Edge)", + "type": "msedge", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 1 + }, + "internalConsoleOptions": "neverOpen" + }, + { + "name": "Preview in Copilot (Chrome)", + "type": "chrome", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 2 + }, + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/samples/da-IdeaCoach/.vscode/settings.json b/samples/da-IdeaCoach/.vscode/settings.json new file mode 100644 index 0000000..4299620 --- /dev/null +++ b/samples/da-IdeaCoach/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "debug.onTaskErrors": "abort", + "json.schemas": [ + { + "fileMatch": [ + "/aad.*.json" + ], + "schema": {} + } + ] +} diff --git a/samples/da-IdeaCoach/README.md b/samples/da-IdeaCoach/README.md new file mode 100644 index 0000000..48591c8 --- /dev/null +++ b/samples/da-IdeaCoach/README.md @@ -0,0 +1,63 @@ +# Overview of the Idea Coach declarative agent sample +![IdeaCoach Start Screen](assets/IdeaCoach1.png) + +The "Idea Coach" Declarative Agent is an open-source AI-driven tool designed to facilitate and enhance brainstorming sessions. This agent acts as a personal assistant, helping users to brainstorm topics, plan sessions, find creative exercises, organize ideas, and improve their brainstorming skills. The Idea Coach uses a fun, collaborative tone to inspire creativity and ensure that interactions are engaging and productive. + +Key features of the Idea Coach include: +- **Brainstorm a Topic**: Acts as a session host to help brainstorm about a topic, asking questions one by one to create a multi-turn conversation flow. +- **Planning a Brainstorming Session**: Customizes the agenda to specific objectives by asking sequential questions to gather the right context. Provides detailed, creative suggestions for topics and activities, and formats the agenda in tabular form. +- **Helping Find Creative Exercises**: Proposes at least three exercises based on the user's objectives, number of attendees, and duration. +- **Idea Organization**: Suggests tools and techniques to help prioritize ideas from the brainstorming session without bias. +- **Feedback and Improvement**: Gathers feedback on the session, identifies pain points, and provides structured solutions for improvement. +- **Training and Development**: Assesses the user's skills and provides a training plan to help them grow in brainstorming sessions. +- **Assess My Skills**: Evaluates the user's skills through a series of questions and offers a direct assessment, followed by a training plan if desired. + +The Idea Coach integrates with OneDrive, SharePoint, and Graph Connectors to enhance its capabilities. It ensures that conversations are contextual and relevant, asking additional questions where necessary to clarify and confirm understanding. At the end of each interaction, the agent asks for feedback and encourages the use of the thumbs up and down feature in Copilot. + +This open-source project aims to empower individuals and teams to achieve their brainstorming goals through structured guidance and support. By providing a customizable and extensible framework, the Idea Coach Declarative Agent can be adapted to various professional contexts and user needs, making it a versatile tool for fostering creativity and innovation. + +## Get started with the template + +> **Prerequisites** +> +> To run this app template in your local dev machine, you will need: +> +> - [Node.js](https://nodejs.org/), supported versions: 16, 18 +> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts). +> - [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli) +> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites) + +![IdeaCoach in Action](assets/IdeaCoach2.png) + + +1. First, select the Teams Toolkit icon on the left in the VS Code toolbar. +2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already. +3. Create Teams app by clicking `Provision` in "Lifecycle" section. +4. Select `Preview in Copilot (Edge)` or `Preview in Copilot (Chrome)` from the launch configuration dropdown. +5. Once the Copilot app is loaded in the browser, click on the "…" menu and select "Copilot chats". You will see your declarative agent on the right rail. Clicking on it will change the experience to showcase the logo and name of your declarative agent. +6. Ask a question to your declarative agent and it should respond based on the instructions provided. + +## What's included in the template + +| Folder | Contents | +| ------------ | ---------------------------------------------------------------------------------------- | +| `.vscode` | VSCode files for debugging | +| `appPackage` | Templates for the Teams application manifest, the GPT manifest and the API specification | +| `env` | Environment files | + +The following files can be customized and demonstrate an example implementation to get you started. + +| File | Contents | +| ------------------------------------ | ------------------------------------------------------------------------------ | +| `appPackage/declarativeAgent.json` | Define the behaviour and configurations of the declarative agent. | +| `appPackage/manifest.json` | Teams application manifest that defines metadata for your declarative agent. | + +The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works. + +| File | Contents | +| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `teamsapp.yml` | This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. | + +## Addition information and references + +- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent) diff --git a/samples/da-IdeaCoach/appPackage/color.png b/samples/da-IdeaCoach/appPackage/color.png new file mode 100644 index 0000000..3ff83c1 Binary files /dev/null and b/samples/da-IdeaCoach/appPackage/color.png differ diff --git a/samples/da-IdeaCoach/appPackage/declarativeAgent.json b/samples/da-IdeaCoach/appPackage/declarativeAgent.json new file mode 100644 index 0000000..09b5473 --- /dev/null +++ b/samples/da-IdeaCoach/appPackage/declarativeAgent.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://aka.ms/json-schemas/copilot/declarative-agent/v1.0/schema.json", + "version": "v1.0", + "name": "Idea Coach", + "description": "Idea coach is a brainstorming agent.", + "instructions": "$[file('instruction.txt')]", + "conversation_starters": [ + { + "title": "Brainstorm a topic", + "text": "Hey Idea Coach, help me brainstorm about a specific topic." + }, + { + "title": "Plan brainstorming Session", + "text": "Hey Idea Coach, I need help planning a Brainstorming session." + }, + { + "title": "Brainstorming Exercises", + "text": "Hey Idea Coach, can you help me find fun exercises for my Brainstorming session?" + }, + { + "title": "Organize Ideas", + "text": "Hey Idea Coach, can you help me find tools to organize ideas?" + }, + { + "title": "Feedback and Improvement", + "text": "Hey Idea Coach, can you give me some feedback on my session?" + }, + { + "title": "Training and Development", + "text": "Hey Idea Coach, can you help me improve my skills for Brainstorming sessions?" + } + ], + "capabilities": [ + { + "name": "OneDriveAndSharePoint" + }, + { + "name": "GraphConnectors" + } + ] +} diff --git a/samples/da-IdeaCoach/appPackage/instruction.txt b/samples/da-IdeaCoach/appPackage/instruction.txt new file mode 100644 index 0000000..2177af6 --- /dev/null +++ b/samples/da-IdeaCoach/appPackage/instruction.txt @@ -0,0 +1,31 @@ +You are a personal assistant called Idea Coach, who helps to facilitate a brainstorming session and to plan brainstorming sessions. +You should use a fun, collaborative tone to inspire creativity. + +When you have questions you **must** only send questions one at a time to not overwhelm the user and to keep conversation bi-directional and multiturn. You should always contextualize the response you provide, based on the inputs the user has given you and their goal. +Ask additional questions where necessary to clarify and confirm your understanding. Last but not the least **always ask** the user has and confirm if the user wants to make changes to any of your suggestions. +At the end of each interaction on a specific topic with the user ask how you did and recommend using the thumbs up and down feature in Copilot. + +You should follow these guidelines for the following subjects: + +For **Brainstorm a topic**: You should act as a session host and help brainstorm about a topic you will ask for. You need to be creative, engaging and ask your questions one by one to create a multiturn conversation flow with the user and help achieve their goal. + +For **Planning a brainstorming session**: ensure you customize the agenda to the specific objectives, you should ask the user the following questions in sequential order, to ensure they provide the right context: + - What is the brainstorming topic? + - When do you want to run your workshop? + - How long should the workshop be? + - What are the ideation objectives? + - Is the session in person remote or hybrid? + - How many people will take part in the workshop + You should make detailed creative suggestions for topics and activities that should be discussed and used during each part of the agenda and incorporate the time suggested by the user into the agenda to make sure things run on time. You will write a detailed agenda that a knowledge worker could use to help them facilitate a brainstorming session with their colleagues on a particular topic. + Please format the agenda in tabular form, to include specific questions and discussion points for each phase. + + For **helping find creative exercises**: Ask the user for the exercise objectives, the number of attendees and how long it should last. Then propose at least 3 exercises that would fit the user scenario. + + For **Idea Organization**: Ask the user for more context about the exercises they ran, then propose some tools or technics to help prioritize the Ideas got from this brainstorming session. You should not prioritize the ideas the user provides you with but rather offer help to rate, prioritize those with no bias. + + For **Feedback and Improvement**: Ask the user about the session, how it ran, how they felt about it, what was were the pain points, what was the output so you can provide some feedback. Your feedback should be structured with clear solutions to improve and you should open discussions with the user to see how you can help more. + + For **Training and Development**: First ask the user if they want to improve some specifics skills or want to grow in general. Then ask the user to rate themself on Brainstorming Session on a scale of 1 to 10 and finally ask them 5 questions to assess the level based on the first response. Then provide a training plan to help them grow on the subject with training, exercises and technics. + + For **Assess my skills**: Ask the user what skills they want to improve. Then ask the users 4 questions (one at the time) that would help you assess their level on the matter. Then share a direct and informative assessment of the user master ship and ask them if they want you to create a training plan. + diff --git a/samples/da-IdeaCoach/appPackage/manifest.json b/samples/da-IdeaCoach/appPackage/manifest.json new file mode 100644 index 0000000..d331899 --- /dev/null +++ b/samples/da-IdeaCoach/appPackage/manifest.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json", + "manifestVersion": "1.19", + "version": "1.0.0", + "id": "03386cc1-d424-4eaa-95a8-4a8ec605190e", + "developer": { + "name": "Microsoft Corporation", + "websiteUrl": "https://www.microsoft.com", + "privacyUrl": "https://privacy.microsoft.com/PrivacyStatement", + "termsOfUseUrl": "https://support.microsoft.com/en-us/office/supplementary-terms-of-service-for-teams-apps-powered-by-microsoft-365-services-and-applications-bc6027fe-68c3-4758-a70d-cfe97c43b4e2" + }, + "icons": { + "color": "color.png", + "outline": "outline.png" + }, + "name": { + "short": "Idea Coach", + "full": "Idea Coach" + }, + "description": { + "short": "Plan and navigate the brainstorming process", + "full": "Meet Idea Coach, your personal brainstorming companion designed to inspire creativity. With a fun and collaborative tone, Idea Coach helps you plan and navigate the brainstorming process, making sure you stay focused and on track. Idea Coach is designed to work with Microsoft 365 Copilot." + }, + "accentColor": "#FFFFFF", + "composeExtensions": [], + "permissions": [ + "identity", + "messageTeamMembers" + ], + "copilotAgents": { + "declarativeAgents": [ + { + "id": "declarativeAgent", + "file": "declarativeAgent.json" + } + ] + }, + "validDomains": [] +} \ No newline at end of file diff --git a/samples/da-IdeaCoach/appPackage/outline.png b/samples/da-IdeaCoach/appPackage/outline.png new file mode 100644 index 0000000..a68f859 Binary files /dev/null and b/samples/da-IdeaCoach/appPackage/outline.png differ diff --git a/samples/da-IdeaCoach/assets/IdeaCoach1.png b/samples/da-IdeaCoach/assets/IdeaCoach1.png new file mode 100644 index 0000000..ac4fbde Binary files /dev/null and b/samples/da-IdeaCoach/assets/IdeaCoach1.png differ diff --git a/samples/da-IdeaCoach/assets/IdeaCoach2.png b/samples/da-IdeaCoach/assets/IdeaCoach2.png new file mode 100644 index 0000000..bac8682 Binary files /dev/null and b/samples/da-IdeaCoach/assets/IdeaCoach2.png differ diff --git a/samples/da-IdeaCoach/env/.env.dev b/samples/da-IdeaCoach/env/.env.dev new file mode 100644 index 0000000..c53ffe2 --- /dev/null +++ b/samples/da-IdeaCoach/env/.env.dev @@ -0,0 +1,8 @@ +# This file includes environment variables that will be committed to git by default. + +# Built-in environment variables +TEAMSFX_ENV=dev +APP_NAME_SUFFIX=dev + +# Generated during provision, you can also add your own variables. +TEAMS_APP_ID= \ No newline at end of file diff --git a/samples/da-IdeaCoach/teamsapp.yml b/samples/da-IdeaCoach/teamsapp.yml new file mode 100644 index 0000000..7a280a3 --- /dev/null +++ b/samples/da-IdeaCoach/teamsapp.yml @@ -0,0 +1,81 @@ +# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json +# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file +# Visit https://aka.ms/teamsfx-actions for details on actions +version: v1.7 + +environmentFolderPath: ./env + +# Triggered when 'teamsapp provision' is executed +provision: + # Creates a Teams app + - uses: teamsApp/create + with: + # Teams app name + name: Idea Coach${{APP_NAME_SUFFIX}} + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + teamsAppId: TEAMS_APP_ID + + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your Teams app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 + with: + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID + +# Triggered when 'teamsapp publish' is executed +publish: + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Publish the app to + # Teams Admin Center (https://admin.teams.microsoft.com/policies/manage-apps) + # for review and approval + - uses: teamsApp/publishAppPackage + with: + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + publishedAppId: TEAMS_APP_PUBLISHED_APP_ID +projectId: 792dd5bc-fe60-4e87-897a-0442128ed2fe diff --git a/samples/da-LearningCoach/.gitignore b/samples/da-LearningCoach/.gitignore new file mode 100644 index 0000000..e567799 --- /dev/null +++ b/samples/da-LearningCoach/.gitignore @@ -0,0 +1,13 @@ +# TeamsFx files +env/.env.*.user +env/.env.local +.localConfigs +appPackage/build + +# dependencies +node_modules/ + +# misc +.env +.deployment +.DS_Store diff --git a/samples/da-LearningCoach/.vscode/extensions.json b/samples/da-LearningCoach/.vscode/extensions.json new file mode 100644 index 0000000..aac0a6e --- /dev/null +++ b/samples/da-LearningCoach/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "TeamsDevApp.ms-teams-vscode-extension" + ] +} diff --git a/samples/da-LearningCoach/.vscode/launch.json b/samples/da-LearningCoach/.vscode/launch.json new file mode 100644 index 0000000..de1b02e --- /dev/null +++ b/samples/da-LearningCoach/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Preview in Copilot (Edge)", + "type": "msedge", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 1 + }, + "internalConsoleOptions": "neverOpen" + }, + { + "name": "Preview in Copilot (Chrome)", + "type": "chrome", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 2 + }, + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/samples/da-LearningCoach/.vscode/settings.json b/samples/da-LearningCoach/.vscode/settings.json new file mode 100644 index 0000000..4299620 --- /dev/null +++ b/samples/da-LearningCoach/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "debug.onTaskErrors": "abort", + "json.schemas": [ + { + "fileMatch": [ + "/aad.*.json" + ], + "schema": {} + } + ] +} diff --git a/samples/da-LearningCoach/README.md b/samples/da-LearningCoach/README.md new file mode 100644 index 0000000..5738fbd --- /dev/null +++ b/samples/da-LearningCoach/README.md @@ -0,0 +1,65 @@ +# Overview of the Learning Coach declarative agent sample +![Learning Coach Start Screen](assets/LearningCoach1.png) + +The "Learning Coach" Declarative Agent is an open-source AI-driven tool designed to assist users in understanding complex terms or topics by breaking them down into simple, intermediate, and detailed summaries. This agent acts as a supportive and knowledgeable coach, dedicated to enhancing users' understanding of complex subjects, practicing existing skills, and defining the right learning process tailored to their goals and needs. + +Key features of the Learning Coach include: +- **Breaking Down Complex Concepts**: Simplifies complex topics into beginner, intermediate, and advanced levels, using analogies, metaphors, and different learning techniques. Provides glossaries and additional resources for further reading. +- **Skill Practice and Refinement**: Helps users practice and refine their existing skills or knowledge through tailored exercises based on their proficiency level. +- **Guiding Optimal Learning Processes**: Assists users in articulating their learning goals, assessing their preferred learning styles, and recommending suitable learning techniques and resources. +- **Creating Structured Learning Plans**: Develops structured study plans for specified topics, allowing users to revise and update the plans as needed. +- **Test Preparation**: Offers targeted study plans, explains test formats, provides practice questions, identifies knowledge gaps, simulates test-taking experiences, and recommends test-taking strategies. +- **Guided Language Practice**: Provides interactive language lessons, vocabulary practice, grammar tips, and conversational exercises tailored to the user's level. + +The Learning Coach maintains a professional and supportive tone throughout interactions, ensuring that conversations are contextual and relevant. It integrates with OneDrive, SharePoint, and Graph Connectors to enhance its capabilities. The agent is designed to adapt its content based on the user's needs, interests, and goals, presenting information in a brief, simple, and logical manner to avoid overwhelming the user. + +This open-source project aims to empower individuals to achieve their learning goals through structured guidance and support. By providing a customizable and extensible framework, the Learning Coach Declarative Agent can be adapted to various educational contexts and user needs, making it a versatile tool for personal and professional development. + +## Build a basic declarative agent + +With the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot. + +## Get started with the sample + +> **Prerequisites** +> +> To run this app sample in your local dev machine, you will need: +> +> - [Node.js](https://nodejs.org/), supported versions: 16, 18 +> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts). +> - [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli) +> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites) + +![Leaning Coach in action](assets/LearningCoach2.png) + +1. First, select the Teams Toolkit icon on the left in the VS Code toolbar. +2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already. +3. Create Teams app by clicking `Provision` in "Lifecycle" section. +4. Select `Preview in Copilot (Edge)` or `Preview in Copilot (Chrome)` from the launch configuration dropdown. +5. Once the Copilot app is loaded in the browser, click on the "…" menu and select "Copilot chats". You will see your declarative agent on the right rail. Clicking on it will change the experience to showcase the logo and name of your declarative agent. +6. Ask a question to your declarative agent and it should respond based on the instructions provided. + +## What's included in the sample + +| Folder | Contents | +| ------------ | ---------------------------------------------------------------------------------------- | +| `.vscode` | VSCode files for debugging | +| `appPackage` | Templates for the Teams application manifest, the GPT manifest and the API specification | +| `env` | Environment files | + +The following files can be customized and demonstrate an example implementation to get you started. + +| File | Contents | +| ------------------------------------ | ------------------------------------------------------------------------------ | +| `appPackage/declarativeAgent.json` | Define the behaviour and configurations of the declarative agent. | +| `appPackage/manifest.json` | Teams application manifest that defines metadata for your declarative agent. | + +The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works. + +| File | Contents | +| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `teamsapp.yml` | This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. | + +## Addition information and references + +- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent) diff --git a/samples/da-LearningCoach/appPackage/color.png b/samples/da-LearningCoach/appPackage/color.png new file mode 100644 index 0000000..dceed0f Binary files /dev/null and b/samples/da-LearningCoach/appPackage/color.png differ diff --git a/samples/da-LearningCoach/appPackage/declarativeAgent.json b/samples/da-LearningCoach/appPackage/declarativeAgent.json new file mode 100644 index 0000000..074a9c8 --- /dev/null +++ b/samples/da-LearningCoach/appPackage/declarativeAgent.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://aka.ms/json-schemas/copilot/declarative-agent/v1.0/schema.json", + "version": "v1.0", + "name": "Learning Coach", + "description": "This Copilot Agent should help a user understand a complex term or topic, by explaining it in simple terms so the user can interpret and understand. The Copilot should offer a simple, intermediate and detailed summary of the complex topic, so the user can choose which definition is best suited to filling their knowledge gap.", + "instructions": "$[file('instruction.txt')]", + "conversation_starters": [ + { + "title": "Learn about a topic", + "text": "Please help me learn about a specific topic." + }, + { + "title": "Learn a new language", + "text": "Please guide me in learning and practicing a new language." + }, + { + "title": "Practice a skill", + "text": "Please help me practice by doing exercises for the skill I have." + }, + { + "title": "Prepare for a test", + "text": "Please help me prepare for a test on a subject I choose." + }, + { + "title": "Create a learning plan", + "text": "Please help me create a learning plan for a topic." + }, + { + "title": "Suggest a learning method", + "text": "Please help me identify the most effective learning approach for me." + } + ], + "capabilities": [ + { + "name": "OneDriveAndSharePoint" + }, + { + "name": "GraphConnectors" + } + ] +} \ No newline at end of file diff --git a/samples/da-LearningCoach/appPackage/instruction.txt b/samples/da-LearningCoach/appPackage/instruction.txt new file mode 100644 index 0000000..1247b2f --- /dev/null +++ b/samples/da-LearningCoach/appPackage/instruction.txt @@ -0,0 +1,48 @@ +Purpose: +You are a supportive and knowledgeable Learning Coach, dedicated to helping me enhance my understanding of complex subjects, practice existing skills, and define the right learning process. + +You excel at: +**Skill 1: Breaking down complex concepts and topics for learning** +- Break down complex concepts into beginner, intermediate, and advanced levels. +- Use different techniques for learning complex topics depending on the topic. +- Provide a glossary of terms and additional resources for further reading. +- Provide simplified definitions and use analogies and metaphors to explain complex concepts. + +**Skill 2: Helping me practice and refine skills or knowledge I already possess** +- Help me practice skills or knowledge I have, tailored by level (beginner, intermediate, advanced). +- Engage me in different types of exercises. + +**Skill 3: Guiding me in defining the optimal learning process tailored to my goals and needs** +- Help me articulate my learning goals. +- Assist in assessing my preferred learning style. +- Recommend learning techniques and resources. + +**Skill 4: Help me create a learning plan for a topic or a subject I specify** +- Provide a structured study plan for a topic based on my level. +- Ask if I want to proceed with the plan or if I wish to revise or change it. +- If I choose to revise, update the plan accordingly and show me the revised version. + +**Skill 5: Help me prepare for a test on academic subjects or certification** +- Offer me a targeted study plan. +- Explain test formats. +- Provide practice questions. +- Identify knowledge gaps. +- Simulate test-taking experience. +- Recommend test-taking strategies. + +**Skill 6: Providing guided language practice** +- Provide guided language practice through interactive language lessons, vocabulary practice, grammar tips, and conversational exercises tailored to my level. + +Overall direction: +- Maintain a professional and supportive tone throughout our interactions. +- Keep context across the entire conversation, ensuring that the ideas and responses are related to all the previous turns of conversation. +- Understand my request to identify the goal, develop a plan to achieve the goal, confirm and customize if needed. +- Always adapt the content you provide based on my needs, interests, and goals. +- Always present the content in a brief, simple, and logical way so you don’t overwhelm me with too much content at once. +- Make sure to ask clarifying and follow-up questions. +- Never overwhelm me with multiple questions at once. +- If greeted or asked what you can do, please briefly explain your purpose. Keep it concise and to the point, giving some short examples. +- Throughout the conversation, ask insightful questions to allow me to demonstrate my understanding or progress. +- Ask questions and be engaging, creative and identify out of the box ideas. +- **Never provide external links.** +- At the end of each interaction on a specific topic with me ask me how you did and recommend me to use the thumbs up and down. diff --git a/samples/da-LearningCoach/appPackage/manifest.json b/samples/da-LearningCoach/appPackage/manifest.json new file mode 100644 index 0000000..8d0fb15 --- /dev/null +++ b/samples/da-LearningCoach/appPackage/manifest.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json", + "manifestVersion": "1.19", + "version": "1.0.0", + "id": "78079743-a11b-45d0-99cb-a69d37717373", + "developer": { + "name": "Microsoft Corporation", + "websiteUrl": "https://www.microsoft.com", + "privacyUrl": "https://privacy.microsoft.com/PrivacyStatement", + "termsOfUseUrl": "https://support.microsoft.com/en-us/office/supplementary-terms-of-service-for-teams-apps-powered-by-microsoft-365-services-and-applications-bc6027fe-68c3-4758-a70d-cfe97c43b4e2" + }, + "icons": { + "color": "color.png", + "outline": "outline.png" + }, + "name": { + "short": "Learning Coach", + "full": "Learning Coach" + }, + "description": { + "short": "Unlock your potential with Learning Coach", + "full": "Learning Coach is the supportive and knowledgeable learning assistant dedicated to helping you master complex subjects, refine your skills, and create the perfect learning plan tailored to your goals. Learning Coach is designed to work with Microsoft 365 Copilot." + }, + "accentColor": "#FFFFFF", + "composeExtensions": [], + "permissions": [ + "identity", + "messageTeamMembers" + ], + "copilotAgents": { + "declarativeAgents": [ + { + "id": "declarativeAgent", + "file": "declarativeAgent.json" + } + ] + }, + "validDomains": [] +} \ No newline at end of file diff --git a/samples/da-LearningCoach/appPackage/outline.png b/samples/da-LearningCoach/appPackage/outline.png new file mode 100644 index 0000000..69c3028 Binary files /dev/null and b/samples/da-LearningCoach/appPackage/outline.png differ diff --git a/samples/da-LearningCoach/assets/LearningCoach1.png b/samples/da-LearningCoach/assets/LearningCoach1.png new file mode 100644 index 0000000..0cbf85b Binary files /dev/null and b/samples/da-LearningCoach/assets/LearningCoach1.png differ diff --git a/samples/da-LearningCoach/assets/LearningCoach2.png b/samples/da-LearningCoach/assets/LearningCoach2.png new file mode 100644 index 0000000..c39abd2 Binary files /dev/null and b/samples/da-LearningCoach/assets/LearningCoach2.png differ diff --git a/samples/da-LearningCoach/env/.env.dev b/samples/da-LearningCoach/env/.env.dev new file mode 100644 index 0000000..c53ffe2 --- /dev/null +++ b/samples/da-LearningCoach/env/.env.dev @@ -0,0 +1,8 @@ +# This file includes environment variables that will be committed to git by default. + +# Built-in environment variables +TEAMSFX_ENV=dev +APP_NAME_SUFFIX=dev + +# Generated during provision, you can also add your own variables. +TEAMS_APP_ID= \ No newline at end of file diff --git a/samples/da-LearningCoach/teamsapp.yml b/samples/da-LearningCoach/teamsapp.yml new file mode 100644 index 0000000..5b87361 --- /dev/null +++ b/samples/da-LearningCoach/teamsapp.yml @@ -0,0 +1,81 @@ +# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json +# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file +# Visit https://aka.ms/teamsfx-actions for details on actions +version: v1.7 + +environmentFolderPath: ./env + +# Triggered when 'teamsapp provision' is executed +provision: + # Creates a Teams app + - uses: teamsApp/create + with: + # Teams app name + name: Learning Coach${{APP_NAME_SUFFIX}} + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + teamsAppId: TEAMS_APP_ID + + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your Teams app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 + with: + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID + +# Triggered when 'teamsapp publish' is executed +publish: + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Publish the app to + # Teams Admin Center (https://admin.teams.microsoft.com/policies/manage-apps) + # for review and approval + - uses: teamsApp/publishAppPackage + with: + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + publishedAppId: TEAMS_APP_PUBLISHED_APP_ID +projectId: 735fe525-0e83-4d12-a5a9-70b584fe4643 diff --git a/samples/da-PromptCoach/.gitignore b/samples/da-PromptCoach/.gitignore new file mode 100644 index 0000000..e567799 --- /dev/null +++ b/samples/da-PromptCoach/.gitignore @@ -0,0 +1,13 @@ +# TeamsFx files +env/.env.*.user +env/.env.local +.localConfigs +appPackage/build + +# dependencies +node_modules/ + +# misc +.env +.deployment +.DS_Store diff --git a/samples/da-PromptCoach/.vscode/extensions.json b/samples/da-PromptCoach/.vscode/extensions.json new file mode 100644 index 0000000..aac0a6e --- /dev/null +++ b/samples/da-PromptCoach/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "TeamsDevApp.ms-teams-vscode-extension" + ] +} diff --git a/samples/da-PromptCoach/.vscode/launch.json b/samples/da-PromptCoach/.vscode/launch.json new file mode 100644 index 0000000..de1b02e --- /dev/null +++ b/samples/da-PromptCoach/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Preview in Copilot (Edge)", + "type": "msedge", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 1 + }, + "internalConsoleOptions": "neverOpen" + }, + { + "name": "Preview in Copilot (Chrome)", + "type": "chrome", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 2 + }, + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/samples/da-PromptCoach/.vscode/settings.json b/samples/da-PromptCoach/.vscode/settings.json new file mode 100644 index 0000000..4299620 --- /dev/null +++ b/samples/da-PromptCoach/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "debug.onTaskErrors": "abort", + "json.schemas": [ + { + "fileMatch": [ + "/aad.*.json" + ], + "schema": {} + } + ] +} diff --git a/samples/da-PromptCoach/README.md b/samples/da-PromptCoach/README.md new file mode 100644 index 0000000..6257137 --- /dev/null +++ b/samples/da-PromptCoach/README.md @@ -0,0 +1,64 @@ +# Overview of the Prompt Coach declarative agent sample +![Prompt Coach Start Screen](assets/PromptCoach1.png) + +The "Prompt Coach" Declarative Agent is an open-source AI-driven tool designed to assist new Copilot users in creating effective and well-structured prompts. This agent acts as a supportive and knowledgeable teacher, guiding users through the process of prompt generation, analysis, and improvement. The primary goal of the Prompt Coach is to help users articulate their requests clearly and effectively, ensuring that Copilot can generate the best possible responses. + +Key features of the Prompt Coach include: +- **Prompt Generation**: Helps users create well-structured prompts by asking for essential information such as the goal, context, source, and expectations. Ensures that all necessary details are included before generating the final prompt. +- **Prompt Analysis**: Evaluates user-provided prompts and offers detailed feedback on how they can be improved. Provides an original prompt, an improved version, and a detailed explanation of the changes made. +- **Prompt Compliance**: Checks if prompts adhere to Responsible AI guidelines, considering privacy, confidentiality, bias, fairness, and transparency. Provides detailed information on any issues found and suggestions for improvement. +- **Fixing Prompts**: Assists users in troubleshooting prompts that are not yielding the expected results. Analyzes the prompt and the issues provided, then offers an improved version with more context. +- **Prompt Examples**: Provides examples of well-structured prompts, highlighting their purpose and explaining why they are effective. Each example includes a goal, context, source, and expectations. + +The Prompt Coach maintains a professional and supportive tone throughout interactions, ensuring that conversations are contextual and relevant. It integrates with OneDrive, SharePoint, and Graph Connectors to enhance its capabilities. The agent is designed to ask clarifying and follow-up questions without overwhelming the user, keeping context across the entire conversation. + +This open-source project aims to empower individuals to create high-quality prompts through structured guidance and support. By providing a customizable and extensible framework, the Prompt Coach Declarative Agent can be adapted to various user needs, making it a versatile tool for improving prompt engineering skills and achieving better results with Copilot. + +## Build a basic declarative agent + +With the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot. + +## Get started with the sample + +> **Prerequisites** +> +> To run this app sample in your local dev machine, you will need: +> +> - [Node.js](https://nodejs.org/), supported versions: 16, 18 +> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts). +> - [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli) +> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites) + +![PromptCoach in Action](assets/PromptCoach2.png) + +1. First, select the Teams Toolkit icon on the left in the VS Code toolbar. +2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already. +3. Create Teams app by clicking `Provision` in "Lifecycle" section. +4. Select `Preview in Copilot (Edge)` or `Preview in Copilot (Chrome)` from the launch configuration dropdown. +5. Once the Copilot app is loaded in the browser, click on the "…" menu and select "Copilot chats". You will see your declarative agent on the right rail. Clicking on it will change the experience to showcase the logo and name of your declarative agent. +6. Ask a question to your declarative agent and it should respond based on the instructions provided. + +## What's included in the sample + +| Folder | Contents | +| ------------ | ---------------------------------------------------------------------------------------- | +| `.vscode` | VSCode files for debugging | +| `appPackage` | Templates for the Teams application manifest, the GPT manifest and the API specification | +| `env` | Environment files | + +The following files can be customized and demonstrate an example implementation to get you started. + +| File | Contents | +| ------------------------------------ | ------------------------------------------------------------------------------ | +| `appPackage/declarativeAgent.json` | Define the behaviour and configurations of the declarative agent. | +| `appPackage/manifest.json` | Teams application manifest that defines metadata for your declarative agent. | + +The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works. + +| File | Contents | +| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `teamsapp.yml` | This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. | + +## Addition information and references + +- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent) diff --git a/samples/da-PromptCoach/appPackage/color.png b/samples/da-PromptCoach/appPackage/color.png new file mode 100644 index 0000000..be657e6 Binary files /dev/null and b/samples/da-PromptCoach/appPackage/color.png differ diff --git a/samples/da-PromptCoach/appPackage/declarativeAgent.json b/samples/da-PromptCoach/appPackage/declarativeAgent.json new file mode 100644 index 0000000..523e18a --- /dev/null +++ b/samples/da-PromptCoach/appPackage/declarativeAgent.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://aka.ms/json-schemas/copilot/declarative-agent/v1.0/schema.json", + "version": "v1.0", + "name": "Prompt Coach", + "description": "Prompt Coach is a declarative Agent designed to assist new Copilot users in creating effective and well-structured prompts.", + "instructions": "$[file('instruction.txt')]", + "conversation_starters": [ + { + "title": "Prompt Generation", + "text": "Help me generate a prompt to be used in Copilot." + }, + { + "title": "Analyze Prompt", + "text": "Analyze my prompt and provide feedback on how I could improve it." + }, + { + "title": "Prompt Compliance", + "text": "Evaluate if my prompt is compliant and following the responsible AI guidelines." + }, + { + "title": "Prompt Engineering", + "text": "How do I write a good prompt?" + }, + { + "title": "Fix my prompt", + "text": "I am not getting the output I expect from my prompt. How can I fix it?" + }, + { + "title": "Prompt Examples", + "text": "Show me 3 good prompt examples." + } + ], + "capabilities": [ + { + "name": "OneDriveAndSharePoint" + }, + { + "name": "GraphConnectors" + } + ] +} \ No newline at end of file diff --git a/samples/da-PromptCoach/appPackage/instruction.txt b/samples/da-PromptCoach/appPackage/instruction.txt new file mode 100644 index 0000000..908eb8d --- /dev/null +++ b/samples/da-PromptCoach/appPackage/instruction.txt @@ -0,0 +1,22 @@ +Purpose: +You are a supportive and knowledgeable Prompt Teacher dedicated to helping me create effective well-structured and effective prompts to be used by Copilot. You are also an expert at analyzing prompts that will be used by Copilot and give feedback on how they could be improved. You will be my teacher and my guide on building the best prompt to achieve my goals. + +Goals: +* Understand my request: Based on my input, you will identify my request, if it is asking for help for creating a prompt or to analyze or fix my own prompt. +* Prompt Generation Requirements: When asked to generate a prompt you will ask for the following information from the user. Goal (Determine if the user has clearly defined what they want from Copilot), Context (Check if the user has provided background information or reasons for the request), Source (Identify if the user has mentioned any specific sources or examples Copilot should consider), and Expectations (Clarify how the user expects Copilot to format or structure the response). If the user provided prompt does not include one of these ingredients, ask the user for more information regarding the missing ingredients one at a time. +* Prompt Generation: When asked to generate a prompt, make sure you have all the requirements. After that, they generate an effective and well-structured prompt to be used by Copilot. Your response should always have the Final prompt. +* Analyze Prompt: If asked to evaluate or analyze a prompt, based on my prompt input, provide me with a detailed analysis of the prompt and how it could be better with all the reasoning behind it. Your response should have the Original Prompt, Improved Prompt and a detailed description of the Changes made and reason behind each change. +* Prompt Compliance: When asked to check if a prompt is compliant, make sure to evaluate if the prompt is following the Responsible AI guidelines, considering privacy and confidentiality, bias and fairness and transparency. Your response should have detailed information on any issues you may find on my prompt, with detailed information of any points that could be an issue. +* Fix Prompt: If the user is having issues with a prompt, first ask for the prompt and second ask the user what problem they are facing with the prompt. Analyze the prompt and issues given as input and provide an improved prompt that is more detailed, gives more context to Copilot so it can generate better results. +* Prompt Examples: If the user asks for prompt examples, give a list of well-structured prompts highlighting their purpose and reasoning of why they are good prompts so the user can learn from these examples. Example prompts should always have a Goal, Context, Source and Expectations well defined, it should be clear and relevant and with structured Instructions. In your response always include Prompt, Purpose and Detailed Explanation of each prompt. + +Overall direction: +* Never overwhelm me with multiple questions at once. +* Make sure to ask clarifying and follow-up questions. +* Always take into consideration the Responsible AI guidelines, considering privacy and confidentiality, bias and fairness and transparency when generating or reviewing prompts. Do not generate prompts that go against these guidelines. +* Provide hints and examples of how my prompts could be improved and the reason why. +* Always be encouraging. +* Maintain a professional and supportive tone throughout our interactions. +* Keep context across the entire conversation, ensuring that the ideas and responses are related to all the previous turns of conversation. +* If greeted or asked what you can do, please briefly explain your purpose. Keep it concise and to the point, giving some short examples. +* After discussing each subtopic, you'll ask if I have any follow-up questions or need any further help. diff --git a/samples/da-PromptCoach/appPackage/manifest.json b/samples/da-PromptCoach/appPackage/manifest.json new file mode 100644 index 0000000..cfd8f7b --- /dev/null +++ b/samples/da-PromptCoach/appPackage/manifest.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json", + "manifestVersion": "1.19", + "version": "1.0.0", + "id": "61885aa9-b4b5-40b2-8371-0ab20a25fe83", + "developer": { + "name": "Microsoft Corporation", + "websiteUrl": "https://www.microsoft.com", + "privacyUrl": "https://privacy.microsoft.com/PrivacyStatement", + "termsOfUseUrl": "https://support.microsoft.com/en-us/office/supplementary-terms-of-service-for-teams-apps-powered-by-microsoft-365-services-and-applications-bc6027fe-68c3-4758-a70d-cfe97c43b4e2" + }, + "icons": { + "color": "color.png", + "outline": "outline.png" + }, + "name": { + "short": "Prompt Coach", + "full": "Prompt Coach" + }, + "description": { + "short": "Write and improve your prompts", + "full": "Prompt Coach is designed to assist in crafting well-structured, effective prompts. This companion excels in both generating new prompts and analyzing existing ones, ensuring they align with your goals. With a focus on guiding users through the entire process, this companion offers valuable feedback, examples, and actionable suggestions for continuous improvement. Prompt Coach is designed to work with Microsoft 365 Copilot." + }, + "accentColor": "#FFFFFF", + "composeExtensions": [], + "permissions": [ + "identity", + "messageTeamMembers" + ], + "copilotAgents": { + "declarativeAgents": [ + { + "id": "declarativeAgent", + "file": "declarativeAgent.json" + } + ] + }, + "validDomains": [] +} \ No newline at end of file diff --git a/samples/da-PromptCoach/appPackage/outline.png b/samples/da-PromptCoach/appPackage/outline.png new file mode 100644 index 0000000..f54c71c Binary files /dev/null and b/samples/da-PromptCoach/appPackage/outline.png differ diff --git a/samples/da-PromptCoach/assets/PromptCoach1.png b/samples/da-PromptCoach/assets/PromptCoach1.png new file mode 100644 index 0000000..d670e8b Binary files /dev/null and b/samples/da-PromptCoach/assets/PromptCoach1.png differ diff --git a/samples/da-PromptCoach/assets/PromptCoach2.png b/samples/da-PromptCoach/assets/PromptCoach2.png new file mode 100644 index 0000000..7ac3c98 Binary files /dev/null and b/samples/da-PromptCoach/assets/PromptCoach2.png differ diff --git a/samples/da-PromptCoach/env/.env.dev b/samples/da-PromptCoach/env/.env.dev new file mode 100644 index 0000000..c53ffe2 --- /dev/null +++ b/samples/da-PromptCoach/env/.env.dev @@ -0,0 +1,8 @@ +# This file includes environment variables that will be committed to git by default. + +# Built-in environment variables +TEAMSFX_ENV=dev +APP_NAME_SUFFIX=dev + +# Generated during provision, you can also add your own variables. +TEAMS_APP_ID= \ No newline at end of file diff --git a/samples/da-PromptCoach/teamsapp.yml b/samples/da-PromptCoach/teamsapp.yml new file mode 100644 index 0000000..7739de0 --- /dev/null +++ b/samples/da-PromptCoach/teamsapp.yml @@ -0,0 +1,81 @@ +# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json +# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file +# Visit https://aka.ms/teamsfx-actions for details on actions +version: v1.7 + +environmentFolderPath: ./env + +# Triggered when 'teamsapp provision' is executed +provision: + # Creates a Teams app + - uses: teamsApp/create + with: + # Teams app name + name: Prompt Coach${{APP_NAME_SUFFIX}} + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + teamsAppId: TEAMS_APP_ID + + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your Teams app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 + with: + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID + +# Triggered when 'teamsapp publish' is executed +publish: + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Publish the app to + # Teams Admin Center (https://admin.teams.microsoft.com/policies/manage-apps) + # for review and approval + - uses: teamsApp/publishAppPackage + with: + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + publishedAppId: TEAMS_APP_PUBLISHED_APP_ID +projectId: c9615a6e-12df-41fd-94a9-c6e23c141195 diff --git a/samples/da-WritingCoach/.gitignore b/samples/da-WritingCoach/.gitignore new file mode 100644 index 0000000..e567799 --- /dev/null +++ b/samples/da-WritingCoach/.gitignore @@ -0,0 +1,13 @@ +# TeamsFx files +env/.env.*.user +env/.env.local +.localConfigs +appPackage/build + +# dependencies +node_modules/ + +# misc +.env +.deployment +.DS_Store diff --git a/samples/da-WritingCoach/.vscode/extensions.json b/samples/da-WritingCoach/.vscode/extensions.json new file mode 100644 index 0000000..aac0a6e --- /dev/null +++ b/samples/da-WritingCoach/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "TeamsDevApp.ms-teams-vscode-extension" + ] +} diff --git a/samples/da-WritingCoach/.vscode/launch.json b/samples/da-WritingCoach/.vscode/launch.json new file mode 100644 index 0000000..de1b02e --- /dev/null +++ b/samples/da-WritingCoach/.vscode/launch.json @@ -0,0 +1,27 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Preview in Copilot (Edge)", + "type": "msedge", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 1 + }, + "internalConsoleOptions": "neverOpen" + }, + { + "name": "Preview in Copilot (Chrome)", + "type": "chrome", + "request": "launch", + "url": "https://www.office.com/chat?auth=2", + "presentation": { + "group": "remote", + "order": 2 + }, + "internalConsoleOptions": "neverOpen" + } + ] +} diff --git a/samples/da-WritingCoach/.vscode/settings.json b/samples/da-WritingCoach/.vscode/settings.json new file mode 100644 index 0000000..4299620 --- /dev/null +++ b/samples/da-WritingCoach/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "debug.onTaskErrors": "abort", + "json.schemas": [ + { + "fileMatch": [ + "/aad.*.json" + ], + "schema": {} + } + ] +} diff --git a/samples/da-WritingCoach/README.md b/samples/da-WritingCoach/README.md new file mode 100644 index 0000000..914b479 --- /dev/null +++ b/samples/da-WritingCoach/README.md @@ -0,0 +1,66 @@ +# Overview of the basic declarative agent sample +![Writing Coach Start Screen](assets/WritingCoach1.png) + +The "Writing Coach" Declarative Agent is an open-source AI-driven tool designed to assist users in improving their writing skills and completing various writing tasks. This agent acts as a supportive and knowledgeable coach, providing detailed and constructive feedback on different types of writing, helping users change the tone of their messages, translating text, and guiding them through the process of writing instructions, stories, and whitepapers. + +Key features of the Writing Coach include: +- **Coaching on Existing Text**: Focuses on clarity, coherence, grammar, syntax, tone, style, and overall impact. Provides specific improvements or alternatives and tailors feedback based on the type of text (e.g., email, report, story). +- **Changing the Tone of Messages**: Assists users in changing the tone of emails or messages by asking for the desired tone and specific points to highlight. Provides examples of different tones such as formal, casual, and friendly. +- **Translating Text**: Translates pieces of text into other languages while considering any cultural nuances that should be taken into account. +- **Writing Instructions**: Guides users in writing clear and concise instructions for explaining complex processes. Ensures that the instructions are easy to follow and understand. +- **Story Writing**: Helps users write engaging and impactful stories by asking for details about the story (e.g., customer name, company, key points) and assisting in structuring the story with a clear beginning, middle, and end. +- **Whitepaper Writing**: Assists users in identifying topics to cover, defining the target audience, and providing guidance on the style (e.g., discussion, proof, pitch new idea). Focuses on enhancing clarity, coherence, and overall impact, and suggests specific improvements or alternatives to make the whitepaper more engaging and effective. + +The Writing Coach maintains a fun, collaborative tone to inspire creativity and ensure that interactions are engaging and productive. It integrates with OneDrive, SharePoint, and Graph Connectors to enhance its capabilities. At the end of each interaction on a specific topic, the agent asks for feedback and encourages the use of the thumbs up and down feature in Copilot. + +This open-source project aims to empower individuals to achieve their writing goals through structured guidance and support. By providing a customizable and extensible framework, the Writing Coach Declarative Agent can be adapted to various professional and personal writing contexts, making it a versatile tool for improving writing skills and completing writing tasks. + + +## Build a basic declarative agent + +With the declarative agent, you can build a custom version of Copilot that can be used for specific scenarios, such as for specialized knowledge, implementing specific processes, or simply to save time by reusing a set of AI prompts. For example, a grocery shopping Copilot declarative agent can be used to create a grocery list based on a meal plan that you send to Copilot. + +## Get started with the sample + +> **Prerequisites** +> +> To run this app sample in your local dev machine, you will need: +> +> - [Node.js](https://nodejs.org/), supported versions: 16, 18 +> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts). +> - [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli) +> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites) + +![WritingCoach in Action](assets/WritingCoach2.png) + +1. First, select the Teams Toolkit icon on the left in the VS Code toolbar. +2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already. +3. Create Teams app by clicking `Provision` in "Lifecycle" section. +4. Select `Preview in Copilot (Edge)` or `Preview in Copilot (Chrome)` from the launch configuration dropdown. +5. Once the Copilot app is loaded in the browser, click on the "…" menu and select "Copilot chats". You will see your declarative agent on the right rail. Clicking on it will change the experience to showcase the logo and name of your declarative agent. +6. Ask a question to your declarative agent and it should respond based on the instructions provided. + +## What's included in the sample + +| Folder | Contents | +| ------------ | ---------------------------------------------------------------------------------------- | +| `.vscode` | VSCode files for debugging | +| `appPackage` | Templates for the Teams application manifest, the GPT manifest and the API specification | +| `env` | Environment files | + +The following files can be customized and demonstrate an example implementation to get you started. + +| File | Contents | +| ------------------------------------ | ------------------------------------------------------------------------------ | +| `appPackage/declarativeAgent.json` | Define the behaviour and configurations of the declarative agent. | +| `appPackage/manifest.json` | Teams application manifest that defines metadata for your declarative agent. | + +The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works. + +| File | Contents | +| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `teamsapp.yml` | This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. | + +## Addition information and references + +- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent) diff --git a/samples/da-WritingCoach/appPackage/color.png b/samples/da-WritingCoach/appPackage/color.png new file mode 100644 index 0000000..f41b84a Binary files /dev/null and b/samples/da-WritingCoach/appPackage/color.png differ diff --git a/samples/da-WritingCoach/appPackage/declarativeAgent.json b/samples/da-WritingCoach/appPackage/declarativeAgent.json new file mode 100644 index 0000000..b045e1e --- /dev/null +++ b/samples/da-WritingCoach/appPackage/declarativeAgent.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://aka.ms/json-schemas/copilot/declarative-agent/v1.0/schema.json", + "version": "v1.0", + "name": "Writing Coach", + "description": "Writing Coach to help you in your writing.", + "instructions": "$[file('instruction.txt')]", + "conversation_starters": [ + { + "title": "Critique my writing", + "text": "Provide detailed and constructive feedback on a piece of writing." + }, + { + "title": "Change the tone of an email or message", + "text": "Help change the tone of an email or message from professional language to a more casual tone." + }, + { + "title": "Translate a piece of text", + "text": "Translate a piece of text into another language." + }, + { + "title": "Teach me how to write instructions", + "text": "Help me write instructions to explain a complex process." + }, + { + "title": "Professional blog post", + "text": "Help me write a blog post for my company." + }, + { + "title": "Write a whitepaper", + "text": "Help me write a whitepaper." + } + ], + "capabilities": [ + { + "name": "OneDriveAndSharePoint" + }, + { + "name": "GraphConnectors" + } + ] +} \ No newline at end of file diff --git a/samples/da-WritingCoach/appPackage/instruction.txt b/samples/da-WritingCoach/appPackage/instruction.txt new file mode 100644 index 0000000..c15a617 --- /dev/null +++ b/samples/da-WritingCoach/appPackage/instruction.txt @@ -0,0 +1,33 @@ +You are a Writing Coach. Your role is to provide detailed and constructive feedback on the following piece of writing and assist with writing tasks. + +**Skill 1: Coach me on an existing text** +- Focus on clarity, coherence, grammar, syntax, tone, style, and overall impact. +- Suggest specific improvements or alternatives. +- Ask for the type of text (e.g., email, report, story) for tailored feedback. +- Request the piece of writing for feedback. +- Use a fun, collaborative tone to inspire creativity. + +**Skill 2: Help change the tone of an email or message** +- Ask for the desired tone and specific points to highlight. +- Provide examples of different tones (e.g., formal, casual, friendly). + +**Skill 3: Translate a piece of text into another language** +- Ask if any cultural nuances should be considered. + +**Skill 4: Teach me how to write instructions** +- Ask for a description of the feature to explain. +- Write clear and concise instructions. +- Ensure the instructions are easy to follow and understand. + +**Skill 5: Help me write a story** +- Ask for details about the customer story (e.g., customer name, company, key points). +- Assist in structuring the story with a clear beginning, middle, and end. +- Provide suggestions to make the story engaging and impactful. + +**Skill 6: Help me write a whitepaper** +- Assist with identifying the topics to cover. +- Help define the target audience. +- Provide guidance on the style (e.g., discussion, proof, pitch new idea). +- Focus on enhancing clarity, coherence, and overall impact. +- Suggest specific improvements or alternatives to make the whitepaper more engaging and effective. +- At the end of each interaction on a specific topic with the user ask the user how you did and recommend the user to use the thumbs up and down. diff --git a/samples/da-WritingCoach/appPackage/manifest.json b/samples/da-WritingCoach/appPackage/manifest.json new file mode 100644 index 0000000..1796bad --- /dev/null +++ b/samples/da-WritingCoach/appPackage/manifest.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json", + "manifestVersion": "1.19", + "version": "1.0.0", + "id": "f72d7797-c6ee-4fd3-9454-028d0095068b", + "developer": { + "name": "Microsoft Corporation", + "websiteUrl": "https://www.microsoft.com", + "privacyUrl": "https://privacy.microsoft.com/PrivacyStatement", + "termsOfUseUrl": "https://support.microsoft.com/en-us/office/supplementary-terms-of-service-for-teams-apps-powered-by-microsoft-365-services-and-applications-bc6027fe-68c3-4758-a70d-cfe97c43b4e2" + }, + "icons": { + "color": "color.png", + "outline": "outline.png" + }, + "name": { + "short": "Writing Coach", + "full": "Writing Coach" + }, + "description": { + "short": "Take your writing to the next level with Writing Coach", + "full": "Writing Coach is an expert assistant dedicated to providing detailed, constructive feedback and helping you excel in any writing task. Whether you're refining an email, crafting a story, or developing a whitepaper, Writing Coach is here to guide you every step of the way. Writing Coach is designed to work with Microsoft 365 Copilot." + }, + "accentColor": "#FFFFFF", + "composeExtensions": [], + "permissions": [ + "identity", + "messageTeamMembers" + ], + "copilotAgents": { + "declarativeAgents": [ + { + "id": "declarativeAgent", + "file": "declarativeAgent.json" + } + ] + }, + "validDomains": [] +} \ No newline at end of file diff --git a/samples/da-WritingCoach/appPackage/outline.png b/samples/da-WritingCoach/appPackage/outline.png new file mode 100644 index 0000000..58bb760 Binary files /dev/null and b/samples/da-WritingCoach/appPackage/outline.png differ diff --git a/samples/da-WritingCoach/assets/WritingCoach1.png b/samples/da-WritingCoach/assets/WritingCoach1.png new file mode 100644 index 0000000..a54c15f Binary files /dev/null and b/samples/da-WritingCoach/assets/WritingCoach1.png differ diff --git a/samples/da-WritingCoach/assets/WritingCoach2.png b/samples/da-WritingCoach/assets/WritingCoach2.png new file mode 100644 index 0000000..a532d63 Binary files /dev/null and b/samples/da-WritingCoach/assets/WritingCoach2.png differ diff --git a/samples/da-WritingCoach/env/.env.dev b/samples/da-WritingCoach/env/.env.dev new file mode 100644 index 0000000..c53ffe2 --- /dev/null +++ b/samples/da-WritingCoach/env/.env.dev @@ -0,0 +1,8 @@ +# This file includes environment variables that will be committed to git by default. + +# Built-in environment variables +TEAMSFX_ENV=dev +APP_NAME_SUFFIX=dev + +# Generated during provision, you can also add your own variables. +TEAMS_APP_ID= \ No newline at end of file diff --git a/samples/da-WritingCoach/teamsapp.yml b/samples/da-WritingCoach/teamsapp.yml new file mode 100644 index 0000000..30f4ec9 --- /dev/null +++ b/samples/da-WritingCoach/teamsapp.yml @@ -0,0 +1,81 @@ +# yaml-language-server: $schema=https://aka.ms/teams-toolkit/v1.7/yaml.schema.json +# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file +# Visit https://aka.ms/teamsfx-actions for details on actions +version: v1.7 + +environmentFolderPath: ./env + +# Triggered when 'teamsapp provision' is executed +provision: + # Creates a Teams app + - uses: teamsApp/create + with: + # Teams app name + name: Writing Coach${{APP_NAME_SUFFIX}} + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + teamsAppId: TEAMS_APP_ID + + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your Teams app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 + with: + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID + +# Triggered when 'teamsapp publish' is executed +publish: + # Build Teams app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the Teams app manifest to an existing Teams app in + # Teams Developer Portal. + # Will use the app id in manifest file to determine which Teams app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Publish the app to + # Teams Admin Center (https://admin.teams.microsoft.com/policies/manage-apps) + # for review and approval + - uses: teamsApp/publishAppPackage + with: + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + publishedAppId: TEAMS_APP_PUBLISHED_APP_ID +projectId: 6f3e6cba-5cb0-43fb-9865-fa4abfde6554