### Agent Prompt Examples for Tool and Knowledge Source Selection Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/generative-mode-guidance These instructions guide the agent on when to use specific knowledge sources or topics. They are useful for disambiguating choices when multiple options might be relevant. ```text Use the FAQ documents only if the question is not relevant to Hours, Appointments, or Billing. Only use the ticket creation topic for creating tickets. For other requests related to fixing issues, use the troubleshooting topic. ``` -------------------------------- ### Specify Tool Usage in Instructions Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/generative-mode-guidance When there are many tools, explicitly mention the tool name using '/' to guide the agent. Numbered instructions help ensure the agent follows them in order. ```markdown 1. When the user has provided details of their preferred laptop, create a purchase order using /"Purchase Order". ``` -------------------------------- ### Generic Rubric Example Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/kit-rubrics-best-practices An example of a rubric that is too generic for effective AI evaluation. ```text What good looks like: A helpful, accurate response Grade 5: Excellent response Grade 1: Bad response ``` -------------------------------- ### Example Localization File Content Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/localize-adaptive-cards This JSON snippet shows an example of a localization file entry for an Adaptive Card. It includes a key representing the Adaptive Card element and its value containing static text and placeholders. ```json { "'dialog(copilots_header_392e9.topic.recommendbooks)'.'trigger(main)'.'action(readingProgress)'.Value": "You are approving request {Topic.requestId} totaling {Topic.formattedTotal} for {Topic.businessUnit}" } ``` -------------------------------- ### Domain-Specific Rubric Example Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/kit-rubrics-best-practices An example of a domain-specific rubric tailored for investor relations responses. ```text What good looks like: A professional investor relations response that includes relevant financial metrics, explains business drivers, maintains formal tone, and provides forward-looking context appropriate for shareholder communications. Grade 5 (Exemplary): Includes all key IR elements (KPIs, performance drivers, strategic context, forward-looking insights), maintains polished professional tone, flows logically, and requires no improvements. ``` -------------------------------- ### Example YAML Structure for a Topic Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/topics-code-editor This snippet displays a typical block of YAML used to configure a Copilot Studio topic. It illustrates various components like topic type, conversational boosting, generative answers, variables, prompts, knowledge sources, and condition groups. ```yaml type: conversational "conversational_boosting": enabled: true similarity_threshold: 0.62 "generative_answers": enabled: true search_keywords: "{search_keywords}" "variables": - name: "$myVariable" type: "String" value: "some value" "prompt": prompt_type: "custom" prompt_content: "This is a custom prompt." "knowledge_sources": - id: "knowledgeSource1" type: "url" url: "https://www.example.com" - id: "knowledgeSource2" type: "url" url: "https://www.another-example.com" "condition_groups": - id: "conditionGroup1" conditions: - id: "condition1" formula: "$myVariable = 'test'" redirect_to: "Topic.End" - id: "condition2" formula: "$myVariable = 'another test'" redirect_to: "Topic.End" ``` -------------------------------- ### Rubric Grade Distinctions Example Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/kit-rubrics-best-practices An example demonstrating clear and distinguishable characteristics for each grade level in a rubric. ```text Grade 5: Includes metrics, drivers, context, and forward insights; professional tone; logical flow; investor-ready polish Grade 4: Includes metrics, drivers, and context; mostly professional tone; generally logical flow; minor polish needed Grade 3: Includes metrics and basic context; acceptable tone but generic; functional but lacks depth Grade 2: Missing key metrics or context; inconsistent tone; gaps in logic Grade 1: Missing most expected elements; unprofessional tone; confusing structure ``` -------------------------------- ### Example of Poor Human Reasoning Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/kit-rubrics-refinement-workflow An example of insufficient human reasoning, lacking specific details or justification for the assigned grade. ```text Grade 4: Pretty good. ``` -------------------------------- ### Transform API Response for Copilot Studio Source: https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/custom-knowledge-sources This Adaptive Dialog example demonstrates how to make an HTTP request to a search API and transform its results to the format Copilot Studio expects. It uses `HttpRequestAction` to fetch data and `SetVariable` with `ForAll` to map the API's 'snippet', 'url', and 'title' to Copilot Studio's 'Content', 'ContentLocation', and 'Title'. ```yaml kind: AdaptiveDialog beginDialog: kind: OnKnowledgeRequested id: main intent: {} actions: - kind: HttpRequestAction id: searchRequest url: ="https://search-api.contoso.com/search?q=" & System.KeywordSearchQuery response: Topic.searchResults responseSchema: kind: Record properties: query: String results: type: kind: Table properties: snippet: String title: String url: String - kind: SetVariable id: setSearchResults variable: System.SearchResults value: |- =ForAll(Topic.searchResults.results, { Content: snippet, ContentLocation: url, Title: title }) inputType: {} outputType: {} ```