Complete AI Tools Ecosystem: Search, Voice, WebUI, and Business Intelligence | Original
Table of Contents
- Jina AI
- Python Script for Jina AI Integration
- URL Content Fetching with
r.jina.ai
- Search Query Processing with
s.jina.ai
- Base64 Encoding and API Authentication
- Tavily AI
- AI Search API Specifically for LLM Applications
- Setup and API Key Registration
- Python Client Implementation
- Search Request Examples and Usage
- Open WebUI
- Local AI Interface Installation
- Server Setup and Configuration
- Ollama Integration for Local Models
- Installation Time and Requirements
- Tableau, Scale, and Power BI
- Business Intelligence Platforms Comparison
- Tableau 13-Day Trial Experience
- Scale Data Platform Overview
- Microsoft Power BI Features
- Using OpenRouter
- China Visa Card Payment Acceptance
- Model Rankings and Trending Analysis
- LLM Usage Categories and Applications
- Hong Kong VPN Requirements for Anthropic API
- ElevenLabs AI
- Text-to-Speech API Integration
- Voice Cloning Capabilities
- Multi-Language Audio Generation
- Python Script for Audio Conversion
Jina AI
This Python script interacts with Jina AI services using API keys and command-line arguments. It supports two main jobs: fetching content from a URL and performing a search query. The script retrieves the Jina API key from the environment variables, ensuring secure access to the services. It uses the requests
library to make HTTP requests and base64
to decode the search query. The script then prints the response from the Jina AI service.
import os
import requests
from dotenv import load_dotenv
import argparse
import base64
load_dotenv()
api_key = os.environ.get("JINA_API_KEY")
if not api_key:
raise ValueError("JINA_API_KEY environment variable not set.")
parser = argparse.ArgumentParser()
parser.add_argument("--job", type=str, choices=['url', 'search'], help="Job to execute (url or search)", required=True)
parser.add_argument("--input", type=str, help="Input for the job", required=True)
args = parser.parse_args()
if args.job == 'url':
url = f'https://r.jina.ai/{args.input}'
headers = {'Authorization': f'Bearer {api_key}'}
print(f"URL: {url}")
print(f"Headers: {headers}")
response = requests.get(url, headers=headers)
print(response.text)
elif args.job == 'search':
question = base64.b64decode(args.input).decode('utf-8', errors='ignore')
url = f'https://s.jina.ai/{question}'
headers = {
'Authorization': f'Bearer {api_key}',
'X-Engine': 'direct',
'X-Retain-Images': 'none'
}
print(f"URL: {url}")
print(f"Headers: {headers}")
response = requests.get(url, headers=headers)
print(response.text)
else:
print("Please specify --job url or --job search")
Tavily AI
Tavily is an AI search API designed specifically for LLM applications. It provides highly relevant search results by combining web search with AI processing.
To use Tavily, you’ll need to:
- Sign up for an API key at tavily.com
- Install the Python package.
import os
from tavily import TavilyClient
# Retrieve the API key from the environment variable
TAVILY_API_KEY = os.getenv('TAVILY_API_KEY')
if TAVILY_API_KEY is None:
raise ValueError("API key not found. Please set the TAVILY_API_KEY environment variable.")
# Initialize the TavilyClient with the retrieved API key
tavily_client = TavilyClient(api_key=TAVILY_API_KEY)
# Make a search request
response = tavily_client.search("Who is Leo Messi?")
# Print the response
print(response)
Open WebUI
-
Open WebUI is a great tool.
-
To start the server, execute these commands:
pip install open-webui
andopen-webui serve
. -
The installation process may take some time (approximately 10 minutes or more).
-
Open WebUI works well with Ollama.
Tableau, Scale, and Power BI
Tableau
After registering, I was informed that I have 13 days to try the service.
source: tableau.com
Scale
source: scale.com
Power BI
Using OpenRouter
-
China-issued Visa credit cards are accepted.
-
The Rankings page is interesting for seeing the hottest and trending models.
-
You can see how people use LLM models in categories like Roleplay, Programming, Marketing, Marketing/SEO, and Technology.
-
For users in Hong Kong, a VPN is still required to access the Anthropic API.
ElevenLabs AI
-
Great. I used $5 USD to test the service.
-
Voice cloning is great.
-
Audio samples below:
import os
import requests
from dotenv import load_dotenv
import argparse
import re
load_dotenv()
api_key = os.environ.get("ELEVENLABS_API_KEY")
if not api_key:
raise ValueError("ELEVENLABS_API_KEY environment variable not set.")
parser = argparse.ArgumentParser()
parser.add_argument("--file", type=str, help="Markdown file to convert to speech", required=False)
parser.add_argument("--text", type=str, help="Text to convert to speech", required=False)
parser.add_argument("--output", type=str, help="Output file name", required=True)
parser.add_argument("--voice_id", type=str, default="21m00Tcm4TlvDq8iK2G8", help="Voice ID to use")
args = parser.parse_args()
if args.file:
try:
with open(args.file, 'r') as f:
content = f.read()
# Remove front matter
content = re.sub(r'---.*?---', '', content, flags=re.DOTALL)
text = content.strip()
except FileNotFoundError:
print(f"Error: File not found: {args.file}")
exit(1)
except Exception as e:
print(f"Error reading file: {e}")
exit(1)
elif args.text:
text = args.text
else:
print("Error: Either --file or --text must be specified.")
exit(1)
url = f"https://api.elevenlabs.io/v1/text-to-speech/{args.voice_id}"
headers = {
"Accept": "audio/mpeg",
"Content-Type": "application/json",
"xi-api-key": api_key
}
data = {
"text": text,
"model_id": "eleven_flash_v2_5",
"voice_settings": {
"stability": 0.5,
"similarity_boost": 0.5
}
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
with open(args.output, 'wb') as f:
f.write(response.content)
print(f"Audio saved to {args.output}")
else:
print(f"Error: {response.status_code} - {response.text}")