### Starting Webscout Server Source: https://github.com/oevortex/webscout/blob/main/README.md This section demonstrates two methods to start the Webscout server: using the `start_server` helper function for quick setup with default or custom settings (including no-auth mode), and using `run_api` for more advanced configuration. ```python from webscout.client import start_server # Start with default settings start_server() # Start with custom settings start_server(port=8080, api_key="your-secret-key", default_provider="Claude") # Start in no-auth mode (no API key required) start_server(no_auth=True) # Method 2: Advanced usage with run_api from webscout.client import run_api run_api( host="0.0.0.0", debug=True ) ``` -------------------------------- ### Webscout Quick Start CLI Commands Source: https://github.com/oevortex/webscout/blob/main/README.md Essential command-line interface commands to quickly get started with Webscout after installation. This includes checking the version, performing web searches, starting the API server, and accessing help documentation. ```bash # Check version webscout version # Search the web webscout text -k "python programming" # Start API server webscout-server # Get help webscout --help ``` -------------------------------- ### Start Webscout API Server: Alternative Methods Source: https://github.com/oevortex/webscout/blob/main/README.md Alternative methods to start the Webscout API server using `uv` (without prior installation) or by directly executing the Python module. ```Bash uv run --extra api webscout-server python -m webscout.auth.server ``` -------------------------------- ### Start Webscout OpenAI-Compatible API Server Source: https://github.com/oevortex/webscout/blob/main/README.md Commands to start the Webscout API server with various configurations, including default settings, custom port, API key authentication, no-auth mode, specifying a default provider, and debug mode. ```Bash webscout-server webscout-server --port 8080 webscout-server --api-key "your-secret-key" webscout-server --no-auth $env:WEBSCOUT_NO_AUTH='true'; webscout-server webscout-server --default-provider "Claude" webscout-server --debug webscout-server --help ``` -------------------------------- ### Execute Webscout Python Module Source: https://github.com/oevortex/webscout/blob/main/README.md Demonstrates how to run the Webscout module from the command line, including displaying help information and starting the default Webscout server. ```Bash python -m webscout --help python -m webscout-server ``` -------------------------------- ### Webscout Direct CLI Usage Source: https://github.com/oevortex/webscout/blob/main/README.md Demonstrates direct command-line usage of Webscout after installation via `uv tool install` or `pip install`. This provides immediate access to help and the API server. ```bash # Get help webscout --help # Start API server webscout-server ``` -------------------------------- ### Set up Webscout for Development Source: https://github.com/oevortex/webscout/blob/main/README.md Instructions for setting up Webscout in development mode. This involves cloning the repository and installing dependencies using either UV or pip for development and API server functionality. ```bash # Clone the repository git clone https://github.com/OEvortex/Webscout.git cd Webscout # Install in development mode with UV uv sync --extra dev --extra api # Or with pip pip install -e ".[dev,api]" ``` -------------------------------- ### Install Webscout using UV Package Manager Source: https://github.com/oevortex/webscout/blob/main/README.md Learn how to install Webscout using UV, a fast Python package manager. This includes commands for adding Webscout, installing with API dependencies, running directly without installation, and installing as a global UV tool. ```bash # Install UV first (if not already installed) pip install uv # Install Webscout with UV uv add webscout # Install with API dependencies uv add "webscout[api]" # Run Webscout directly with UV (no installation needed) uv run webscout --help # Run with API dependencies uv run webscout --extra api webscout-server # Install as a UV tool for global access uv tool install webscout # Use UV tool commands webscout --help webscout-server ``` -------------------------------- ### Install Webscout using pip Source: https://github.com/oevortex/webscout/blob/main/README.md This section provides commands to install Webscout and its optional dependencies using the standard Python package manager, pip. It covers basic installation, API server dependencies, and development dependencies. ```bash # Install from PyPI pip install -U webscout # Install with API server dependencies pip install -U "webscout[api]" # Install with development dependencies pip install -U "webscout[dev]" ``` -------------------------------- ### Automate Webscout Docker Operations with Makefile Source: https://github.com/oevortex/webscout/blob/main/DOCKER.md Makefile commands for common Webscout Docker operations such as quick start, building, starting services, viewing logs, health checks, and cleanup. ```bash # Quick start (build + run + test) make quick-start # Build image make build # Start services make up # View logs make logs # Run health check make health # Clean up make clean ``` -------------------------------- ### Install Inferno LLM Source: https://github.com/oevortex/webscout/blob/main/README.md Instructions to install the standalone Inferno LLM package using pip, enabling its command-line interface for local LLM management. ```Bash pip install inferno-llm ``` -------------------------------- ### Webscout CLI Usage with UV Run Source: https://github.com/oevortex/webscout/blob/main/README.md Illustrates how to run Webscout CLI commands directly using UV's `uv run` feature, which downloads and executes the application without a prior global installation. This is useful for quick, isolated runs. ```bash # Run directly with UV (downloads and runs automatically) uv run webscout --help uv run --extra api webscout-server ``` -------------------------------- ### Inferno LLM CLI: Model Management Commands Source: https://github.com/oevortex/webscout/blob/main/README.md Commands for managing local LLMs with Inferno, including downloading models from Hugging Face, listing downloaded models, starting a model server, interacting with models, and removing models. ```Bash inferno pull inferno list inferno serve inferno run inferno remove inferno version ``` -------------------------------- ### Configure Webscout API Server with Environment Variables Source: https://github.com/oevortex/webscout/blob/main/README.md Examples of configuring the Webscout API server using environment variables for settings such as no-auth mode, disabling rate limiting, and specifying a custom port. ```Bash $env:WEBSCOUT_NO_AUTH='true'; webscout-server $env:WEBSCOUT_NO_RATE_LIMIT='true'; webscout-server $env:WEBSCOUT_PORT='7860'; webscout-server ``` -------------------------------- ### Install Webscout using Docker Source: https://github.com/oevortex/webscout/blob/main/README.md Commands to quickly deploy Webscout using Docker. This method allows pulling the latest Docker image and running it in an interactive terminal. ```bash # Pull and run the Docker image docker pull oevortex/webscout:latest docker run -it oevortex/webscout:latest ``` -------------------------------- ### Interacting with Webscout Server using cURL Source: https://github.com/oevortex/webscout/blob/main/README.md This section provides examples of interacting with the Webscout server's API endpoints directly using cURL. It covers making a basic chat completion request and listing available models, demonstrating how to include necessary headers like Content-Type and Authorization. ```bash # Basic chat completion request curl http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer your-secret-key" \ -d '{ "model": "gpt-4", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello, how are you?"} ] }' # List available models curl http://localhost:8000/v1/models \ -H "Authorization: Bearer your-secret-key" ``` -------------------------------- ### Access Inferno LLM CLI Help Source: https://github.com/oevortex/webscout/blob/main/README.md Command to display the help menu for the Inferno LLM command-line interface, providing information on available commands and options. ```Bash inferno --help ``` -------------------------------- ### Integrate and Use Meta AI for Chat, Search, and Image Generation Source: https://github.com/oevortex/webscout/blob/main/README.md Demonstrates how to initialize and use the `webscout.Meta` client for AI interactions. It covers basic text prompting, authenticated usage for web search and image generation, and how to access results including sources and media URLs. ```python from webscout import Meta # For basic usage (no authentication required) meta_ai = Meta() # Simple text prompt response = meta_ai.chat("What is the capital of France?") print(response) # For authenticated usage with web search and image generation meta_ai = Meta(fb_email="your_email@example.com", fb_password="your_password") # Text prompt with web search response = meta_ai.ask("What are the latest developments in quantum computing?") print(response["message"]) print("Sources:", response["sources"]) # Image generation response = meta_ai.ask("Create an image of a futuristic city") for media in response.get("media", []): print(media["url"]) ``` -------------------------------- ### Basic Synchronous Web Search with WEBS Source: https://github.com/oevortex/webscout/blob/main/README.md Demonstrates the fundamental usage of the `WEBS` class as a context manager for simple text searches, printing the title and URL of the top results. ```python with WEBS() as webs: # Simple text search results = webs.text("python programming", max_results=5) for result in results: print(f"Title: {result['title']}\nURL: {result['url']}") ``` -------------------------------- ### Manage LLM Models: List and Summarize by Provider Source: https://github.com/oevortex/webscout/blob/main/README.md Demonstrates how to list and summarize available Large Language Models (LLMs) by provider using the `webscout.model.llm` interface. It shows how to get a total count of models per provider and how to retrieve a list of models for a specific provider. ```python from webscout import model # Get a summary of models by provider summary = model.llm.summary() print("Models by provider:") for provider, count in summary.items(): print(f" {provider}: {count} models") # Get models for a specific provider provider_name = "PerplexityLabs" available_models = model.llm.get(provider_name) print(f"\n{provider_name} models:") if isinstance(available_models, list): for i, model_name in enumerate(available_models, 1): print(f" {i}. {model_name}") else: print(f" {available_models}") ``` -------------------------------- ### Install Webscout AI Search Library Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/AISEARCH/README.md Instructions to install the Webscout Python library using pip, ensuring you get the latest version. ```bash pip install -U webscout ``` -------------------------------- ### Listing Available LLM Models Source: https://github.com/oevortex/webscout/blob/main/README.md Demonstrates how to use `webscout.model.llm.list()` to retrieve a list of all available Large Language Models (LLMs) and print the total count, showcasing the model utility features. ```python from webscout import model from rich import print # List all available LLM models all_models = model.llm.list() print(f"Total available models: {len(all_models)}") ``` -------------------------------- ### Webscout CLI: General Web Search Commands Source: https://github.com/oevortex/webscout/blob/main/README.md A comprehensive list of `webscout` commands for various web search functionalities, including text search, instant answers, image search, video search, news articles, maps, text translation, search suggestions, and weather information. ```Bash webscout text -k "query" webscout answers -k "query" webscout images -k "query" webscout videos -k "query" webscout news -k "query" webscout maps -k "query" webscout translate -k "text" webscout suggestions -k "query" webscout weather -l "location" webscout version ``` -------------------------------- ### Implement GROQ with Custom Tool Calling for Calculations and Web Search Source: https://github.com/oevortex/webscout/blob/main/README.md Shows how to integrate GROQ with custom tool calling capabilities. It defines and registers helper functions for mathematical calculations and web searching, enabling the GROQ client to execute these tools based on user prompts. ```python from webscout import GROQ, WEBS import json # Initialize GROQ client client = GROQ(api_key="your_api_key") # Define helper functions def calculate(expression): """Evaluate a mathematical expression""" try: result = eval(expression) return json.dumps({"result": result}) except Exception as e: return json.dumps({"error": str(e)}) def search(query): """Perform a web search""" try: results = WEBS().text(query, max_results=3) return json.dumps({"results": results}) except Exception as e: return json.dumps({"error": str(e)}) # Register functions with GROQ client.add_function("calculate", calculate) client.add_function("search", search) ``` -------------------------------- ### WEBS Class: Available Search Methods API Reference Source: https://github.com/oevortex/webscout/blob/main/README.md Documents the core search methods provided by the `WEBS` class, including their purpose and example usage for general web search, instant answers, images, videos, news, maps, translation, suggestions, and weather. ```APIDOC WEBS Class Methods: - text(query: str, region: str = 'wt-wt', safesearch: str = 'moderate', timelimit: str = None, max_results: int = None) -> list[dict] Description: General web search. Example: webs.text('python programming') - answers(query: str) -> dict Description: Instant answers. Example: webs.answers('population of france') - images(query: str) -> list[dict] Description: Image search. Example: webs.images('nature photography') - videos(query: str) -> list[dict] Description: Video search. Example: webs.videos('documentary') - news(query: str, region: str = 'wt-wt', safesearch: str = 'moderate', timelimit: str = None, max_results: int = None) -> list[dict] Description: News articles. Example: webs.news('technology') - maps(query: str, place: str = None) -> dict Description: Location search. Example: webs.maps('restaurants', place='new york') - translate(text: str, to: str) -> str Description: Text translation. Example: webs.translate('hello', to='es') - suggestions(query: str) -> list[str] Description: Search suggestions. Example: webs.suggestions('how to') - weather(location: str) -> dict Description: Weather information. Example: webs.weather('london') ``` -------------------------------- ### Webscout AI Chat Providers Overview Source: https://github.com/oevortex/webscout/blob/main/README.md Provides an overview of the various AI chat providers supported by Webscout, detailing their key features and capabilities. This allows users to understand the range of available language models and their specific functionalities through a consistent interface. ```APIDOC AI Chat Providers: - OPENAI: Description: OpenAI's models Key Features: GPT-3.5, GPT-4, tool calling - GEMINI: Description: Google's Gemini models Key Features: Web search capabilities - Meta: Description: Meta's AI assistant Key Features: Image generation, web search - GROQ: Description: Fast inference platform Key Features: High-speed inference, tool calling - LLAMA: Description: Meta's Llama models Key Features: Open weights models - DeepInfra: Description: Various open models Key Features: Multiple model options - Cohere: Description: Cohere's language models Key Features: Command models - PerplexityLabs: Description: Perplexity AI Key Features: Web search integration - YEPCHAT: Description: Yep.com's AI Key Features: Streaming responses - ChatGPTClone: Description: ChatGPT-like interface Key Features: Multiple model options - TypeGPT: Description: TypeChat models Key Features: Multiple model options ``` -------------------------------- ### Initialize StandardInput Client Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/OPENAI/README.md Shows the basic initialization of the StandardInput client from the `webscout.client` library. This snippet does not include a full chat completion example. ```Python from webscout.client import StandardInput # Initialize the client client = StandardInput() ``` -------------------------------- ### Execute a SwiftCLI command from the terminal Source: https://github.com/oevortex/webscout/blob/main/webscout/swiftcli/Readme.md Shows how to run the `list-items` command defined in the quick start example from the command line. It demonstrates passing the `--count` option to limit the number of items displayed. ```bash python app.py list-items --count 3 ``` -------------------------------- ### Convert Hugging Face Models to GGUF Format via Webscout CLI Source: https://github.com/oevortex/webscout/blob/main/README.md This command-line example illustrates how to convert and quantize Hugging Face models to the GGUF format directly from the terminal. It uses the `webscout.Extra.gguf` module as a script, specifying the model ID with `-m` and the desired quantization method with `-q`, providing a convenient way to perform conversions without writing Python code. ```bash python -m webscout.Extra.gguf convert -m "mistralai/Mistral-7B-Instruct-v0.2" -q "q4_k_m" ``` -------------------------------- ### Performing Synchronous DuckDuckGo Search with WEBS Source: https://github.com/oevortex/webscout/blob/main/README.md This snippet introduces the `WEBS` class for synchronous interaction with DuckDuckGo's search capabilities via Webscout. It shows the basic import statement, indicating the starting point for synchronous search operations. ```python from webscout import WEBS ``` -------------------------------- ### Webscout CLI: Yep Search Commands Source: https://github.com/oevortex/webscout/blob/main/README.md Specific `webscout` commands for performing searches using Yep's services, including text search, image search, and search suggestions. ```Bash webscout yep_text -k "query" webscout yep_images -k "query" webscout yep_suggestions -q "query" ``` -------------------------------- ### Integrating GoogleSearch with Webscout Source: https://github.com/oevortex/webscout/blob/main/README.md This snippet illustrates how to use the `GoogleSearch` interface in Webscout for text and news searches. It shows initialization with optional parameters and demonstrates iterating through text search results, as well as retrieving search suggestions and mentioning support for legacy usage. ```python from webscout import GoogleSearch # Initialize GoogleSearch google = GoogleSearch( timeout=10, # Optional: Set custom timeout proxies=None, # Optional: Use proxies verify=True # Optional: SSL verification ) # Text Search text_results = google.text( keywords="artificial intelligence", region="us", # Optional: Region for results safesearch="moderate", # Optional: "on", "moderate", "off" max_results=10 # Optional: Limit number of results ) for result in text_results: print(f"Title: {result.title}") print(f"URL: {result.url}") print(f"Description: {result.description}") # News Search news_results = google.news( keywords="technology trends", region="us", safesearch="moderate", max_results=5 ) # Get search suggestions suggestions = google.suggestions("how to") # Legacy usage is still supported from webscout import search results = search("Python programming", num_results=5) ``` -------------------------------- ### Integrating YepSearch with Webscout Source: https://github.com/oevortex/webscout/blob/main/README.md This snippet demonstrates how to initialize and use the `YepSearch` interface within Webscout to perform various search operations. It covers text search, image search, and retrieving search suggestions, highlighting optional parameters like timeout, proxies, and safe search settings. ```python from webscout import YepSearch # Initialize YepSearch yep = YepSearch( timeout=20, # Optional: Set custom timeout proxies=None, # Optional: Use proxies verify=True # Optional: SSL verification ) # Text Search text_results = yep.text( keywords="artificial intelligence", region="all", # Optional: Region for results safesearch="moderate", # Optional: "on", "moderate", "off" max_results=10 # Optional: Limit number of results ) # Image Search image_results = yep.images( keywords="nature photography", region="all", safesearch="moderate", max_results=10 ) # Get search suggestions suggestions = yep.suggestions("hist") ``` -------------------------------- ### Webscout GGUF Quantization Methods Reference Source: https://github.com/oevortex/webscout/blob/main/README.md This API documentation lists the various quantization methods available for converting Hugging Face models to the GGUF format using Webscout. Each method is described in terms of its characteristics, including accuracy, file size, and performance implications, allowing users to choose the optimal balance for their specific use case. ```APIDOC Method | Description --------|------------- `fp16` | 16-bit floating point - maximum accuracy, largest size `q2_k` | 2-bit quantization (smallest size, lowest accuracy) `q3_k_l` | 3-bit quantization (large) - balanced for size/accuracy `q3_k_m` | 3-bit quantization (medium) - good balance for most use cases `q3_k_s` | 3-bit quantization (small) - optimized for speed `q4_0` | 4-bit quantization (version 0) - standard 4-bit compression `q4_1` | 4-bit quantization (version 1) - improved accuracy over q4_0 `q4_k_m` | 4-bit quantization (medium) - balanced for most models `q4_k_s` | 4-bit quantization (small) - optimized for speed `q5_0` | 5-bit quantization (version 0) - high accuracy, larger size `q5_1` | 5-bit quantization (version 1) - improved accuracy over q5_0 `q5_k_m` | 5-bit quantization (medium) - best balance for quality/size `q5_k_s` | 5-bit quantization (small) - optimized for speed `q6_k` | 6-bit quantization - highest accuracy, largest size `q8_0` | 8-bit quantization - maximum accuracy, largest size ``` -------------------------------- ### Interacting with Webscout Server using OpenAI Python Client Source: https://github.com/oevortex/webscout/blob/main/README.md This snippet shows how to connect to a running Webscout server using the OpenAI Python client library. It demonstrates configuring the client with the server's base URL and performing a chat completion request, similar to interacting with the official OpenAI API. ```python # Using the OpenAI Python client from openai import OpenAI client = OpenAI( api_key="your-secret-key", # Only needed if you set an API key base_url="http://localhost:8000/v1" # Point to your local server ) # Chat completion response = client.chat.completions.create( model="gpt-4", # This can be any model name registered with Webscout messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Hello, how are you?"} ] ) print(response.choices[0].message.content) ``` -------------------------------- ### Install Webscout from GitHub Source: https://github.com/oevortex/webscout/blob/main/webscout/scout/README.md Installs the latest development version of the Webscout library directly from its GitHub repository. ```bash pip install git+https://github.com/OE-LUCIFER/Webscout.git ``` -------------------------------- ### Webscout CLI: Google Search Commands Source: https://github.com/oevortex/webscout/blob/main/README.md Specific `webscout` commands for performing searches using Google's services, including text search, news search, and search suggestions. ```Bash webscout google_text -k "query" webscout google_news -k "query" webscout google_suggestions -q "query" ``` -------------------------------- ### Manage Webscout with Docker Compose Source: https://github.com/oevortex/webscout/blob/main/DOCKER.md Commands for orchestrating Webscout services using Docker Compose, covering basic setup, no-auth mode, custom port, production, development, and MongoDB profiles. ```bash # Basic setup (with authentication) docker-compose up webscout-api # No-auth mode for development/demos docker-compose -f docker-compose.yml -f docker-compose.no-auth.yml up webscout-api # With custom port WEBSCOUT_PORT=7860 docker-compose up webscout-api # Production setup with Gunicorn docker-compose --profile production up webscout-api-production # Development setup with hot reload docker-compose --profile development up webscout-api-dev # MongoDB setup with authentication docker-compose --profile mongodb up ``` -------------------------------- ### Webscout Server API Endpoints Source: https://github.com/oevortex/webscout/blob/main/README.md This section outlines the primary API endpoints exposed by the Webscout server. It lists the HTTP methods and paths for common operations such as listing models, retrieving specific model information, and creating chat completions. ```APIDOC GET /v1/models - List all available models GET /v1/models/{model_name} - Get information about a specific model POST /v1/chat/completions - Create a chat completion ``` -------------------------------- ### Define a basic SwiftCLI application and command Source: https://github.com/oevortex/webscout/blob/main/webscout/swiftcli/Readme.md Demonstrates how to initialize a SwiftCLI application, define a command with an integer option, and use `table_output` to format the command's return value as a table. The command lists system items with their status, showcasing basic CLI setup and output formatting. ```python from webscout.swiftcli import CLI, option, table_output app = CLI("myapp", version="1.0.0") @app.command() @option("--count", "-c", type=int, default=5) @table_output(["ID", "Status"]) def list_items(count: int): """List system items with status""" return [ [i, "Active" if i % 2 == 0 else "Inactive"] for i in range(1, count + 1) ] if __name__ == "__main__": app.run() ``` -------------------------------- ### Advanced Text Search with Optional Parameters Source: https://github.com/oevortex/webscout/blob/main/README.md Demonstrates how to perform a text search using the `WEBS` class, including optional parameters like `region`, `safesearch`, `timelimit`, and `max_results` to refine the search query. ```python from webscout import WEBS with WEBS() as webs: results = webs.text( 'artificial intelligence', region='wt-wt', safesearch='off', timelimit='y', max_results=10 ) for result in results: print(f"Title: {result['title']}") print(f"URL: {result['url']}") print(f"Description: {result['body']}\n") ``` -------------------------------- ### Basic Chat Completion with LLMChatCo Client Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/OPENAI/README.md Shows how to initialize the `LLMChatCo` client from `webscout.client` and perform a non-streaming chat completion. This example also demonstrates setting the `temperature` parameter for response creativity. ```python from webscout.client import LLMChatCo # Initialize the client client = LLMChatCo() # Create a completion (non-streaming) response = client.chat.completions.create( model="gemini-flash-2.0", # Default model messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Tell me about Python programming."} ], temperature=0.7 ) # Print the response print(response.choices[0].message.content) ``` -------------------------------- ### JavaScript WebScoutAPI Chat Completion Example Usage Source: https://github.com/oevortex/webscout/blob/main/webscout/auth/templates/components/examples.html Demonstrates how to initialize the `WebScoutAPI` client and perform chat completions. It includes examples for both non-streaming and streaming responses, showing how to handle the output. ```javascript // Example usage async function main() { const api = new WebScoutAPI(API_KEY, BASE_URL); // Chat completion example const messages = [ { role: 'user', content: 'Hello, how are you today?' } ]; try { // Non-streaming const response = await api.chatCompletion(messages); console.log('Response:', response); // Streaming console.log('Streaming response:'); for await (const chunk of api.chatCompletion(messages, { stream: true })) { process.stdout.write(chunk); } ``` -------------------------------- ### Install SwiftCLI (webscout) via pip Source: https://github.com/oevortex/webscout/blob/main/webscout/swiftcli/Readme.md Provides instructions to install the `webscout` library, which includes SwiftCLI, using pip, the Python package installer. The `-U` flag ensures the package is upgraded if already installed. ```bash pip install -U webscout ``` -------------------------------- ### Concurrent Asynchronous Web Search with AsyncWEBS Source: https://github.com/oevortex/webscout/blob/main/README.md Illustrates how to perform multiple web searches concurrently using `AsyncWEBS` and `asyncio.gather`. It defines functions to search for multiple terms and then processes and prints the results for each term. ```python import asyncio from webscout import AsyncWEBS async def search_multiple_terms(search_terms): async with AsyncWEBS() as webs: # Create tasks for each search term tasks = [webs.text(term, max_results=5) for term in search_terms] # Run all searches concurrently results = await asyncio.gather(*tasks) return results async def main(): terms = ["python", "javascript", "machine learning"] all_results = await search_multiple_terms(terms) # Process results for i, term_results in enumerate(all_results): print(f"Results for '{terms[i]}':\n") for result in term_results: print(f"- {result['title']}") print("\n") # Run the async function asyncio.run(main()) ``` -------------------------------- ### Install WebScout LitAgent Library Source: https://github.com/oevortex/webscout/blob/main/webscout/litagent/Readme.md Provides the command-line instruction for installing the `webscout` library, which includes LitAgent, using pip. ```bash pip install webscout ``` -------------------------------- ### Generate Image, List Models, and Manage API Keys (cURL) Source: https://github.com/oevortex/webscout/blob/main/webscout/auth/templates/components/examples.html Demonstrates cURL commands for generating images, listing available models, and generating a new API key for authentication and access management. ```curl # Image Generation Request curl -X POST "{{ base_url }}/v1/images/generations" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A beautiful sunset over a mountain landscape", "model": "dall-e-2", "size": "512x512", "n": 1 }' ``` ```curl # List Available Models curl -X GET "{{ base_url }}/v1/models" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ```curl # Generate API Key curl -X POST "{{ base_url }}/v1/auth/generate-key" \ -H "Content-Type: application/json" \ -d '{ "username": "your-username", "name": "My API Key", "rate_limit": 60 }' ``` -------------------------------- ### Install Webscout TTS Library Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/TTS/README.md Install the Webscout library using pip, which provides access to all TTS providers and functionalities. ```bash pip install webscout ``` -------------------------------- ### Install Webscout Python Package Source: https://github.com/oevortex/webscout/blob/main/webscout/Extra/YTToolkit/README.md This command installs the `webscout` library from PyPI, allowing access to its YouTube toolkit functionalities. The `-U` flag ensures the package is upgraded if already installed. ```bash pip install -U webscout ``` -------------------------------- ### Manage TTS Voices: List and Summarize by Provider Source: https://github.com/oevortex/webscout/blob/main/README.md Illustrates how to access and manage Text-to-Speech (TTS) voices across multiple providers. It covers listing all available voices, summarizing voices by provider, and retrieving specific voices for a given provider like ElevenlabsTTS. ```python from webscout import model from rich import print # List all available TTS voices all_voices = model.tts.list() print(f"Total available voices: {len(all_voices)}") # Get a summary of voices by provider summary = model.tts.summary() print("\nVoices by provider:") for provider, count in summary.items(): print(f" {provider}: {count} voices") # Get voices for a specific provider provider_name = "ElevenlabsTTS" available_voices = model.tts.get(provider_name) print(f"\n{provider_name} voices:") if isinstance(available_voices, dict): for voice_name, voice_id in list(available_voices.items())[:5]: # Show first 5 voices print(f" - {voice_name}: {voice_id}") if len(available_voices) > 5: print(f" ... and {len(available_voices) - 5} more") ``` -------------------------------- ### Retrieving Weather Information Source: https://github.com/oevortex/webscout/blob/main/README.md Shows how to use the `webs.weather()` method to fetch weather details for a specified location and then access various attributes like location, temperature, and conditions from the returned dictionary. ```python from webscout import WEBS with WEBS() as webs: # Get weather for a location weather = webs.weather("New York") # Access weather data if weather: print(f"Location: {weather.get('location', 'Unknown')}") print(f"Temperature: {weather.get('temperature', 'N/A')}") print(f"Conditions: {weather.get('condition', 'N/A')}") ``` -------------------------------- ### Scira AI Search Provider Example with Model Selection Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/AISEARCH/README.md Demonstrates using the Scira provider, including initializing with a default model and switching to another model (e.g., Claude) for streaming searches. It also lists the available models for Scira. ```python from webscout import Scira # Initialize with default model (Grok3) ai = Scira() # Basic search response = ai.search("What is the impact of climate change?") print(response) # Streaming search with Claude model ai = Scira(model="scira-claude") for chunk in ai.search("Explain quantum computing", stream=True): print(chunk, end="", flush=True) # Available models: # - scira-default (Grok3) # - scira-grok-3-mini (Grok3-mini) # - scira-vision (Grok2-Vision) # - scira-claude (Sonnet-3.7) # - scira-optimus (optimus) ``` -------------------------------- ### DeepFind AI Search Provider Example Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/AISEARCH/README.md Illustrates how to use the DeepFind provider for both basic and streaming AI searches, showing initialization and handling of the search responses. ```python from webscout import DeepFind # Initialize the search provider ai = DeepFind() # Basic search response = ai.search("What is Python?") print(response) # Streaming search for chunk in ai.search("Tell me about AI", stream=True): print(chunk, end="") ``` -------------------------------- ### Build and Run Webscout Docker Container Source: https://github.com/oevortex/webscout/blob/main/DOCKER.md Commands to build the Webscout Docker image and run it with various configurations, including default authentication, no-auth mode, no rate limiting, custom port, and MongoDB support. ```bash # Build the image docker build -t webscout-api . # Run the container (default port 8000, with authentication) docker run -p 8000:8000 webscout-api # Run with no authentication required (great for development/demos) docker run -p 8000:8000 -e WEBSCOUT_NO_AUTH=true webscout-api # Run with no authentication and no rate limiting (maximum openness) docker run -p 8000:8000 -e WEBSCOUT_NO_AUTH=true -e WEBSCOUT_NO_RATE_LIMIT=true webscout-api # Run with custom port (e.g., 7860) docker run -p 7860:7860 -e WEBSCOUT_PORT=7860 webscout-api # Run with MongoDB support docker run -p 8000:8000 -e MONGODB_URL=mongodb://localhost:27017 webscout-api ``` -------------------------------- ### Install Webscout using pip Source: https://github.com/oevortex/webscout/blob/main/webscout/scout/README.md Installs the Webscout library from the Python Package Index (PyPI) using the pip package manager. ```bash pip install webscout ``` -------------------------------- ### Isou AI Search Provider Example with Specific Model Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/AISEARCH/README.md Shows how to initialize the Isou provider with a specific scientific model to retrieve detailed scientific information, such as explaining complex experiments. ```python from webscout import Isou # Initialize with specific model ai = Isou(model="siliconflow:deepseek-ai/DeepSeek-R1-Distill-Qwen-32B") # Get a response with scientific information response = ai.search("Explain the double-slit experiment") print(response) ``` -------------------------------- ### Generate Image and Handle Errors (JavaScript) Source: https://github.com/oevortex/webscout/blob/main/webscout/auth/templates/components/examples.html Demonstrates how to generate an image using an 'api' object and includes basic error handling for the operation. It also shows the main function call to run the example. ```javascript const images = await api.generateImage('A beautiful sunset over mountains'); console.log('Generated images:', images); } catch (error) { console.error('Error:', error); } } // Run the example main(); ``` -------------------------------- ### Install WebScout GGUF Converter Source: https://github.com/oevortex/webscout/blob/main/webscout/Extra/gguf.md Install the GGUF Converter by installing the WebScout package using pip. This provides the necessary tools for model conversion. ```bash pip install -U webscout ``` -------------------------------- ### Python - Generate and Download Images Source: https://github.com/oevortex/webscout/blob/main/webscout/auth/templates/components/examples.html This Python example illustrates how to generate images using the WebScout API and then download the generated images to local files. It covers making the API request with a specified prompt, model, size, and quantity, along with error handling for both API calls and image downloads. ```Python import requests import json from pathlib import Path def generate_image(prompt, model="dall-e-2", size="512x512", n=1): """ Generate images using the WebScout API """ url = f"{BASE_URL}/v1/images/generations" headers = { "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" } payload = { "prompt": prompt, "model": model, "size": size, "n": n } try: response = requests.post(url, headers=headers, json=payload) response.raise_for_status() result = response.json() return result['data'] except requests.exceptions.RequestException as e: print(f"Error generating image: {e}") return None def download_image(image_url, filename): """ Download an image from URL """ try: response = requests.get(image_url) response.raise_for_status() with open(filename, 'wb') as f: f.write(response.content) print(f"Image saved as {filename}") return True except Exception as e: print(f"Error downloading image: {e}") return False # Example usage if __name__ == "__main__": prompt = "A beautiful sunset over a mountain landscape" images = generate_image(prompt) if images: for i, image in enumerate(images): filename = f"generated_image_{i+1}.png" download_image(image['url'], filename) ``` -------------------------------- ### Basic Chat Completion with ChatGPTClone Client Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/OPENAI/README.md This snippet demonstrates initializing the ChatGPTClone client and performing a non-streaming chat completion. It specifies a model and provides system and user messages. The example then prints the generated content from the AI's response. ```python from webscout.client import ChatGPTClone # Initialize the client client = ChatGPTClone() # Create a completion (non-streaming) response = client.chat.completions.create( model="gpt-4", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Tell me about Python programming."} ], temperature=0.7 ) # Print the response print(response.choices[0].message.content) ``` -------------------------------- ### Test WebScout API Endpoints Source: https://github.com/oevortex/webscout/blob/main/DOCKER.md This command executes a suite of tests against the WebScout API endpoints to verify their functionality and responsiveness, ensuring the service is operational. ```bash make test-endpoints ``` -------------------------------- ### Install Webscout TempMail Module Source: https://github.com/oevortex/webscout/blob/main/webscout/Extra/tempmail/README.md Instructions to install or update the Webscout library to access the TempMail module using pip. ```bash pip install -U webscout ``` -------------------------------- ### Streaming Chat Completions with ChatGPTClone Client Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/OPENAI/README.md This example shows how to initialize the ChatGPTClone client for streaming chat completions. It sets up the client and prepares to call the chat completions API with streaming enabled. This is useful for applications requiring real-time text generation. ```python from webscout.client import ChatGPTClone # Initialize the client client = ChatGPTClone() ``` -------------------------------- ### Basic Chat Completion with WiseCat Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/OPENAI/README.md This example demonstrates initializing the `WiseCat` client and performing a non-streaming chat completion. It sends a list of messages to a specified model and prints the full response content once available. ```Python from webscout.client import WiseCat # Initialize the client client = WiseCat() # Create a completion (non-streaming) response = client.chat.completions.create( model="chat-model-small", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Tell me about Python programming."} ] ) # Print the response print(response.choices[0].message.content) ``` -------------------------------- ### Install Webscout Weather Toolkit Source: https://github.com/oevortex/webscout/blob/main/webscout/Extra/weather.md Instructions to install or update the Webscout package, which includes the Weather Toolkit, using pip. This command ensures you have the latest version of the necessary libraries. ```bash pip install -U webscout ``` -------------------------------- ### View WebScout Container Logs Source: https://github.com/oevortex/webscout/blob/main/DOCKER.md This command retrieves and displays the standard output and error logs from the WebScout Docker container, useful for debugging and monitoring its activity. ```bash make logs ``` -------------------------------- ### Define and Use Chat Client Tools with Webscout Source: https://github.com/oevortex/webscout/blob/main/README.md This snippet demonstrates how to define custom tools for the Webscout chat client, such as 'calculate' for mathematical expressions and 'search' for web queries. It shows the JSON schema required for tool definitions, including function names, descriptions, and parameters. Subsequently, it illustrates how to invoke these defined tools through the `client.chat` method by passing the `tools` array, enabling the client to automatically select and use the appropriate tool based on the user's natural language input. ```python tools = [ { "type": "function", "function": { "name": "calculate", "description": "Evaluate a mathematical expression", "parameters": { "type": "object", "properties": { "expression": { "type": "string", "description": "The mathematical expression to evaluate" } }, "required": ["expression"] } } }, { "type": "function", "function": { "name": "search", "description": "Perform a web search", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "The search query" } }, "required": ["query"] } } } ] response = client.chat("What is 25 * 4 + 10?", tools=tools) print(response) response = client.chat("Find information about quantum computing", tools=tools) print(response) ``` -------------------------------- ### Basic Chat Completion with ExaAI Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/OPENAI/README.md This example demonstrates initializing the `ExaAI` client and performing a non-streaming chat completion. It sends messages to a specified model and prints the full response. Note that ExaAI clients typically do not support system messages, which will be ignored. ```Python from webscout.client import ExaAI # Initialize the client client = ExaAI() # Create a completion (non-streaming) response = client.chat.completions.create( model="O3-Mini", messages=[ # Note: ExaAI does not support system messages (they will be removed) {"role": "user", "content": "Hello!"}, {"role": "assistant", "content": "Hi there! How can I help you today?"}, {"role": "user", "content": "Tell me about Python programming."} ] ) # Print the response print(response.choices[0].message.content) ``` -------------------------------- ### Install Webscout Package with GitAPI Source: https://github.com/oevortex/webscout/blob/main/webscout/Extra/GitToolkit/gitapi/README.md Instructions to install the Webscout Python package, which includes the GitAPI module, using pip. ```bash pip install webscout ``` -------------------------------- ### Basic Chat Completion with SciraChat Client Source: https://github.com/oevortex/webscout/blob/main/webscout/Provider/OPENAI/README.md Shows how to initialize the `SciraChat` client from `webscout.client` and perform a non-streaming chat completion. The example requests information about Python programming. ```python from webscout.client import SciraChat # Initialize the client client = SciraChat() # Create a completion (non-streaming) response = client.chat.completions.create( model="scira-default", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Tell me about Python programming."} ] ) # Print the response print(response.choices[0].message.content) ```