Skip to content

Commit cc329ea

Browse files
authored
Merge pull request #179 from Azure/release/2.2.3
Release v2.2.3
2 parents 0f3ef19 + e6b0a9a commit cc329ea

File tree

9 files changed

+444
-13
lines changed

9 files changed

+444
-13
lines changed

.github/copilot-instructions.md

Lines changed: 415 additions & 0 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
All notable changes to this project will be documented in this file.
44
This format follows [Keep a Changelog](https://keepachangelog.com/) and adheres to [Semantic Versioning](https://semver.org/).
55

6-
## [v2.2.3] – 2026-03-06
6+
## [v2.2.3] – 2026-03-24
7+
78
### Changed
8-
- Added cron fallback defaults for blob ingestion jobs when `CRON_RUN_BLOB_INDEX` and `CRON_RUN_BLOB_PURGE` are not configured: blob indexing now runs hourly (`0 * * * *`) and blob purge runs at 10 minutes past each hour (`10 * * * *`).
9+
- **Default chunk overlap increased to 200 tokens**: Changed the default value of `TOKEN_OVERLAP` from `100` to `200` across all chunkers (doc_analysis, json, langchain, nl2sql, transcription), improving context continuity between chunks during document ingestion.
10+
- **Cron fallback defaults for blob ingestion jobs**: Added cron fallback defaults when `CRON_RUN_BLOB_INDEX` and `CRON_RUN_BLOB_PURGE` are not configured: blob indexing now runs hourly (`0 * * * *`) and blob purge runs at 10 minutes past each hour (`10 * * * *`).
11+
12+
### Fixed
13+
- **Multimodal image captions not generated**: The `get_completion()` method in `AzureOpenAIClient` did not accept the `image_base64` parameter passed by the multimodal chunker, causing a `TypeError` on every caption generation call. The exception was caught silently and all image captions defaulted to "No caption available." Added vision support to `get_completion()` by accepting an optional `image_base64` parameter and constructing multimodal messages (text + image) using the OpenAI vision API format when an image is provided.
14+
- **Azure OpenAI API compatibility with newer models**: Replaced `max_tokens` with `max_completion_tokens` in the chat completions API call, fixing a 400 error (`unsupported_parameter`) when using newer models (e.g., GPT-4o) that reject the deprecated parameter.
915

1016
## [v2.2.2] – 2026-02-04
1117
### Fixed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.2
1+
2.2.3

chunking/chunkers/doc_analysis_chunker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, data, max_chunk_size=None, minimum_chunk_size=None, token_ove
5757
super().__init__(data)
5858
self.max_chunk_size = max_chunk_size or int(app_config_client.get("CHUNKING_NUM_TOKENS", 2048))
5959
self.minimum_chunk_size = minimum_chunk_size or int(app_config_client.get("CHUNKING_MIN_CHUNK_SIZE", 100))
60-
self.token_overlap = token_overlap or int(app_config_client.get("TOKEN_OVERLAP", 100))
60+
self.token_overlap = token_overlap or int(app_config_client.get("TOKEN_OVERLAP", 200))
6161
self.docint_client = DocumentIntelligenceClient()
6262
self.supported_formats = self.docint_client.file_extensions
6363

chunking/chunkers/json_chunker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, data, max_chunk_size=None, token_overlap=None, minimum_chunk_
1818
super().__init__(data)
1919
import os
2020
self.max_chunk_size = int(max_chunk_size or app_config_client.get("CHUNKING_NUM_TOKENS", 2048))
21-
self.token_overlap = int(token_overlap or app_config_client.get("TOKEN_OVERLAP", 100))
21+
self.token_overlap = int(token_overlap or app_config_client.get("TOKEN_OVERLAP", 200))
2222
self.minimum_chunk_size = int(minimum_chunk_size or app_config_client.get("CHUNKING_MIN_CHUNK_SIZE", 100))
2323

2424
def get_chunks(self):

chunking/chunkers/langchain_chunker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(self, data):
4949
super().__init__(data)
5050
self.max_chunk_size = int(app_config_client.get("CHUNKING_NUM_TOKENS", "2048"))
5151
self.minimum_chunk_size = int(app_config_client.get("CHUNKING_MIN_CHUNK_SIZE", "100"))
52-
self.token_overlap = int(app_config_client.get("TOKEN_OVERLAP", "100"))
52+
self.token_overlap = int(app_config_client.get("TOKEN_OVERLAP", "200"))
5353
self.supported_formats = {
5454
"md": "markdown",
5555
"txt": "text",

chunking/chunkers/nl2sql_chunker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, data, max_chunk_size=None, token_overlap=None):
3939
"""
4040
super().__init__(data)
4141
self.max_chunk_size = max_chunk_size or int(app_config_client.get("CHUNKING_NUM_TOKENS", "2048"))
42-
self.token_overlap = token_overlap or 100
42+
self.token_overlap = token_overlap or 200
4343

4444
def get_chunks(self):
4545
chunks = []

chunking/chunkers/transcription_chunker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self, data, max_chunk_size=None, token_overlap=None):
5555
"""
5656
super().__init__(data)
5757
self.max_chunk_size = max_chunk_size or int(app_config_client.get("CHUNKING_NUM_TOKENS", "2048"))
58-
self.token_overlap = token_overlap or 100
58+
self.token_overlap = token_overlap or 200
5959

6060
def get_chunks(self):
6161
chunks = []

tools/aoai.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,33 @@ def get_completion(
119119
self,
120120
prompt: str,
121121
max_tokens: int = 800,
122-
retry_after: bool = True
122+
retry_after: bool = True,
123+
image_base64: str = None
123124
) -> str:
124125
# Truncate prompt if over token limit
125126
prompt_trunc = self._truncate_input(prompt, self.max_gpt_tokens)
126127

128+
# Build user message: multimodal (text + image) when image is provided
129+
if image_base64:
130+
user_content = [
131+
{"type": "text", "text": prompt_trunc},
132+
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_base64}"}}
133+
]
134+
else:
135+
user_content = prompt_trunc
136+
127137
messages = [
128138
{"role": "system", "content": "You are a helpful assistant."},
129-
{"role": "user", "content": prompt_trunc}
139+
{"role": "user", "content": user_content}
130140
]
131141

132142
attempt = 0
133143
while True:
134144
try:
135145
resp = self.client.chat.completions.create(
136-
model = self.chat_deployment,
137-
messages = messages,
138-
max_tokens = max_tokens
146+
model = self.chat_deployment,
147+
messages = messages,
148+
max_completion_tokens = max_tokens
139149
)
140150
return resp.choices[0].message.content
141151

0 commit comments

Comments
 (0)