Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Teams Library] The bot reports BadRequest when the message is empty #3077

Open
ArcturusZhang opened this issue Oct 27, 2023 · 2 comments
Open
Assignees
Labels
AI-Bot bug Something isn't working Teams

Comments

@ArcturusZhang
Copy link

Bug Report

image

@raych1
Copy link

raych1 commented Oct 30, 2023

whitespace message causes below exception.

Microsoft.Bot.Builder.Integration.AspNet.Core.CloudAdapter: Error: [OnTurnError] unhandled error : Something went wrong HTTP response failure status code: $BadRequest (Bad Request)

Microsoft.TeamsAI.Exceptions.AzureContentSafetyClientException: Something went wrong HTTP response failure status code: $BadRequest (Bad Request)
   at Microsoft.TeamsAI.AI.AzureContentSafety.AzureContentSafetyClient._ExecutePostRequest(String url, HttpContent content, CancellationToken cancellationToken)
   at Microsoft.TeamsAI.AI.AzureContentSafety.AzureContentSafetyClient.ExecuteTextModeration(AzureContentSafetyTextAnalysisRequest request)
   at Microsoft.TeamsAI.AI.Moderator.AzureContentSafetyModerator`1._HandleTextModeration(String text, Boolean isModelInput)
   at Microsoft.TeamsAI.AI.Moderator.AzureContentSafetyModerator`1.ReviewPrompt(ITurnContext turnContext, TState turnState, PromptTemplate prompt)
   at Microsoft.TeamsAI.AI.AI`1.ChainAsync(ITurnContext turnContext, TState turnState, PromptTemplate prompt, AIOptions`1 options, CancellationToken cancellationToken)
   at Microsoft.TeamsAI.AI.AI`1.ChainAsync(ITurnContext turnContext, TState turnState, String prompt, AIOptions`1 options, CancellationToken cancellationToken)
   at Microsoft.TeamsAI.Application`2._OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken)
   at Microsoft.TeamsAI.Application`2.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
   at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken)
Microsoft.Bot.Builder.Integration.AspNet.Core.CloudAdapter: Information: SendActivitiesAsync for 1 activities.
Microsoft.Bot.Builder.Integration.AspNet.Core.CloudAdapter: Information: Sending activity.  ReplyToId: 1698632502514

@raych1 raych1 self-assigned this Oct 30, 2023
@raych1 raych1 added the AI-Bot label Oct 30, 2023
@raych1
Copy link

raych1 commented Oct 30, 2023

This is a bug of Teams-AI library. I disabled the moderator for short term solution as it's not needed in current scenario where the response of AI is based on the knowledge base.

@raych1 raych1 changed the title The bot reports BadRequest when the message is empty [Teams Library] The bot reports BadRequest when the message is empty Nov 1, 2023
@raych1 raych1 added bug Something isn't working Teams and removed resolved labels Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI-Bot bug Something isn't working Teams
Projects
None yet
Development

No branches or pull requests

2 participants