Skip to main content

Azure Cosmos DB site configuration provider for NLWeb - stores and retrieves domain-specific elicitation configs

Project description

NLWeb Azure Cosmos DB Site Config Provider

Azure Cosmos DB provider for site-specific configuration storage and lookup.

Overview

This provider implements site configuration lookup using Azure Cosmos DB, enabling domain-specific query elicitation based on intents and required information checks.

Features

  • Cosmos DB Integration: Stores site configs in dedicated site_configs container
  • In-Memory Caching: 5-minute TTL cache for fast lookups
  • Azure AD Support: Managed Identity or API key authentication
  • Domain Normalization: Handles www. prefix automatically

Configuration

Configure in your config.yaml:

site_config:
  default:
    endpoint_env: COSMOS_DB_ENDPOINT
    api_key_env: COSMOS_DB_KEY
    database_name_env: COSMOS_DB_DATABASE_NAME
    container_name: site_configs
    use_managed_identity: false
    cache_ttl: 300

Usage

The provider is automatically initialized when site_config is configured:

from nlweb_cosmos_site_config import CosmosSiteConfigLookup

# Initialized automatically from config via ProviderMap
# Direct instantiation example:
lookup = CosmosSiteConfigLookup(
    endpoint="https://your-cosmos.documents.azure.com",
    database_name="your-db",
    container_name="site_configs",
    cache_ttl=300,
)

# Get full config for a domain (all config types)
config = await lookup.get_config("yelp.com")

# Get a specific config type
elicitation = await lookup.get_config_type("yelp.com", "elicitation")

Installation

pip install -e .

License

MIT License - Copyright (c) 2025 Microsoft Corporation

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

nlweb_cosmos_site_config-0.6.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

nlweb_cosmos_site_config-0.6.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file nlweb_cosmos_site_config-0.6.0.tar.gz.

File metadata

  • Download URL: nlweb_cosmos_site_config-0.6.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nlweb_cosmos_site_config-0.6.0.tar.gz
Algorithm Hash digest
SHA256 5142facbd53a9f14a8cdb8e6309dbd8d187dc5aaba73088886bc4d463176de6c
MD5 53873ac18b1629ec97766ab4361a1c85
BLAKE2b-256 591dd4dd1a5d32b42cafce23f48f84e83bc67bf639ba4ea380d3af7d441a1526

See more details on using hashes here.

File details

Details for the file nlweb_cosmos_site_config-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: nlweb_cosmos_site_config-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for nlweb_cosmos_site_config-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40376d733f8a4cc65306a069c52afb84ebee31019d4bede2088c0a84f75870de
MD5 c013f8457828cc01a14b1ccfa5115a2d
BLAKE2b-256 c910bf6502ed14602246df1b82bd5b0a47ce2dcfb88d76ef16fc4ca6c272e93f

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