### Start the Backend Service Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/human-in-the-loop/README.md Run this command to install dependencies, create a dev tunnel, and start the backend server. Keep this running while testing. ```bash node setup.js ``` -------------------------------- ### Local Development Setup Commands Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/servicenow-widget/README.md Commands to set up and run the widget locally for development and debugging. This includes installing dependencies, copying configuration, building the bundle, and serving the project. ```bash cd ServiceNowWidget npm install # Copy sample config and fill in your agent settings cp test-page/config.sample.js test-page/config.js # Build the bundle (with watch mode for development) npm run dev # In another terminal, serve the project npx serve . -l 5500 ``` -------------------------------- ### Start Development Server Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/assistant-ui/assistant-ui-mcs/README.md Start the development server using npm, yarn, pnpm, or bun. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Create and Use Copilot Studio Client Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/reasoning-display/pkg/agents-copilotstudio-client/README.md Example of creating a Copilot Studio client by loading settings from environment variables, acquiring a token, and starting a conversation. The replies are then logged to the console. ```typescript const createClient = async (): Promise => { const settings = loadCopilotStudioConnectionSettingsFromEnv() const token = await acquireToken(settings) const copilotClient = new CopilotStudioClient(settings, token) return copilotClient } const copilotClient = await createClient() const replies = await copilotClient.startConversationAsync(true) replies.forEach(r => console.log(r.text)) ``` -------------------------------- ### Start Server Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/pass-resources-as-inputs/README.md Starts the MCP server. Use 'npm run dev' for development mode. ```bash npm start # or npm run dev ``` -------------------------------- ### Start Chat UI Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/order-management-enhanced-tc/README.md Copy the sample environment file and then start the chat UI. Ensure the .env file is configured with your agent details, referring to the SETUP.md for comprehensive instructions. ```bash cp chat-ui/.env.sample chat-ui/.env # Edit chat-ui/.env — see SETUP.md for details node scripts/start-ui.mjs ``` -------------------------------- ### Install Copilot Studio Client Package Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/reasoning-display/pkg/agents-copilotstudio-client/README.md Use npm or yarn to install the client library. Ensure you have a valid JWT token for initialization. ```sh npm install @microsoft/agents-copilotstudio-client ``` -------------------------------- ### Install Dependencies Source: https://github.com/microsoft/copilotstudiosamples/blob/main/testing/functional/PytestAgentsSDK/README.md Install all required Python packages listed in the requirements.txt file. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install Dependencies Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/assistant-ui/assistant-ui-mcs/README.md Install project dependencies using npm, yarn, pnpm, or bun. ```bash npm install # or yarn install # or pnpm install # or bun install ``` -------------------------------- ### Start Development Server Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/assistant-ui/README.md Start the development server to run the React application locally. Access the application at http://localhost:3000. ```bash npm run dev ``` -------------------------------- ### Install Node.js Dependencies Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/order-management-enhanced-tc/README.md Run this command to install the necessary Node.js dependencies for the project. ```bash node scripts/setup.mjs ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/assistant-ui/README.md Clone the repository and navigate to the project directory to begin setup. ```bash git clone https://github.com/microsoft/CopilotStudioSamples cd CopilotStudioSamples/ui/custom-ui/assistant-ui/assistant-ui-mcs ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/assistant-ui/assistant-ui-mcs/README.md Clone the GitHub repository and navigate to the project directory for setup. ```bash git clone https://github.com/microsoft/CopilotStudioSamples cd CopilotStudioSamples/AssistantUICopilotStudioClient/assistant-ui-mcs ``` -------------------------------- ### Install Node.js Dependencies Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/agents-sdk/call-agent-connector/SyncToAsyncService/README.md Install the necessary Node.js dependencies for the SyncToAsyncService function. ```bash npm install ``` -------------------------------- ### Install and Build Project Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/pass-resources-as-inputs/README.md Installs project dependencies and builds the TypeScript code. Ensure Node.js 18+ is installed. ```bash npm install npm run build ``` -------------------------------- ### Example Test Cases CSV Source: https://github.com/microsoft/copilotstudiosamples/blob/main/testing/functional/PytestAgentsSDK/README.md Example of how to structure the input_text and expected_output columns in the test_cases.csv file. ```csv input_text,expected_output What is the capital of France?,The capital of France is Paris, which is known for its historical landmarks like the Eiffel Tower and the Louvre Museum. Who wrote 'Hamlet'?,William Shakespeare wrote the play 'Hamlet', which is considered one of the greatest works of English literature. What is the chemical symbol for water?,H3O is the correct chemical symbol for water. ``` -------------------------------- ### Install and Create Power Platform Environment Source: https://github.com/microsoft/copilotstudiosamples/blob/main/testing/evaluation/EvalGateADO/README.md Installs the Power Apps CLI and creates a new developer environment. It also generates a service principal for pipeline access to the environment. ```bash dotnet tool install --global Microsoft.PowerApps.CLI.Tool pac admin create --name "CI - MyAgent" --type Developer --region unitedstates pac admin create-service-principal --environment ``` -------------------------------- ### Example Queries for MCP Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/pass-resources-as-inputs/README.md These examples demonstrate how to interact with MCP functions for text generation and character counting. They show the expected input format and the resulting resource links or counts. ```text Generate some placeholder text → Calls generate_text() and returns a resource link ``` ```text How many characters are in generated-text:///3? → Calls count_characters({ "resourceUri": "generated-text:///3" }) ``` ```text Count the characters in "quick brown fox" → Calls count_characters({ "text": "quick brown fox" }) ``` -------------------------------- ### Run the Application Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/d365-cs-okta/docs/README-RunOnLocalMachine.md Navigate to your project directory and execute the application using Node.js. This command starts the server for testing the SSO flow. ```bash node app.js ``` -------------------------------- ### ServiceNow Widget Server Script Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/servicenow-widget/README.md Example of a server script within a ServiceNow widget. It demonstrates how to retrieve system properties, which are used for agent configuration. ```javascript gs.getProperty() ``` -------------------------------- ### Jekyll Configuration Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/CLAUDE.md This is the main Jekyll configuration file for the site. ```yaml _config.yml # Jekyll configuration ``` -------------------------------- ### Start Jekyll Development Server Source: https://github.com/microsoft/copilotstudiosamples/blob/main/CLAUDE.md Command to start the Jekyll development server with live reload enabled. The site will be available at http://127.0.0.1:4000/CopilotStudioSamples/. ```bash # Start dev server with live reload bundle exec jekyll serve # Site at http://127.0.0.1:4000/CopilotStudioSamples/ ``` -------------------------------- ### ServiceNow Widget Client Script Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/servicenow-widget/README.md Example of a client script within a ServiceNow widget. It shows how to initialize the Copilot Chat functionality with configuration data obtained from the server script. ```javascript CopilotChat.init() ``` -------------------------------- ### Check .NET SDK Version Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/agents-sdk/multilingual-bot/Bot/README.md Use this command to verify that you have the required .NET SDK version installed. ```bash dotnet --version ``` -------------------------------- ### Jekyll Includes Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/CLAUDE.md This file is used for including source links and external links. ```html _includes/ # source_link.html (Browse source / external link button) ``` -------------------------------- ### Run HandoverToLiveAgentSample Skill Locally Source: https://github.com/microsoft/copilotstudiosamples/blob/main/contact-center/skill-handoff/README.md Execute the HandoverToLiveAgentSample skill project using the .NET CLI. This command starts the skill service on your local machine. ```bash dotnet run --project .\HandoverToLiveAgentSample\HandoverToLiveAgentSample.csproj ``` -------------------------------- ### Start MCP Servers and Tunnels Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/order-management-enhanced-tc/README.md Execute this script to start both the Order Management and Warehouse MCP servers, and to create anonymous development tunnels. Note the tunnel URLs provided in the output for subsequent configuration. ```bash node scripts/start.mjs ``` -------------------------------- ### Clone Repository Source: https://github.com/microsoft/copilotstudiosamples/blob/main/testing/functional/PytestAgentsSDK/README.md Clone the repository to get the project files. Navigate into the project directory. ```bash git clone https://github.com/microsoft/CopilotStudioSamples.git cd CopilotStudioSamples/FunctionalTesting/PytestAgentsSDK ``` -------------------------------- ### Get Language From URI Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/agents-sdk/multilingual-bot/README.md This example shows how the GetLanguageFromUri variable can be configured to enable language detection from the connection endpoint. ```url http://localhost:3979/api/messages/es ``` -------------------------------- ### Example Output for Manager Reportees Source: https://github.com/microsoft/copilotstudiosamples/blob/main/EmployeeSelfServiceAgent/WorkdayDA/ManagerScenarios/WorkdayGetManagerReporteesTimeInPosition/README.md This is an example of how the agent presents the retrieved reportee information, including their name, job title, time in position, start date, and status. The output is formatted as a nested markdown list. ```Markdown Here are your direct reports and their time in current position: - **John Smith** - Senior Developer - Time in Position: 2 years, 5 months, 12 days - Position Start: 2022-07-15 - Status: Active - **Jane Doe** - Product Manager - Time in Position: 1 year, 2 months, 3 days - Position Start: 2023-10-20 - Status: Active ``` -------------------------------- ### Build Project Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/a2a/Simple-A2A-Sample/README.md Build the .NET project. ```bash dotnet build ``` -------------------------------- ### Build Copilot Chat Widget Bundle Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/servicenow-widget/docs/MANUAL-SETUP.md Navigate to the widget's directory and run npm install followed by npm run build to create the distributable JavaScript file. ```bash cd ServiceNowWidget npm install npm run build ``` -------------------------------- ### Deploy the Widget to ServiceNow Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/servicenow-widget/README.md Copy the sample deployment configuration, fill in your specific values, and then run the deploy script. This script automates the creation of necessary ServiceNow records and uploads the widget bundle. ```bash # Copy sample config and fill in your values cp scripts/deploy-config.sample.json scripts/deploy-config.json # Deploy npm run deploy ``` -------------------------------- ### Verify Node.js Version Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/agents-sdk/call-agent-connector/SyncToAsyncService/README.md Check if the installed Node.js version is 20.x or higher. If not, install Node.js 20.x. ```bash # Check your Node.js version node -v # Should output v20.x.x or higher # If not, install Node.js 20.x from https://nodejs.org/ ``` -------------------------------- ### Install Jekyll Dependencies Source: https://github.com/microsoft/copilotstudiosamples/blob/main/CLAUDE.md Command to install Jekyll dependencies. Run this command only the first time you set up the project locally. ```bash # Install dependencies (first time only) bundle install ``` -------------------------------- ### Media Viewer Setup and Event Handling Source: https://github.com/microsoft/copilotstudiosamples/blob/main/testing/functional/PytestAgentsSDK/reports/multi_turn_eval_openai.html Initializes the media viewer UI, including displaying the active media, updating the counter, and setting up navigation controls. Handles opening images in a new tab. ```javascript const setup = (resultBody, assets) => { if (!assets.length) { resultBody.querySelector('.media').classList.add('hidden') return } const mediaViewer = new MediaViewer(assets) const container = resultBody.querySelector('.media-container') const leftArrow = resultBody.querySelector('.media-container__nav--left') const rightArrow = resultBody.querySelector('.media-container__nav--right') const mediaName = resultBody.querySelector('.media__name') const counter = resultBody.querySelector('.media__counter') const imageEl = resultBody.querySelector('img') const sourceEl = resultBody.querySelector('source') const videoEl = resultBody.querySelector('video') const setImg = (media, index) => { if (media?.format_type === 'image') { imageEl.src = media.path imageEl.classList.remove('hidden') videoEl.classList.add('hidden') } else if (media?.format_type === 'video') { sourceEl.src = media.path videoEl.classList.remove('hidden') imageEl.classList.add('hidden') } mediaName.innerText = media?.name counter.innerText = `${index + 1} / ${assets.length}` } setImg(mediaViewer.activeFile, mediaViewer.currentIndex) const moveLeft = () => { const [media, index] = mediaViewer.prevActive() setImg(media, index) } const doRight = () => { const [media, index] = mediaViewer.nextActive() setImg(media, index) } const openImg = () => { window.open(mediaViewer.activeFile.path, '_blank') } if (assets.length === 1) { container.classList.add('media-container--fullscreen') } else { leftArrow.addEventListener('click', moveLeft) rightArrow.addEventListener('click', doRight) } imageEl.addEventListener('click', openImg) } module.exports = { setup, } ``` -------------------------------- ### Enable Static Website Hosting Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/d365-cs-okta/docs/README-RunOnLocalMachine.md Configure the Azure Storage Account to serve static website content. Specify the index and error document names. ```bash az storage blob service-properties update --account-name --static-website --404-document --index-document ``` -------------------------------- ### Start a Conversation with Copilot Studio Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/reasoning-display/README.md Starts a new conversation with the Copilot Studio agent. The `conversationId` is extracted from the first activity. ```javascript const copilotClient = await createCopilotClient(); let conversationId; for await (const act of copilotClient.startConversationAsync(true)) { conversationId = act.conversation?.id ?? conversationId; if (conversationId) break; } ``` -------------------------------- ### Run Application Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/a2a/Simple-A2A-Sample/README.md Run the .NET application. ```bash dotnet run ``` -------------------------------- ### Translator Category ID Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/agents-sdk/multilingual-bot/README.md This is an example of how to configure the TranslatorCategoryId variable, which is optional and used for custom dictionaries in the translator service. ```json { "TranslatorCategoryId": { "en": { "dictionary": "category-id" } } } ``` -------------------------------- ### Jekyll Liquid Escaping Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/CLAUDE.md Example of wrapping markdown containing Liquid syntax with raw tags to prevent parsing issues. ```markdown {% raw %} ``` https://example.com?params={%22key%22:%22value%22} ``` {% endraw %} ``` -------------------------------- ### Start Bot Conversation Automatically Source: https://github.com/microsoft/copilotstudiosamples/blob/main/sso/entra-id/index.html Configure the bot to automatically start the conversation when the chat widget loads. This is useful for initiating the 'Greeting' System Topic. ```javascript if (action.type === "DIRECT_LINE/CONNECT_FULFILLED") { dispatch({ meta: { method: "keyboard", }, payload: { activity: { channelData: { postBack: true, }, // Web Chat will show the 'Greeting' System Topic message which has a trigger-phrase 'hello' name: "startConversation", type: "event" }, }, type: "DIRECT_LINE/POST_ACTIVITY", }); } ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/d365-cs-okta/docs/README-RunOnLocalMachine.md Change the current directory to the root of the cloned project. ```bash cd ``` -------------------------------- ### Templated Test Set Placeholder Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/EmployeeSelfServiceAgent/ESSEvaluationSamples/README.md Example of a placeholder within a test set template. Replace values inside <> with your organization's specific data. ```text What is my employee ID? Employee ID <21514> ``` -------------------------------- ### One-Step Deploy Script (macOS / Linux) Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/dynamic-mcp-routing-typescript/README.md Execute the provided bash script for a streamlined deployment process, which includes login, server setup, tunnel creation, and connector deployment. Replace YOUR_ENVIRONMENT_ID with your actual environment ID. ```bash ./scripts/deploy.sh YOUR_ENVIRONMENT_ID [TENANT_ID] ``` -------------------------------- ### Local Testing Commands Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/sharepoint-customizer/README.md Use these Gulp commands to serve the SharePoint solution locally for testing. Ensure Node.js and npm are installed, and install `gulp-cli` globally if needed. ```bash # Install dependencies npm install # Check if gulp is installed, if not, install it which gulp || npm install -g gulp-cli # On Windows, use: where gulp || npm install -g gulp-cli # Serve the solution locally gulp serve --nobrowser ``` -------------------------------- ### Run Azure Function Locally Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/agents-sdk/call-agent-connector/SyncToAsyncService/README.md Start the Azure Function locally using npm start or Azure Functions Core Tools. The function will be accessible at http://localhost:7071/api/SyncToAsyncService. ```bash npm start ``` ```bash func start ``` -------------------------------- ### Clone Repository Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/d365-cs-okta/docs/README-RunOnLocalMachine.md Clone the sample application repository from the provided URL to your local machine. ```bash git clone ``` -------------------------------- ### Create Azure Storage Account Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/embed/d365-cs-okta/docs/README-RunOnLocalMachine.md Create an Azure Storage Account to host the static website. Ensure you replace placeholders with your specific details. ```bash az storage account create --name --resource-group --location --sku ``` -------------------------------- ### Start Catalog and MCP Servers Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/dynamic-mcp-routing-typescript/README.md These commands start the catalog and MCP servers in separate terminals. The catalog server runs on port 3000 and the MCP server on port 3001. ```bash # Terminal 1 — Catalog server (port 3000) npm run start:catalog # Terminal 2 — MCP server (port 3001) npm run start:mcp ``` -------------------------------- ### Example Queries for Species Data Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/mcp/search-species-resources-typescript/README.md These examples demonstrate how to query for species information using natural language. The queries map to specific MCP functions like `listSpecies()` and `searchSpeciesData()`. ```plaintext What species do you have? → Calls listSpecies() Tell me about butterflies → Calls searchSpeciesData("butterflies") → Returns Monarch Butterfly resources Show me a blue whale photo → Calls searchSpeciesData("blue whale photo") → Returns image resource ``` -------------------------------- ### Local Testing Commands Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/human-in-the-loop/README.md Commands to set up and run the backend and simulate connector calls locally. ```bash # Terminal 1: Start the backend npm install && npm start # Terminal 2: Simulate a connector call node test-local.js # Browser: Open http://localhost:3978 ``` -------------------------------- ### Initialize Copilot Studio Client Source: https://github.com/microsoft/copilotstudiosamples/blob/main/ui/custom-ui/reasoning-display/README.md Initializes the Copilot Studio client with settings and an authentication token. Ensure you have a way to acquire the token, such as the `acquireToken` function. ```javascript import { CopilotStudioClient } from '@microsoft/agents-copilotstudio-client'; import { acquireToken } from './acquireToken.js'; import { settings } from './settings.js'; export const createCopilotClient = async () => { const token = await acquireToken(settings); return new CopilotStudioClient(settings, token); }; ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/microsoft/copilotstudiosamples/blob/main/testing/functional/PytestAgentsSDK/README.md Create a Python virtual environment and activate it for dependency management. Use the appropriate command for your operating system. ```bash python3 -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate` ``` -------------------------------- ### Jekyll Dependencies Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/CLAUDE.md Lists the Jekyll dependencies for the project. ```ruby Gemfile # Jekyll dependencies ``` -------------------------------- ### Clone Repository and Navigate to Function Directory Source: https://github.com/microsoft/copilotstudiosamples/blob/main/extensibility/agents-sdk/call-agent-connector/SyncToAsyncService/README.md Clone the CopilotStudioSamples repository and navigate to the SyncToAsyncService directory to begin local development. ```bash # Clone the repository git clone https://github.com/microsoft/CopilotStudioSamples.git # Navigate to the SyncToAsyncService directory cd CopilotStudioSamples/CallAgentConnector/SyncToAsyncService ``` -------------------------------- ### Jekyll Layouts Example Source: https://github.com/microsoft/copilotstudiosamples/blob/main/CLAUDE.md Custom default layout for the Jekyll site. ```html _layouts/ # Custom default.html (adds Browse source button) ``` -------------------------------- ### Skill Endpoint URL Source: https://github.com/microsoft/copilotstudiosamples/blob/main/contact-center/skill-handoff/HandoverToLiveAgentSample/README.md The skill endpoint will be available at this URL after the application starts. ```plaintext http://localhost:5001/api/messages ```