sparkles2.1.0

BoxLang AI Module v2.1.0 Release Notes - Multi-Tenant Tracking, OpenSearch Vector Memory, Bedrock Streaming, and Provider Configuration

This release focuses on enterprise features including multi-tenant usage tracking, OpenSearch vector memory support, AWS Bedrock streaming, and enhanced provider configuration capabilities.

🎉 Major Features

Multi-Tenant Usage Tracking

Provider-agnostic request tagging for per-tenant billing and usage tracking.

Track Usage by Tenant:

// Tag requests with tenant information
result = aiChat(
    messages: "Generate report",
    options: {
        tenantId: "customer-123",
        usageMetadata: {
            costCenter: "marketing",
            projectId: "campaign-2024",
            userId: "[email protected]"
        }
    }
)

// Works with all providers: OpenAI, Bedrock, Ollama, DeepSeek, etc.

Intercept Token Usage Events:

Predefined Provider Configuration

Define multiple providers with default parameters in module configuration.

Module Configuration:

Using Predefined Providers:

Provider-Specific Options

Generic providerOptions struct for provider-specific configuration.

AWS Bedrock Inference Profiles:

Access Provider Options in Custom Services:

OpenSearch Vector Memory Provider

Full integration with OpenSearch k-NN for semantic search and RAG applications.

Create OpenSearch Memory:

Multi-Tenant Isolation:

OpenAI-Compatible Embedding Support

Use custom OpenAI-compatible embedding services with vector memory providers.

Custom Embedding Endpoint:

AWS Bedrock Streaming Support

Full streaming support for AWS Bedrock provider with all model families.

Stream Bedrock Responses:

Custom Ollama Base URLs

Configure custom base URLs for Ollama chat and embeddings endpoints.

Custom Ollama Server:

🎁 New Features

  • New Event: onMissingAiProvider - Handle cases where requested provider is not found

  • aiModel() Options: New options struct parameter to seed services with configuration

  • Request Merge Control: AiBaseRequest.mergeServiceParams() and mergeServiceHeaders() now accept override boolean argument

  • Ollama Embeddings: Support for nomic-embed-text model for local embeddings

🔧 Enhancements

  • Provider Defaults: All AI provider services inherit default chat and embedding parameters from IAiService interface

  • Service Configuration: IAiService.configure() now accepts generic options argument instead of just apiKey

  • Request Clarity: AiRequest class renamed to AiChatRequest for clarity and multi-modality support

  • Error Handling: Added more AiError exception handling for service JSON errors

  • Docker Retry Logic: Increased Model Runner retry time to 5 seconds with 10 max retries for large model loading

🐛 Bug Fixes

  • Event Names: Corrected chat request event names to onAIChatRequest, onAIChatRequestCreate, and onAIChatResponse

  • Headers Passthrough: aiChat, aiChatStream now correctly pass headers to AiChatRequest

  • Request Building: BIFs now use aiChatRequest() to build requests instead of manual construction

  • MCP Spec Compliance: Prompts now return arguments key instead of args per MCP specification

  • Model Setting: AiChatRequest now correctly sets model from params

  • API Key Passthrough: API key now properly passed to service in aiChat(), aiChatStream() BIFs

  • Character Function: Fixed typo from chr() to char() in SSE formatting

  • Model Retrieval: AiModel.getModel() now correctly returns model name when using predefined providers

  • OpenSearch URL: Fixed parameter conflict by using requestUrl for HTTP requests instead of url

📚 Documentation Updates

  • OpenSearch vector memory provider documentation

  • Multi-tenant usage tracking examples

  • Provider-specific options documentation

  • Custom embedding endpoint configuration

  • Bedrock streaming examples

🚀 Upgrade Notes

This release is backward compatible. New features are opt-in:

  1. Multi-tenant tracking - Add tenantId and usageMetadata options to requests

  2. Predefined providers - Configure providers in module settings for cleaner code

  3. OpenSearch - Use for scalable vector search in production

  4. Custom embeddings - Point to self-hosted embedding services

  5. Bedrock streaming - Enable real-time streaming for Bedrock models

🙏 Thank You

Thank you to all contributors and users who continue to make BoxLang AI better!

Last updated