SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
429
stars
184
forks
source link
[Bug]: when there are more than 2 actions sequenced together, `JSONResponseValidator.validateResponse` function fails to validate the returned JSON #1385
when running a bot's actions for a while and then asking to perform a multi-actions sequence of actions, the following error will be thrown:
[index]: [appVersion: 1.0.0] Error: {"message":"[onTurnError] unhandled error: Error: The JSON returned had errors. Apply these fixes:\nchange the \"instance.type\" property to be one of these values: plan\nadd the \"commands\" property to the JSON object"}
The full stack of this error is shown here:
[index]: [appVersion: 1.0.0] [onTurnError] unhandled error: Error: The JSON returned had errors. Apply these fixes:
change the "instance.type" property to be one of these values: plan
add the "commands" property to the JSON object, stack: Error: The JSON returned had errors. Apply these fixes:
change the "instance.type" property to be one of these values: plan
add the "commands" property to the JSON object
at LLMClient.repairResponse (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\LLMClient.ts:482:24)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async LLMClient.repairResponse (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\LLMClient.ts:487:16)
at async LLMClient.repairResponse (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\LLMClient.ts:487:16)
at async LLMClient.completePrompt (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\LLMClient.ts:342:28)
at async ActionPlanner.completePrompt (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\ActionPlanner.ts:250:16)
at async ActionPlanner.continueTask (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\ActionPlanner.ts:178:24)
at async ActionPlanner.beginTask (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\ActionPlanner.ts:153:16)
at async AI.run (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\AI.ts:453:24)
at async D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\Application.ts:751:21
[index]: [appVersion: 1.0.0] [onTurnError] unhandled error: Error: The JSON returned had errors. Apply these fixes:
change the "instance.type" property to be one of these values: plan
add the "commands" property to the JSON object
Reproduction Steps
1.Run Teams AI bot with a sequence of questions that run single actions.
2.Repeat it for a few rounds.
3.Ask bot the prompt that should result in multiple (2 or more) actions sequenced together.
4. The error shown above will be thrown.
...
Additional information
Here is a sample action plan object that causes this issue:
{
"type": "plan",
"commands": [
{
"type": "SAY",
"response": "Sure, I'm fetching the general information about Tesla."
},
{
"type": "DO",
"action": "getCompanyInfo",
"parameters": {
"entity": "Tesla"
}
},
{
"type": "SAY",
"response": "Now, I'm retrieving the financial outlook for Tesla."
},
{
"type": "DO",
"action": "getCompanyDetails",
"parameters": {
"entity": "Tesla"
}
},
{
"type": "SAY",
"response": "Next, I'm getting the information for Microsoft."
},
{
"type": "DO",
"action": "getCompanyInfo",
"parameters": {
"entity": "Microsoft"
}
}
]
}
Language
Javascript/Typescript
Version
latest
Description
when running a bot's actions for a while and then asking to perform a multi-actions sequence of actions, the following error will be thrown: [index]: [appVersion: 1.0.0] Error: {"message":"[onTurnError] unhandled error: Error: The JSON returned had errors. Apply these fixes:\nchange the \"instance.type\" property to be one of these values: plan\nadd the \"commands\" property to the JSON object"}
The full stack of this error is shown here: [index]: [appVersion: 1.0.0] [onTurnError] unhandled error: Error: The JSON returned had errors. Apply these fixes: change the "instance.type" property to be one of these values: plan add the "commands" property to the JSON object, stack: Error: The JSON returned had errors. Apply these fixes: change the "instance.type" property to be one of these values: plan add the "commands" property to the JSON object at LLMClient.repairResponse (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\LLMClient.ts:482:24) at processTicksAndRejections (node:internal/process/task_queues:95:5) at async LLMClient.repairResponse (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\LLMClient.ts:487:16) at async LLMClient.repairResponse (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\LLMClient.ts:487:16) at async LLMClient.completePrompt (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\LLMClient.ts:342:28) at async ActionPlanner.completePrompt (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\ActionPlanner.ts:250:16) at async ActionPlanner.continueTask (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\ActionPlanner.ts:178:24) at async ActionPlanner.beginTask (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\planners\ActionPlanner.ts:153:16) at async AI.run (D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\AI.ts:453:24) at async D:\github\microsoft\fsi-copilot\dannyg\node_modules\@microsoft\teams-ai\src\Application.ts:751:21 [index]: [appVersion: 1.0.0] [onTurnError] unhandled error: Error: The JSON returned had errors. Apply these fixes: change the "instance.type" property to be one of these values: plan add the "commands" property to the JSON object
Reproduction Steps
Additional information
Here is a sample action plan object that causes this issue: