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

Uploaded Python 3

File details

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

File metadata

  • Download URL: nlweb_cosmos_site_config-0.6.2.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.2.tar.gz
Algorithm Hash digest
SHA256 6e7ab7c2ee6288f8300d83f6b2cf069716c42ca497aaf803edd19dc03c574aeb
MD5 cfdeaf1340210841ed4264ed2798bd75
BLAKE2b-256 f6eaf786cb9448133aa087ac9632259e252f32250119b2de0aa2c75aa5662b04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nlweb_cosmos_site_config-0.6.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ac2f98662de9e47c8f71409b650cf31a93878ae886de4bbe71ec410128fcc5dd
MD5 05bc68a38bf00f96daca101e406610d6
BLAKE2b-256 d9f9031e43b826308fedd999d3dea46e62334dcc1ac2cbfefe9c8004472de8b4

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