Skip to content

Instantly share code, notes, and snippets.

@business24ai
Last active November 6, 2023 06:39
Show Gist options
  • Save business24ai/43d1f4bb45b8b48c323dda15f285c1bf to your computer and use it in GitHub Desktop.
Save business24ai/43d1f4bb45b8b48c323dda15f285c1bf to your computer and use it in GitHub Desktop.
Flowise get_ip_address_geo_location
const fetch = require('node-fetch');
const url = 'https://free-geo-ip.p.rapidapi.com/json/' + $ip;
const options = {
method: 'GET',
headers: {
'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
'X-RapidAPI-Host': 'free-geo-ip.p.rapidapi.com'
}
};
try {
const response = await fetch(url, options);
const result = await response.text();
console.log('---< IP function >---');
console.log(result);
return(result);
} catch (error) {
console.error(error);
return '';
}
@business24ai
Copy link
Author

Change revoked key with YOUR_RAPIDAPI_KEY

@AmirBotpress
Copy link

How the java function will look like in case of using another chatflow API as a custom tool?

@business24ai
Copy link
Author

How the java function will look like in case of using another chatflow API as a custom tool?

This gist is used in YouTube Video about Flowise. Java is not supported in Flowise for Custom tools
https://youtu.be/HSp9LkkTVY0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment