This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 🧠 REASONING SUMMARY | |
| ──────────────────── | |
| Compute distance for each segment (speed × time), add them for total distance, then divide total distance by total time to get average speed. | |
| ✅ FINAL ANSWER | |
| ──────────────────── | |
| Distance = (60 mph × 2.5 h) + (40 mph × 1.5 h) = 150 + 60 = 210 miles. | |
| Total time = 2.5 + 1.5 = 4.0 hours. | |
| Average speed = 210 ÷ 4.0 = 52.5 mph. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using OpenAI; | |
| using OpenAI.Responses; | |
| using System.ClientModel; | |
| static string Require(string? v, string name) | |
| => string.IsNullOrWhiteSpace(v) ? throw new InvalidOperationException($"{name} is missing") : v; | |
| var endpoint = Require(Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT"), "AZURE_OPENAI_ENDPOINT"); | |
| // Example endpoint: https://YOUR-RESOURCE-NAME.openai.azure.com | |
| var apiKey = Require(Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY"), "AZURE_OPENAI_API_KEY"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dotnet new console -n AzureOpenAIReasoningSummary | |
| cd AzureOpenAIReasoningSummary | |
| dotnet add package OpenAI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Delegated token for the signed-in user with Files.Read.All + Sites.Read.All | |
| $token = "<ACCESS_TOKEN>" | |
| $body = @{ | |
| queryString = "What is our paternal leave policy?" | |
| dataSource = "sharePoint" | |
| filterExpression = 'path:"https://contoso.sharepoint.com/sites/HR1/"' | |
| resourceMetadata = @("title","author") | |
| maximumNumberOfResults = 4 | |
| } | ConvertTo-Json -Depth 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type": "AdaptiveCard", | |
| "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", | |
| "version": "1.5", | |
| "body": [ | |
| { "type": "TextBlock", "text": "${title}", "size": "Large", "weight": "Bolder" }, | |
| { "type": "FactSet", "facts": [ | |
| { "title": "Temperature", "value": "${current.temperature_2m} °C" }, | |
| { "title": "Wind", "value": "${current.wind_speed_10m} km/h" }, | |
| { "title": "Time", "value": "${current.time}" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type": "AdaptiveCard", | |
| "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", | |
| "version": "1.5", | |
| "body": [ | |
| { "type": "TextBlock", "text": "${title}", "size": "Medium", "weight": "Bolder" }, | |
| { "type": "FactSet", "facts": [ | |
| { "title": "Admin Area", "value": "${admin1}" }, | |
| { "title": "Latitude", "value": "${latitude}" }, | |
| { "title": "Longitude", "value": "${longitude}" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "@typespec/http"; | |
| import "@microsoft/typespec-m365-copilot"; | |
| using TypeSpec.Http; | |
| using TypeSpec.M365.Copilot.Actions; | |
| /* -------- Geocoding (city -> coords) -------- */ | |
| @service | |
| @server("https://geocoding-api.open-meteo.com", "Open-Meteo Geocoding") | |
| @actions(#{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "@typespec/http"; | |
| import "@microsoft/typespec-m365-copilot"; | |
| import "./actions.tsp"; | |
| using TypeSpec.Http; | |
| using TypeSpec.M365.Copilot.Agents; | |
| @agent("Weather Helper", "Gets weather by city name using geocoding + forecast") | |
| @instructions(""" | |
| When a user provides a city, first call searchCity to get latitude/longitude. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "@typespec/http"; | |
| import "@typespec/openapi3"; | |
| import "@microsoft/typespec-m365-copilot"; | |
| import "./actions.tsp"; | |
| using TypeSpec.Http; | |
| using TypeSpec.M365.Copilot; | |
| using TypeSpec.M365.Copilot.Agents; | |
| using TypeSpec.M365.Copilot.Actions; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type": "AdaptiveCard", | |
| "version": "1.5", | |
| "layouts": [ | |
| { | |
| "type": "Layout.AreaGrid", | |
| "targetWidth": "AtLeast:Standard", | |
| "columns": [ | |
| { | |
| "physicalSize": 100, |
NewerOlder