feat(examples): make get-weather-js work without an API key#294
Conversation
|
@microsoft-github-policy-service agree |
|
|
||
| /// Weather information services | ||
| world weather-mcp { | ||
| import wasi:config/store@0.2.0-draft; |
There was a problem hiding this comment.
We don't need wasi:config/store anymore because we don't have an API key to read.
|
@bowlofarugula This is great! However, could you add this as a new example alongside the existing one? I like having one with no API key, but right now the current weather example is the only one that uses wasi-config to show how you could load an API key and I don't want to lose that |
Replace OpenWeatherMap API with Open-Meteo's free weather API in the
get-weather-js example. This removes the API key requirement, making
the example more accessible for users to test without registration.
You can validate with
```javascript
node -e "import('./weather.js').then(m => m.getWeather('Paris').then(console.log)).catch(e => console.error(e.toString()))"
```
Signed-off-by: Ian McDonald <bowlofarugula@gmail.com>
2d44716 to
8276bcd
Compare
|
@thomastaylor312 Done. lmk if there's anything else you'd like to see adjusted. A suggestion: I can follow up this PR with another that adds a Reasoning: Probably 0 people are going to create a new account on a weather API service they'll never use, just to run a toy weather example. Especially with an alternative right next to it that doesn't require that. Since the point of the example is to document loading values from wasi-config, why not make it more interesting? I think the discord idea is nice because (1) Many Wassette users will have discord already, and (2) It could be nice for your live demos, where you would write messages into discord live and have an agent see them. Could end up as a showcase of Wassette's advantages wrt prompt injection attacks via that vector too. |
|
I'm all onboard with having another example using something like Discord if you'd like to do that! |
Replace OpenWeatherMap API with Open-Meteo's free weather API in the get-weather-js example. This removes the API key requirement, making the example more accessible for users to test without registration.
https://github.com/open-meteo/open-meteo
You can validate with