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_configscontainer - 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
Metadata
Release files for nlweb-cosmos-site-config 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nlweb_cosmos_site_config-0.7.0.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nlweb_cosmos_site_config-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.6 kB
Release files / nlweb_cosmos_site_config-0.7.0.tar.gz
| Download URL | nlweb_cosmos_site_config-0.7.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de855ed9d9c25855bae2ec30b348b7d7f4a115455e9143ea2d88f308f712ab8a
|
|
BLAKE2b-256 checksum How to use checksums |
a1050246a052b7511ace983a6d96f2e41bdb3f2d5949e99d303736e9c33be12e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / nlweb_cosmos_site_config-0.7.0-py3-none-any.whl
| Download URL | nlweb_cosmos_site_config-0.7.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e2b0075c3208cb770923367d5deff62cb52ee46f3e668e843ff0a970fa34e7d
|
|
BLAKE2b-256 checksum How to use checksums |
922af037e9a2f025e53f51e29009e741095ae67f9a4af26540c04c0d7fc863d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|