This commit is contained in:
derpystuff 2022-05-24 21:22:47 +02:00
parent 726861294b
commit aec828beb5
14 changed files with 421 additions and 25 deletions

View file

@ -8,6 +8,8 @@ const Hosts = Object.freeze({
const Api = Object.freeze({
HOST: Hosts.prod,
GOOGLE_VISION_OCR: '/google/vision/ocr',
SEARCH_LYRICS: '/search/lyrics',
SEARCH_GOOGLE: '/search/google',
@ -17,8 +19,9 @@ const Api = Object.freeze({
SEARCH_WOLFRAM_ALPHA: '/search/wolfram-alpha',
PHOTOFUNIA_YACHT: '/photofunia/yacht',
PHOTOFUNIA_RETRO_WAVE: '/photofunia/retro-wave',
INFERKIT: '/inferkit',
INFERKIT: '/utils/inferkit',
})
const Static = Object.freeze({

View file

@ -40,6 +40,12 @@ async function request(path, type, headers, args, host) {
throw new Error("unsupported, must either use GET or POST");
}
module.exports.googleVisionOcr = async function(context, url){
return await request(Api.GOOGLE_VISION_OCR, "GET", {}, {
url: url
})
}
module.exports.lyrics = async function(context, query){
return await request(Api.SEARCH_LYRICS, "GET", {}, {
q: query
@ -82,6 +88,16 @@ module.exports.yacht = async function(context, text){
})
}
module.exports.retroWave = async function(context, background = 5, textStyle= 4, text1 = " ", text2 = " ", text3 = " "){
return await request(Api.PHOTOFUNIA_RETRO_WAVE, "GET", {}, {
text1: text1,
text2: text2,
text3: text3,
background: background,
text_style: textStyle
})
}
module.exports.inferkit = async function(context, input){
return await request(Api.INFERKIT, "GET", {}, {
input: input