Last active
October 26, 2025 14:41
-
-
Save vman/15b44a637dd77fea35cfd64f63590c30 to your computer and use it in GitHub Desktop.
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. | |
| Then call getWeather using those coordinates. If geocoding returns no results, | |
| ask for a more specific city or country. Show the Adaptive Card when available. | |
| Prefer concise answers. | |
| """) | |
| @conversationStarter(#{ title: "Find weather by city", text: "What's the weather in Seattle right now?" }) | |
| @conversationStarter(#{ title: "Weather with country", text: "Show me the weather in Paris, France" }) | |
| @conversationStarter(#{ title: "Use coordinates", text: "Get weather for latitude 40.7128 and longitude -74.0060" }) | |
| namespace WeatherAgent { | |
| /// Resolve a city name to coordinates using Open-Meteo Geocoding. | |
| op searchCity is GeoAPI.searchCity; | |
| /// Fetch current weather for coordinates using Open-Meteo Forecast. | |
| op getWeather is WeatherAPI.getWeather; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment