I am developing a bot using Azure OpenAI and Search service, which is deployed on Microsoft Teams. The bot works correctly in my local environment, but when I deploy it to Teams, the responses fail due to the character limit in the Teams channel (480 characters).
The bot retrieves large volumes of text from an storage account using Cognitive Search and generates responses through Azure OpenAI. The information returned in the citations
often exceeds the 480-character limit imposed by Teams.
I have tried truncating the text in the citations.content
field to fit within this limit, but Teams still rejects the responses or the content seems to be regenerated. I have not found a way to modify the character limit in Microsoft Teams or to control the size of the responses effectively.
Is it possible to increase the character limit for bot messages in Microsoft Teams?
If increasing the limit is not an option, what best practices do you recommend for handling responses that exceed 480 characters, especially when working with Cognitive Search and Azure OpenAI?
Is there any specific feature in Azure OpenAI or Cognitive Search that can help manage the amount of text returned in citations
to comply with Teams' character limits?
Any guidance or suggestions on how to resolve this issue would be greatly appreciated. I am happy to provide additional details if needed.
Thank you for your assistance.
- This is the log results (I have removed the text in the content field)
CHAT RESPONSE:
status: 200
duration: 11033ms
{
"id": "35f636c7-3dd8-4b72-8e51-f1c0cc9cf057",
"model": "gpt-4",
"created": 1727699856,
"object": "extensions.chat.completion",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "text removed [doc3].",
"end_turn": true,
"context": {
"citations": [
{
"content": "text removed",
"title": "PG 0001-2016 Código Ético.pdf",
"url": "https://stcopernicus219750672363.blob.core.windows.net/copernicuspolicies/PG%200001-2016%20Co%CC%81digo%20E%CC%81tico.pdf",
"filepath": "PG 0001-2016 Código Ético.pdf",
"chunk_id": "1"
},
{
"content": "text removed",
"title": "PG 0001-2016 Código Ético.pdf",
"url": "https://stcopernicus219750672363.blob.core.windows.net/copernicuspolicies/PG%200001-2016%20Co%CC%81digo%20E%CC%81tico.pdf",
"filepath": "PG 0001-2016 Código Ético.pdf",
"chunk_id": "2"
},
{
"content": "text removed",
"title": "PG 0001-2016 Código Ético.pdf",
"url": "https://stcopernicus219750672363.blob.core.windows.net/copernicuspolicies/PG%200001-2016%20Co%CC%81digo%20E%CC%81tico.pdf",
"filepath": "PG 0001-2016 Código Ético.pdf",
"chunk_id": "0"
}
],
"intent": "[\"resumen del Código Ético PG 0001-2016\", \"contenido principal del Código Ético PG 0001-2016\", \"puntos clave del Código Ético PG 0001-2016\"]"
}
}
}
],
"usage": {
"prompt_tokens": 5726,
"completion_tokens": 371,
"total_tokens": 6097
},
"system_fingerprint": "fp_5b26d85e12"
}
azureopenai:app:error [onTurnError] unhandled error: RestError: Error while parsing citation entity with id: 1.
Detailed error message: The value of citation entity field 'citation.appearance.abstract' exceeds the length limit.
The maximum length is '480' characters, but the provided length is '497' characters. +3m