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

Uploaded Python 3

File details

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

File metadata

  • Download URL: nlweb_cosmos_site_config-0.7.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.7.0.tar.gz
Algorithm Hash digest
SHA256 de855ed9d9c25855bae2ec30b348b7d7f4a115455e9143ea2d88f308f712ab8a
MD5 7bde7602e5d444945ce780560c474bd9
BLAKE2b-256 a1050246a052b7511ace983a6d96f2e41bdb3f2d5949e99d303736e9c33be12e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nlweb_cosmos_site_config-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e2b0075c3208cb770923367d5deff62cb52ee46f3e668e843ff0a970fa34e7d
MD5 db0705ee848a655bdd23c51d1561da1c
BLAKE2b-256 922af037e9a2f025e53f51e29009e741095ae67f9a4af26540c04c0d7fc863d4

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