Skip to main content

Lightweight internal utilities for LLM provider configuration and credential management

Project description

RealtimeX Internal Utilities

Lightweight internal library providing utilities for LLM provider configuration and credential management across RealtimeX internal services.

Installation

# Using uv (recommended) for local development
uv pip install -e /path/to/realtimex-toolkit

# Using pip from PyPI
pip install realtimex_toolkit

Quick Start

Agent Flow Management

Work with agent flow data. get_flow_variable now supports dotted paths for nested structures, safe defaults, and fetching the full payload.

import json

from realtimex_toolkit import get_flow_variable

# Access nested variables using dotted notation
user_email = get_flow_variable("user.email")
print(user_email)  # "example@example.com"

# Provide defaults for missing keys
theme = get_flow_variable("user.theme", "light")
print(theme)  # "light"

# Get the entire payload when you need to inspect everything
variables = get_flow_variable()
print(json.dumps(variables))  # {"time":"12:40:28 PM", ...}

Credential Management

Retrieve encrypted credentials from the RealtimeX app backend and decrypt them for use across RealtimeX ecosystem services.

from realtimex_toolkit import get_credential

# Simplest usage - just the credential ID
# Connects to local RealtimeX backend (http://localhost:3001) by default
credential = get_credential("credential-id")
print(credential["payload"])  # {"name": "API_KEY", "value": "secret-value"}

# With API key for authenticated requests
credential = get_credential("credential-id", api_key="service-api-key")

# With custom backend URL (for non-default configurations)
credential = get_credential(
    "credential-id",
    api_key="service-api-key",
    base_url="http://custom-host:3001"  # Override default localhost:3001
)

# For long-running services, use CredentialManager directly
from realtimex_toolkit import CredentialManager

# Connects to http://localhost:3001 by default
manager = CredentialManager(api_key="service-api-key")
try:
    bundle = manager.get("credential-id")
    # Credentials are cached automatically
    bundle_again = manager.get("credential-id")  # Returns cached

    # Force refresh from backend
    fresh_bundle = manager.get("credential-id", force_refresh=True)
finally:
    manager.close()

Configuration:

  • base_url: Base URL of the RealtimeX app backend (default: http://localhost:3001)
  • api_key: Authentication token for backend API requests (optional)
  • Credentials are encrypted using AES-256-CBC and decrypted using keys from ~/.realtimex.ai/Resources/server/.env.development

Return shape (get_credential):

{
    "credential_id": str,
    "name": str,
    "credential_type": str,
    "payload": dict[str, str],
    "metadata": dict | None,
    "updated_at": str | None,
}

Supported LLM Providers

  • Major Providers: OpenAI, Anthropic, Azure OpenAI
  • Cloud AI: Google Gemini, AWS Bedrock
  • Alternative APIs: Groq, Cohere, Mistral, Perplexity
  • Open Source Aggregators: Open Router, Together AI, Fireworks AI
  • Emerging: DeepSeek, xAI, Novita
  • Local Deployment: Ollama, LocalAI, LM Studio, KoboldCPP
  • Custom: Generic OpenAI, LiteLLM, Nvidia NIM, Hugging Face

Development

# Install with dev dependencies
uv pip install -e ".[dev]"

# Run tests
pytest

# Run type checking
mypy src/realtimex_toolkit

# Format & lint
ruff check src/realtimex_toolkit tests
ruff format src/realtimex_toolkit tests

Architecture

  • realtimex_toolkit.llm: LLM provider configuration utilities
  • realtimex_toolkit.credentials: Secure credential retrieval and decryption
  • realtimex_toolkit.api: HTTP client with retry logic and error mapping
  • realtimex_toolkit.utils: Internal utilities (path resolution, logging)

License

Proprietary - Internal use only

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

realtimex_toolkit-1.2.0.tar.gz (108.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

realtimex_toolkit-1.2.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file realtimex_toolkit-1.2.0.tar.gz.

File metadata

  • Download URL: realtimex_toolkit-1.2.0.tar.gz
  • Upload date:
  • Size: 108.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.16

File hashes

Hashes for realtimex_toolkit-1.2.0.tar.gz
Algorithm Hash digest
SHA256 1bfc0b7d340ecf19f112b3e172415edca2fa753699f2faafff70863023431d86
MD5 25ce78000c19cbda00e173f910a40704
BLAKE2b-256 78092c8dfe812218f527e07eb54a7db19c0447fb4261c24e5661deedeb8f1f4a

See more details on using hashes here.

File details

Details for the file realtimex_toolkit-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for realtimex_toolkit-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c6e541d8172a80d37ed5d1329ca3e1aaa43a578c2673e80c51ac83d2ce174bc
MD5 2d80f0636bc0cfc28997fda5fd2df69e
BLAKE2b-256 4d33eace6b0c3f3dfba5d359db1aa2cb7ac7ad6855c0d05b4ed5e706049113f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page