[nextgen/cardstack] add BUTTON_GENERATOR

- support dynamic button resolving
- update all commands using dynstack to latest api
- add supplemental to wolfram
This commit is contained in:
bignutty 2025-02-21 00:42:21 +01:00
parent 3a016dde3d
commit ecaaba9d3c
10 changed files with 356 additions and 176 deletions

View file

@ -54,6 +54,7 @@ const Api = Object.freeze({
SEARCH_WEATHER: '/search/weather',
SEARCH_WIKIHOW: '/search/wikihow',
SEARCH_WOLFRAM_ALPHA: '/search/wolfram-alpha',
SEARCH_WOLFRAM_SUPPLEMENTAL: '/search/wolfram-supplemental',
SEARCH_YOUTUBE: '/search/youtube',
TTS_IMTRANSLATOR: '/tts/imtranslator',

View file

@ -126,7 +126,7 @@ module.exports.googleImages = async function(context, query, nsfw){
})
}
module.exports.googleNews = async function(context, query, nsfw){
module.exports.googleNews = async function(context, query){
return await request(Api.SEARCH_GOOGLE_NEWS, "GET", {}, {
q: query
})
@ -232,6 +232,12 @@ module.exports.wolframAlpha = async function(context, query){
})
}
module.exports.wolframSupplemental = async function(context, supplementalKey){
return await request(Api.SEARCH_WOLFRAM_SUPPLEMENTAL, "GET", {}, {
supplemental_key: supplementalKey
})
}
module.exports.youtube = async function(context, query, category){
return await request(Api.SEARCH_YOUTUBE, "GET", {}, {
q: query,