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.1.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.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nlweb_cosmos_site_config-0.6.1.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.1.tar.gz
Algorithm Hash digest
SHA256 3c03016317c5fb75369e3a04b31b342475b9e42c2bedc6b5931aad221b6213b3
MD5 75ef9f86378bf3d4eae103336c9d00aa
BLAKE2b-256 f41aadc9d1436a7e061163f5f3d503f6f1c5ed0849d871c2edfd95b905c0f0b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nlweb_cosmos_site_config-0.6.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 483e1ec57307a18daa4221e6f766d9d99e4eb53173fb3f0aa09c3701b11c548f
MD5 9b2ef85a3f5e918c18d99a6520312742
BLAKE2b-256 ac38d0f659af56cabd34f6093315e1d2c024b2fd393214e292a23216b5d4e485

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