> For the complete documentation index, see [llms.txt](https://ai.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai.ortusbooks.com/introduction/release-history/2.2.0.md).

# 2.2.0

BoxLang AI Module v2.2.0 Release Notes - Enhanced Performance Monitoring, Configuration Consolidation, and Bug Fixes

This release focuses on improving performance monitoring, consolidating configuration management, and addressing various bug fixes for better stability and reliability.

## 🎁 New Features

* **Consolidated AI request/response logging** - Execution time metrics for better performance insights
* **Enhanced AI request/response metrics** - Additional metrics to provide better insights into performance and potential bottlenecks

## 🔧 Enhancements

* **Configuration Consolidation** - Single source of truth for configuration options and settings, allowing for better overrides and defaults
* **Stream Request Logging** - Execution time metrics included for better performance monitoring and debugging insights
* **Empty Chunk Handling** - Skip empty chunks (keep-alive or heartbeat) when doing chat streams to prevent unnecessary processing and potential parsing errors

## 🐛 Bug Fixes

* **aiChatStream() BIF** - Fixed invalid use of `request` parameter, which should have been `chatRequest`
* **AiTransformRunnable** - Corrected extends declaration
* **AiModel extractMessages()** - Now correctly flattens messages when response has multiple choices with multiple messages into a single array
* **Options Merging Order** - Fixed incorrect order in `aiChat()` and `aiChatStream()` BIFs; now merges correctly: user options → module settings → default options
* **Schema Builder Population** - Fixed error invoking population; third argument now properly accepts array or struct, not a single value
* **Provider Options Merging** - Fixed bug where provider options in configuration file were not being merged into request options when creating a service instance
* **aiService() API Key Detection** - Fixed convention-based API key detection when `options.apiKey` was empty; now properly checks before applying convention key for fallback to environment variables or module settings

## 🚀 Upgrade Notes

This release is backward compatible. All improvements are automatic, with bug fixes addressing edge cases and configuration issues discovered in production environments.

## 🙏 Thank You

Thank you to all contributors and users who continue to help improve BoxLang AI!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ai.ortusbooks.com/introduction/release-history/2.2.0.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
