### Run Unstract Platform Setup Script Source: https://docs.unstract.com/unstract/editions/open_source_edition/index Execute the `run-platform.sh` script to download and start all necessary Docker containers for the Unstract platform. This is the initial step to set up the Unstract Open Source Edition locally. ```Shell $ ./run-platform.sh ``` -------------------------------- ### Getting Started with OpenAI Embedding API Key Setup Source: https://docs.unstract.com/unstract/unstract_platform/adapters/embedding/openai_embedding/index This section provides step-by-step instructions on how to sign up for an OpenAI account and generate an API key, which is essential for accessing OpenAI's embedding services. It also includes information about initial free credits. ```APIDOC 1. Signup an OpenAI account: https://platform.openai.com/signup/ 2. From the side navigation menu, choose `API Keys`. 3. Create a new API key. Note: When you sign up for OpenAI, you'll get $5 in free credits. This credit limit is more than sufficient to run a simple example. To increase a usage limit, visit OpenAI Billing section: https://platform.openai.com/account/billing/overview ``` -------------------------------- ### Execute Unstract Platform Setup Script Source: https://docs.unstract.com/unstract/editions/open_source_edition This command runs the `run-platform.sh` script, which is responsible for pulling and starting all necessary Docker containers for the Unstract platform. It's the primary step to initialize your local Unstract environment. ```Shell ./run-platform.sh ``` -------------------------------- ### Install and Run Git Pre-commit Hooks with dev-env-cli.sh Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/index This snippet provides commands to install and run the Git pre-commit hooks using the `dev-env-cli.sh` script. The first command installs the hooks, while the second command executes them, ensuring code quality checks before commits. ```shell # Install Git pre-commit hook. ./dev-env-cli.sh -p # Run Git pre-commit hook. ./dev-env-cli.sh -r ``` -------------------------------- ### Example cURL Request for Highlight API Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_highlighting_api/index Provides a practical cURL command demonstrating how to make a GET request to the Highlight API. It includes the URL with example query parameters ('whisper_hash' and 'lines') and the 'unstract-key' header for authentication. ```Shell curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/highlights?whisper_hash=XXXXXXXXXXXXXXXXXXX&lines=1-2' \ -H 'unstract-key: ' ``` -------------------------------- ### Frontend Local Development Setup Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host/index Commands to install necessary Node.js dependencies and launch the frontend development server. ```Shell npm install ``` ```Shell npm start ``` -------------------------------- ### Example cURL Request for Highlight API Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_highlighting_api An example cURL command demonstrating how to make a GET request to the Highlight API, including the necessary query parameters for 'whisper_hash' and 'lines', and the 'unstract-key' header for authentication. ```Bash curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/highlights?whisper_hash=XXXXXXXXXXXXXXXXXXX&lines=1-2' \ -H 'unstract-key: ' ``` -------------------------------- ### Authenticate and Get Usage Info with Curl Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_apis_intro Example demonstrating how to authenticate with an API key and make a GET request to the '/get-usage-info' endpoint using Curl. ```Curl curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/get-usage-info' \ -H 'unstract-key: ' ``` -------------------------------- ### Download and Run Ollama LLM Model Locally Source: https://docs.unstract.com/unstract/unstract_platform/adapters/llms/ollama_llm/index This command downloads and runs a specified Ollama LLM model on a local system. If the model is not already present, Ollama will automatically download it before execution. ```Bash ollama run llama3 ``` -------------------------------- ### Example cURL Request for Highlight Data API Source: https://docs.unstract.com/unstract/unstract_platform/api_deployment/unstract_api_deployment_highlight_data_api/index A cURL command demonstrating how to make a GET request to the Unstract Highlight Data API, including placeholder values for parameters and authorization. ```bash curl -X GET --location 'https://us-central.unstract.com/deployment/api/org_HJqNgodUQsA99S3A/mar17/highlight/?whisper_hash=REPLACE_WITH_WHISPER_HASH&line_numbers=REPLACE_WITH_LINE_NUMBERS&text_extractor_name=REPLACE_WITH_TEXT_EXTRACTOR_NAME' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Install and Run Git Pre-commit Hooks with dev-env-cli.sh Source: https://docs.unstract.com/unstract/contributing/unstract/local-development Demonstrates how to install and run Git pre-commit hooks using the `dev-env-cli.sh` script. This script simplifies the setup and execution of code quality checks for the Unstract project. ```bash # Install Git pre-commit hook. ./dev-env-cli.sh -p # Run Git pre-commit hook. ./dev-env-cli.sh -r ``` -------------------------------- ### Example Curl Request for Highlight Data API Source: https://docs.unstract.com/unstract/unstract_platform/api_deployment/unstract_api_deployment_highlight_data_api A command-line example demonstrating how to make a GET request to the Highlight Data API using curl, including placeholder values for 'whisper_hash', 'line_numbers', 'text_extractor_name', and the Authorization header. ```bash curl -X GET --location 'https://us-central.unstract.com/deployment/api/org_HJqNgodUQsA99S3A/mar17/highlight/?whisper_hash=REPLACE_WITH_WHISPER_HASH&line_numbers=REPLACE_WITH_LINE_NUMBERS&text_extractor_name=REPLACE_WITH_TEXT_EXTRACTOR_NAME' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Example Line Metadata JSON Structure Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_highlighting_api Demonstrates the JSON structure for line metadata, showing how 'base_y', 'height', 'page', and 'page_height' are stored for individual lines, including a blank line example and a populated line example. ```json line_metadata = { "1": { # Line 1 "base_y": 0, "base_y_percent": 0, "height": 0, # Height "height_percent": 0, "page": 0, "page_height": 0, "raw": [ #(All 0s represent a blank line) 0, # Page number 0, 0, 0 ] }, "2": { # Line 2 "base_y": 155, # Y-coordinate "base_y_percent": 4.8927, "height": 51, # Height "height_percent": 1.6098, "page": 0, # Page number "page_height": 3168, # Page height "raw": [ 0, # Page number 155, # Y-coordinate 51, # Height 3168 # Page height ] } } ``` -------------------------------- ### Example Curl Request for Usage Metrics Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_usage_api/index A command-line example using `curl` to retrieve usage metrics from the LLMWhisperer API. This request uses a GET method and requires an 'unstract-key' header for authentication. ```bash curl -X GET --location 'https://llmwhisperer-api.unstract.com/v1/get-usage-info' \ -H 'unstract-key: ' ``` -------------------------------- ### Example Curl Request for LLMWhisperer Usage Stats API Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_usage_stats/index Provides a command-line example using curl to demonstrate how to make a GET request to the Usage Stats API, including the necessary API key header and tag parameter. ```shell curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/usage?tag=' \ -H 'unstract-key: ' ``` -------------------------------- ### Configure Ollama LLM Profile in Unstract Platform Source: https://docs.unstract.com/unstract/unstract_platform/adapters/llms/ollama_llm/index This API documentation outlines the parameters required to set up a new Ollama LLM profile within the Unstract platform. It details fields such as the profile name, model identifier, Ollama instance URL, and context window size. ```APIDOC Unstract LLM Profile Configuration: Name: string (User-defined name for this connector) Model Name: string (Ollama LLM model name, e.g., llama3) URL: string (URL where Ollama is running, e.g., http://host.docker.internal:11434 or http://localhost:11434) - Default port: 11434 Context Window: integer (Maximum number of context tokens for the model) Timeout: integer (Optional, default value) ``` -------------------------------- ### Curl Example for LLMWhisperer API Authentication and Usage Info Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_apis_intro/index A practical Curl command demonstrating how to make an authenticated GET request to the LLMWhisperer API's '/get-usage-info' endpoint. This example shows how to include the 'unstract-key' header with your API key. ```curl curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/get-usage-info' \ -H 'unstract-key: ' ``` -------------------------------- ### Extract Customer Address from Credit Card Statement Source: https://docs.unstract.com/unstract/unstract_platform/quick_start/completing_quick_start/index This prompt guides an AI to identify and extract the customer's primary address from a credit card statement. It specifies that the output should be a JSON object containing the full address, city, and zip code, ensuring only the relevant customer's address is returned. ```APIDOC Since there might be multiple addresses in the context provided to you, first gather all addresses. Try to understand whom this credit card statement is being addressed to or in other words, the name of the customer. Find the address that matches that person's. Be sure to return the customer's address, for whom this credit card statement is for. Do not respond with any other address. For the customer's address, form a simple JSON object with the following fields: - full_address: should have the customer's full address -city: should hold's the city name from the address - zip: should contain the zip alone ``` -------------------------------- ### Example Curl Request for Highlighting API Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_text_extraction_highlight_api/index An example `curl` command demonstrating how to make a POST request to the LLMWhisperer Highlighting API, including the API key, whisper hash, and search term in the request body. ```curl curl -X POST --location 'https://llmwhisperer-api.unstract.com/v1/highlight-data?whisper-hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' \ -H 'Content-Type: text/plain' \ --data 'search term' ``` -------------------------------- ### Install Linux Prerequisites for Unstract Local Development Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host This command installs necessary build tools and libraries for Unstract Platform development on Debian/Ubuntu Linux distributions, including `build-essential`, `libmagic-dev`, `pandoc`, `pkg-config`, and `tesseract-ocr`. ```bash apt install build-essential libmagic-dev pandoc pkg-config tesseract-ocr ``` -------------------------------- ### Install macOS prerequisites for Unstract local development Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host/index Installs essential libraries required for Unstract Platform development on macOS using Homebrew. ```Shell brew install freetds libmagic pkg-config poppler ``` -------------------------------- ### Install Linux prerequisites for Unstract local development Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host/index Installs essential build tools and libraries required for Unstract Platform development on Debian/Ubuntu Linux distributions. ```Shell apt install build-essential libmagic-dev pandoc pkg-config tesseract-ocr ``` -------------------------------- ### Install LLMWhisperer Python Client Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/python_client/llm_whisperer_python_client_intro/index Installs the LLMWhisperer Python client library using pip, making it available for use in Python projects. This command should be executed in your terminal or command prompt. ```bash pip install llmwhisperer-client ``` -------------------------------- ### Unstract Azure Cloud Storage Connector Configuration Options Source: https://docs.unstract.com/unstract/unstract_platform/connectors/filesystems/azure_cloud_storage This section outlines the configurable parameters for the Azure Cloud Storage connector within Unstract, allowing users to define the scope and limits of file processing. ```APIDOC Unstract Azure Cloud Storage Connector Options: Folder to Process: description: The top-level directory Unstract should have access to. File types to process: description: Limit Unstract to processing certain file types only. Max files to process: description: The number of files Unstract should process in each batch. ``` -------------------------------- ### Install Python service dependencies Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host/index Installs dependencies for a specific Unstract Python service within its virtual environment using the `dev-env-cli.sh` script. ```Shell ./dev-env-cli.sh -i -s ``` -------------------------------- ### Install Node.js Frontend Dependencies Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host Use this command to install all required Node.js packages for the frontend application. This typically reads dependencies from the 'package.json' file and downloads them into the 'node_modules' directory. ```bash npm install ``` -------------------------------- ### Install LLMWhisperer JavaScript Client Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/javascript_client/llm_whisperer_javascript_client_intro Install the LLMWhisperer JavaScript client using npm, the package manager for Node.js. ```JavaScript npm install llmwhisperer-client ``` -------------------------------- ### Example 200 OK Response for Highlight API Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_highlighting_api A JSON example of a successful response (HTTP 200) from the Highlight API, showing the structure of the line metadata returned, including base_y, base_y_percent, height, height_percent, page, page_height, and raw coordinates for specific lines. ```JSON { "1": { "base_y": 0, "base_y_percent": 0, "height": 0, "height_percent": 0, "page": 0, "page_height": 0, "raw": [ 0, 0, 0, 0 ] }, "2": { "base_y": 155, "base_y_percent": 4.8927, "height": 51, "height_percent": 1.6098, "page": 0, "page_height": 3168, "raw": [ 0, 155, 51, 3168 ] } } ``` -------------------------------- ### Manage Unstract Open Source Edition with run-platform.sh Source: https://docs.unstract.com/unstract/unstract_platform/user_guides/run_platform/index This script provides a comprehensive set of commands to interact with the Unstract Open Source Edition Docker setup. It allows users to pull and run the entire platform, upgrade existing installations, build Docker images locally, and perform specific operations like setting up environment files or pulling images with version tags. The script supports both default configurations and specific version management. ```bash # Pull and run entire Unstract platform with default env config. ./run-platform.sh # Pull and run docker containers with a specific version tag. ./run-platform.sh -v v0.1.0 # Upgrade existing Unstract platform setup by pulling the latest available version. ./run-platform.sh -u # Upgrade existing Unstract platform setup by pulling a specific version. ./run-platform.sh -u -v v0.2.0 # Build docker images locally as a specific version tag. ./run-platform.sh -b -v v0.1.0 # Build docker images locally from working branch as `current` version tag. ./run-platform.sh -b -v current # Display the help information. ./run-platform.sh -h # Only do setup of environment files. ./run-platform.sh -e # Only do docker images pull with a specific version tag. ./run-platform.sh -p -v v0.1.0 # Only do docker images pull by building locally with a specific version tag. ./run-platform.sh -p -b -v v0.1.0 # Upgrade existing Unstract platform setup with docker images built locally from working branch as `current` version tag. ./run-platform.sh -u -b -v current # Pull and run docker containers in detached mode. ./run-platform.sh -d -v v0.1.0 ``` -------------------------------- ### Install Python Service Dependencies Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host This command installs all required dependencies for a specific Unstract Python service within its virtual environment, ensuring all necessary packages are available for development. ```bash ./dev-env-cli.sh -i -s ``` -------------------------------- ### Run Ollama LLM Model with GPU Acceleration Source: https://docs.unstract.com/unstract/unstract_platform/adapters/llms/ollama_llm/index Execute this command to run an Ollama LLM model, leveraging available GPU resources for accelerated processing. Ollama is designed to automatically detect and utilize compatible GPUs. ```Bash ollama run llama3 ``` -------------------------------- ### Install LLMWhisperer JavaScript Client Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/javascript_client/llm_whisperer_javascript_client_intro This command installs the LLMWhisperer JavaScript client library using npm, making it available for use in Node.js projects. It's the first step to integrate the client into your application. ```bash npm install llmwhisperer-client ``` -------------------------------- ### Install LLMWhisperer Python Client Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/python_client/llm_whisperer_python_client_intro Install the LLMWhisperer Python Client using pip. This command adds the necessary package to your Python environment, enabling interaction with the LLMWhisperer API. ```bash pip install llmwhisperer-client ``` -------------------------------- ### Install LLMWhisperer JavaScript Client via npm Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/javascript_client/llm_whisperer_javascript_client_intro/index This snippet provides the command to install the LLMWhisperer JavaScript client library using the Node Package Manager (npm). This is the first step to integrate the client into your JavaScript project. ```JavaScript npm install llmwhisperer-client ``` -------------------------------- ### Install specific Python development dependency group Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host/index Installs a particular development dependency group, such as 'lint', for a Python service using `uv sync`. ```Shell uv sync --group lint ``` -------------------------------- ### Install macOS Prerequisites for Unstract Local Development Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host This command installs necessary libraries for Unstract Platform development on macOS using Homebrew, including `freetds`, `libmagic`, `pkg-config`, and `poppler`. ```bash brew install freetds libmagic pkg-config poppler ``` -------------------------------- ### Example Line Metadata JSON Structure Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_highlighting_api/index This JSON object provides an example of the 'line_metadata' structure, detailing the bounding box information for two lines. It includes 'base_y', 'height', 'page', 'page_height', and their percentage equivalents, along with a raw array of coordinates. ```JSON line_metadata = { "1": { # Line 1 "base_y": 0, "base_y_percent": 0, "height": 0, # Height "height_percent": 0, "page": 0, "page_height": 0, "raw": [ #(All 0s represent a blank line) 0, # Page number 0, 0, 0 ] }, "2": { # Line 2 "base_y": 155, # Y-coordinate "base_y_percent": 4.8927, "height": 51, # Height "height_percent": 1.6098, "page": 0, # Page number "page_height": 3168, # Page height "raw": [ 0, # Page number 155, # Y-coordinate 51, # Height 3168 # Page height ] } } ``` -------------------------------- ### Install LLMWhisperer Python Client Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/python_client/llm_whisperer_python_client_intro/index Install the LLMWhisperer Python Client using pip. This command adds the necessary package to your Python environment, enabling interaction with the LLMWhisperer API. ```bash pip install llmwhisperer-client ``` -------------------------------- ### Example Curl Request for LLMWhisperer Highlighting API Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_text_extraction_highlight_api A `curl` command example demonstrating how to make a POST request to the LLMWhisperer Highlighting API, including the `whisper-hash` query parameter, `unstract-key` header, `Content-Type`, and the search term in the request body. ```Shell curl -X POST --location 'https://llmwhisperer-api.unstract.com/v1/highlight-data?whisper-hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' \ -H 'Content-Type: text/plain' \ --data 'search term' ``` -------------------------------- ### Define Prompt for Customer Name Extraction Source: https://docs.unstract.com/unstract/unstract_platform/quick_start/completing_quick_start This snippet defines the configuration for a prompt designed to extract the customer's name from a document. It specifies the field's identifier, its data type, and the natural language prompt instruction for the underlying LLM to format the extracted name correctly. ```YAML field_name: customer_name field_type: Text field_prompt: What is the name of the customer to whom this credit card statement belongs to? Format the name of the customer well with the fist letter of each name capitalized. ``` -------------------------------- ### Example Curl Request for LLMWhisperer Retrieve API Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_text_extraction_retrieve_api A command-line example demonstrating how to make a GET request to the LLMWhisperer Retrieve API using curl, including the whisper_hash and API key in the headers. ```shell curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/whisper-retrieve?whisper_hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### Retrieve Extracted Text with Curl Example Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_text_extraction_retrieve_api/index An example `curl` command demonstrating how to make a GET request to the LLMWhisperer Retrieve API, including the necessary `whisper_hash` query parameter and `unstract-key` header. ```bash curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/whisper-retrieve?whisper_hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### Initialize LLMWhisperer JavaScript Client Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/javascript_client/llm_whisperer_javascript_client_documentation/index This snippet demonstrates how to import the necessary classes and initialize the LLMWhispererClient with an API key. It shows the basic setup required before making any API calls. ```javascript const { LLMWhispererClient, LLMWhispererClientException } = require('llmwhisperer'); const client = new LLMWhispererClient({ apiKey: 'your-api-key' }); ``` -------------------------------- ### Qdrant Cloud Credentials Output Source: https://docs.unstract.com/unstract/unstract_platform/adapters/vector_dbs/qdrant_vectordb This section outlines the key credentials obtained after successfully setting up a Qdrant Cloud cluster. These outputs are essential for connecting external applications, such as the Unstract Platform, to your Qdrant instance. ```APIDOC Qdrant Cloud Credentials: API Key: string (secret, copy safely) Cluster URL: string (Qdrant service endpoint) ``` -------------------------------- ### Curl - Get Webhook Details Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_webhooks_manage/index Example Curl command to retrieve the details of an existing webhook using its name. This GET request requires the `webhook_name` as a query parameter and the `unstract-key` header for authentication. ```Curl curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/whisper-manage-callback?webhook_name=' \ -H 'unstract-key: ' ``` -------------------------------- ### List all Python service dependencies Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host/index Displays a tree of all dependencies for the current Python service, including sub-dependencies, using `uv`. ```Shell uv tree ``` -------------------------------- ### APIDOC: Payment Information Extraction Schema Source: https://docs.unstract.com/unstract/unstract_platform/quick_start/completing_quick_start Defines the JSON structure for extracting key payment details from a credit card statement. This includes the new balance, minimum payment due, and payment due date, formatted as a JSON object. ```APIDOC Payment information is important part of any credit card statement and it consists of the new balance or the full amount due for the current statement, the minimum payment due and the payment due date. Respond with a JSON object with the following fields: new_balance: the total new balance amount that can be paid minimum_payment: the minimum amount that is due due_date: the payment due date in yyyy-mm-dd format ``` -------------------------------- ### Install LLMWhisperer Python Client Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/python_client/llm_whisperer_python_client_intro This command installs the LLMWhisperer Python client library using pip, making it available for use in Python projects. It's the first step to integrate LLMWhisperer functionality into your applications. ```bash pip install llmwhisperer-client ``` -------------------------------- ### Example Curl Request for Retrieve API Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_text_extraction_retrieve_api/index A command-line example demonstrating how to make a GET request to the LLMWhisperer Retrieve API using curl, including the whisper-hash query parameter and the unstract-key header for authentication. ```bash curl -X GET --location 'https://llmwhisperer-api.unstract.com/v1/whisper-retrieve?whisper-hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### Install LLMWhisperer JavaScript Client via npm Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/javascript_client/llm_whisperer_javascript_client_intro/index This command installs the LLMWhisperer JavaScript client library using npm. The client enables interaction with the LLMWhisperer API for processing documents. ```JavaScript npm install llmwhisperer-client ``` -------------------------------- ### Install Production Python Dependencies using uv Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host This command installs only the production dependencies for a Python service, ignoring development dependencies, by using `uv run --frozen`. This is ideal for deploying or running the application in a production-like environment. ```bash uv run --frozen ``` -------------------------------- ### Example Curl Request for Unstract Status API Source: https://docs.unstract.com/unstract/unstract_platform/api_deployment/unstract_api_deployment_status_api A command-line example demonstrating how to make a GET request to the Unstract Status API using curl, including the necessary authorization header and execution ID parameter. ```curl curl -X GET --location 'https://us-central.unstract.com/deployment/api/org_HJqNgodUQsA99S3A/dasda/?execution_id=e748d90f-af7d-4a98-813d-4c47344ff595' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### APIDOC: Spend Line Items Extraction Schema Source: https://docs.unstract.com/unstract/unstract_platform/quick_start/completing_quick_start Defines the JSON array structure for extracting individual spending details from a credit card statement. Each item in the array includes the spend date, description, and amount. ```APIDOC This credit card statement contains spending details line items. Spend details can be split across the provided context. Respond with details of all the spend items by looking at the whole context always. For each of these spend details line items, form a simple JSON object with the following fields: - spend_date: date of the spend in yyyy-mm-dd format. If the year part isn't mentioned in the line item explicitly, pick up the year from the statement date and use it instead. - spend_description: description of the spend - amount: amount of the spend without the dollar sign formatted to 2 decimal points Put all of these items into a JSON array and return that. ``` -------------------------------- ### Authenticate and Get Usage Info with Curl Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_apis_intro/index Demonstrates how to make an authenticated GET request to the `/get-usage-info` endpoint using Curl. This example includes the `unstract-key` header for API key authentication, which is required for all API calls. ```curl curl -X GET --location 'https://llmwhisperer-api.unstract.com/v1/get-usage-info' \ -H 'unstract-key: ' ``` -------------------------------- ### Configure Unstract S3 Connector Setup Source: https://docs.unstract.com/unstract/unstract_platform/connectors/filesystems/s3_filesystem This section details the step-by-step process to set up an S3 connector within the Unstract console, including navigation, entering credentials, and testing the connection. ```APIDOC Unstract S3 Connector Setup: Navigation: Workflows -> + New Workflow -> Create Workflow -> Select Connector Type -> File System -> Settings icon Configuration Fields: Name of the connector: string (User-defined name for the connector) Key: string (S3 access key ID) Secret: string (S3 Secret access key) Endpoint URL: string (S3 connection URL, e.g., https://s3..amazonaws.com) Region Name: string (Mandatory, AWS S3 account region name) Actions: Test Connection: Initiates a connection test to S3. Submit: Saves the connector configuration upon successful test. ``` -------------------------------- ### Install Specific Python Dependency Group using uv Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host This command installs a specific development dependency group, such as 'lint', for a Python service using `uv sync`. This is useful for managing different sets of dependencies for various development tasks. ```bash uv sync --group lint ``` -------------------------------- ### Extract Payment Information from Credit Card Statement Source: https://docs.unstract.com/unstract/unstract_platform/quick_start/completing_quick_start/index This prompt instructs an AI to extract key payment details from a credit card statement. The expected output is a JSON object including the new balance, minimum payment due, and the payment due date in YYYY-MM-DD format. ```APIDOC Payment information is important part of any credit card statement and it consists of the new balance or the full amount due for the current statement, the minimum payment due and the payment due date. Respond with a JSON object with the following fields: new_balance: the total new balance amount that can be paid minimum_payment: the minimum amount that is due due_date: the payment due date in yyyy-mm-dd format ``` -------------------------------- ### Example Curl Request for LLMWhisperer Status API Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_text_extraction_status_api/index Illustrates how to perform a GET request to the LLMWhisperer Status API using the curl command-line tool. This example includes the 'whisper-hash' query parameter and the 'unstract-key' header for authentication. ```bash curl -X GET --location 'https://llmwhisperer-api.unstract.com/v1/whisper-status?whisper-hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### Example Curl Request for Retrieve API Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_text_extraction_retrieve_api Demonstrates how to make a GET request to the LLMWhisperer Retrieve API using the curl command-line tool. This example includes the necessary 'whisper-hash' query parameter and the 'unstract-key' header for authentication. ```bash curl -X GET --location 'https://llmwhisperer-api.unstract.com/v1/whisper-retrieve?whisper-hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### APIDOC: Customer Address Extraction Schema Source: https://docs.unstract.com/unstract/unstract_platform/quick_start/completing_quick_start Defines the JSON structure for extracting the customer's address from a credit card statement. The AI is instructed to identify the correct customer and format their full address, city, and zip code into a simple JSON object. ```APIDOC Since there might be multiple addresses in the context provided to you, first gather all addresses. Try to understand whom this credit card statement is being addressed to or in other words, the name of the customer. Find the address that matches that person's. Be sure to return the customer's address, for whom this credit card statement is for. Do not respond with any other address. For the customer's address, form a simple JSON object with the following fields: - full_address: should have the customer's full address -city: should hold's the city name from the address - zip: should contain the zip alone ``` -------------------------------- ### Run Ollama LLM Model Source: https://docs.unstract.com/unstract/unstract_platform/adapters/llms/ollama_llm Use the `ollama run` command to download and execute an Ollama LLM model. This command works for local systems, Docker containers, and cloud GPU instances, with Ollama automatically handling model downloads and GPU detection. ```Shell ollama run llama3 ``` -------------------------------- ### Example cURL Request for Detail API Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_text_extraction_detail_api/index Demonstrates how to make a GET request to the LLMWhisperer Detail API using cURL, including the whisper_hash parameter and the unstract-key header. This example shows a basic request to retrieve extraction details. ```Shell curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/whisper-detail?whisper_hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### Example Curl Request for Usage Metrics API Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_usage_api Demonstrates how to make a GET request to the LLMWhisperer Usage Metrics API using curl. This example includes the necessary 'unstract-key' header for authentication, which should be replaced with your actual API key. ```bash curl -X GET --location 'https://llmwhisperer-api.unstract.com/v1/get-usage-info' \ -H 'unstract-key: ' ``` -------------------------------- ### Example 200 Success Response for GET Webhook Details Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_webhooks_manage/index This JSON object represents a successful 200 OK response for a GET request, providing the details of a requested webhook. It includes the webhook's URL, authentication token, and name. ```json { "url": "", "auth_token": "", "webhook_name": "" } ``` -------------------------------- ### LLMWhispererClient Constructor API Reference Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/python_client/llm_whisperer_python_client_documentation/index Detailed documentation for the `LLMWhispererClient` constructor, explaining its parameters for initializing the client with API URL, key, timeout, and logging level. It supports optional parameters for flexible configuration. ```APIDOC LLMWhispererClient.Constructor: Description: Initializes the `LLMWhispererClient` with the given parameters. Args: - base_url (str, optional): The base URL for the LLMWhisperer API. Defaults to "". - api_key (str, optional): The API key for the LLMWhisperer API. Defaults to "". - api_timeout (int, optional): The timeout for API requests. Defaults to 120 seconds. - logging_level (str, optional): The logging level for the client. Can be "DEBUG", "INFO", "WARNING" or "ERROR". Defaults to the value of the `LLMWHISPERER_LOGGING_LEVEL` environment variable, or "DEBUG" if the environment variable is not set. ``` -------------------------------- ### Example cURL Request for Unstract Status API Source: https://docs.unstract.com/unstract/unstract_platform/api_deployment/unstract_api_deployment_status_api/index Provides a practical cURL command demonstrating how to query the Unstract Status API. This example shows a GET request to a specific deployment with an 'execution_id' and includes the necessary 'Authorization' header with a bearer token. ```bash curl -X GET --location 'https://us-central.unstract.com/deployment/api/org_HJqNgodUQsA99S3A/dasda/?execution_id=e748d90f-af7d-4a98-813d-4c47344ff595' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Initialize LLMWhispererClient with Base URL and API Key Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/python_client/llm_whisperer_python_client_intro/index Creates an instance of the `LLMWhispererClient`, configuring it with the LLMWhisperer API's base URL and a user-specific API key for authentication. Replace the placeholder values with your actual API endpoint and key. ```python client = LLMWhispererClient(base_url="https://llmwhisperer-api.unstract.com/v1", api_key="your_api_key") ``` -------------------------------- ### Example Curl Request for LLMWhisperer Usage Stats API Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_usage_stats A command-line example demonstrating how to make a GET request to the Usage Stats API using curl, including API key authentication and tag filtering. It shows how to retrieve usage data for a specific tag. ```bash curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/usage?tag=' \ -H 'unstract-key: ' ``` -------------------------------- ### Retrieve Text Extraction Details using Curl Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_text_extraction_detail_api An example `curl` command demonstrating how to make a GET request to the LLMWhisperer Detail API, including the `whisper_hash` parameter and the `unstract-key` header. ```bash curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/whisper-detail?whisper_hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### Run Pre-commit Hooks and Linters using uv Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/index This snippet shows how to leverage `uv` to execute pre-commit hooks and linters. It provides commands to run all pre-commit hooks through `uv` and to specifically run the `ruff` linter for Python files within a specified service folder. ```shell # Run all pre-commit hooks uv run pre-commit run # Run ruff for selected folder uv run ruff prompt-service/**/*.py ``` -------------------------------- ### Initialize LLMWhispererClient with Base URL and API Key Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/python_client/llm_whisperer_python_client_intro This code creates an instance of the `LLMWhispererClient`, configuring it with the LLMWhisperer API's base URL and your authentication API key. Replace `"https://llmwhisperer-api.unstract.com/v1"` with the actual API endpoint and `"your_api_key"` with your personal API key. ```python client = LLMWhispererClient(base_url="https://llmwhisperer-api.unstract.com/v1", api_key="your_api_key") ``` -------------------------------- ### Example Curl Request for Status API Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_text_extraction_status_api Demonstrates how to make a GET request to the LLMWhisperer Status API using curl. It includes placeholders for the whisper hash and API key, showing a typical usage pattern. ```bash curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/whisper-status?whisper_hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### Example 200 Success Response for Get Webhook Details Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_webhooks_manage This JSON object represents a successful response (HTTP 200) when retrieving webhook details. It provides the configured URL, authentication token, and the name of the webhook. ```json { "url": "", "auth_token": "", "webhook_name": "" } ``` -------------------------------- ### Retrieve Webhook Details with cURL Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_webhooks_manage Example cURL command to retrieve details of an existing webhook. It uses the GET method and requires the webhook name as a query parameter along with the API key in the headers for authentication. ```bash curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/whisper-manage-callback?webhook_name=' \ -H 'unstract-key: ' ``` -------------------------------- ### Retrieve LLMWhisperer Usage Metrics with Curl Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_usage_api/index An example `curl` command demonstrating how to make a GET request to the LLMWhisperer Usage Metrics API. It shows the correct URL and how to include the necessary `unstract-key` header for authentication. ```Bash curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/get-usage-info' \ -H 'unstract-key: ' ``` -------------------------------- ### Add Python Dependencies using uv Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host These commands demonstrate how to add new dependencies to a Python service's `pyproject.toml` using `uv`. It supports adding packages from PyPI and local editable installs for development. ```bash uv add uv add --editable ``` -------------------------------- ### Example Curl Request for LLMWhisperer Status API Source: https://docs.unstract.com/llmwhisperer/1.0.0/llm_whisperer/apis/llm_whisperer_text_extraction_status_api Demonstrates how to make a GET request to the LLMWhisperer Status API using the curl command-line tool, including the necessary 'whisper-hash' query parameter and 'unstract-key' header for authentication. ```bash curl -X GET --location 'https://llmwhisperer-api.unstract.com/v1/whisper-status?whisper-hash=XXXXXXXXXXXXXXXXXXX' \ -H 'unstract-key: ' ``` -------------------------------- ### Unstract API Deployment Overview Source: https://docs.unstract.com/unstract/unstract_platform/api_deployment/unstract_api_deployment_intro This section provides an overview of Unstract's API deployment capabilities, detailing key functionalities, available endpoints, the base URL for all API calls, and the required authentication method using an API key as a Bearer token. ```APIDOC API Endpoints: - Execution API: Execute a deployed API with the desired inputs. - Status API: Retrieve the status of an execution. Useful for checking execution status in async mode. ``` ```APIDOC Base URL: https://us-central.unstract.com/ ``` ```APIDOC Authentication: All APIs require an API key for authentication. Method: Bearer Token in Authorization header. Key Source: Postman collection or 'Manage Keys' section on API Deployments page. ``` -------------------------------- ### Retrieve LLMWhisperer Usage Metrics with Curl Source: https://docs.unstract.com/llmwhisperer/llm_whisperer/apis/llm_whisperer_usage_api An example `curl` command demonstrating how to make a GET request to the LLMWhisperer Usage Metrics API. It includes the necessary `unstract-key` header for authentication and shows how to retrieve usage information. ```curl curl -X GET --location 'https://llmwhisperer-api.us-central.unstract.com/api/v2/get-usage-info' \ -H 'unstract-key: ' ``` -------------------------------- ### Manage Python virtual environments for Unstract services Source: https://docs.unstract.com/unstract/contributing/unstract/local-development/run-on-host/index Provides commands to set up, activate, and destroy virtual environments for individual Unstract Python services using the `dev-env-cli.sh` script. ```Shell # Setup venv for a service. ./dev-env-cli.sh -e -s # Show commands to activate venv for a service. ./dev-env-cli.sh -a -s # Destroy venv for a service. ./dev-env-cli.sh -d -s ``` -------------------------------- ### Unstract Platform Qdrant Vector DB Configuration Fields Source: https://docs.unstract.com/unstract/unstract_platform/adapters/vector_dbs/qdrant_vectordb This snippet details the input fields required to configure a new Qdrant Vector DB profile within the Unstract Platform. It specifies the type and purpose of each field, enabling proper integration with your Qdrant Cloud instance. ```APIDOC Unstract Qdrant Vector DB Profile: Name: string (User-defined name for the profile) URL: string (Qdrant Cluster URL obtained from Qdrant Cloud) API Key: string (Qdrant API Key obtained from Qdrant Cloud) ``` -------------------------------- ### AWS IAM Policy for Bedrock InvokeFoundationModel Source: https://docs.unstract.com/unstract/unstract_platform/adapters/llms/amazon_bedrock This JSON policy grants an IAM user the necessary permissions to invoke a specific Amazon Bedrock foundation model. It specifies the bedrock:InvokeFoundationModel action and targets a particular Bedrock model ARN, providing a basic example for programmatic access. ```JSON { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "bedrock:InvokeFoundationModel" ], "Resource": [ "arn:aws:bedrock:us-east-1:123456789012:model/bedrock-model-id" ] } ] } ``` -------------------------------- ### Configure S3/Minio Connector Parameters in Unstract Source: https://docs.unstract.com/unstract/unstract_platform/connectors/filesystems/s3_minio_filesystem/index Details the required parameters for setting up an S3/Minio filesystem connector in Unstract, including access keys, bucket name, path, endpoint URL, and region name. These parameters are entered via the Unstract console's UI. ```APIDOC Configuration Fields for S3/Minio Connector: - Name of the connector: Enter a name for this connector - Key: Enter the Minio access key ID - Secret: Enter the Minio Secret access key - Bucket Name: Enter the Minio bucket name - Path: Enter the path of the files - Endpoint URL: Enter the minio connection URL. - Region Name: Enter region name of the AWS S3 account ``` -------------------------------- ### Execute Pre-commit Hooks and Tools Using uv Source: https://docs.unstract.com/unstract/contributing/unstract/local-development Illustrates how to run pre-commit hooks and other development tools such as `ruff` using the `uv` command-line tool. This method leverages `uv` for efficient script execution within the development environment. ```bash # Run all pre-commit hooks uv run pre-commit run # Run ruff for selected folder uv run ruff prompt-service/**/*.py ```