Closed aymiee closed 4 months ago
@aymiee
I am able to reproduce. Investigating further.
Also confirmed:
Results: ${turn.results}
will display correctly without the lgType property.Thanks, I was told on Microsoft tech community that the issue was an update in the template engine used by the Bot Framework Composer. I have since updated my flask backend to retrieve the content from the text key.
I also modified my Flask app to not encapsulate the response in a JSON object with 'data' as the key since the Bot Framework Composer already uses 'content' in the JSON structure. I can now access value via ${turn.results.content}
{ "lgType": "Activity", "text": { "statusCode": 200, "reasonPhrase": "OK", "headers": { "Date": "Mon, 22 Jan 2024 04:58:15 GMT", "Server": "gunicorn" }, "content": { "How can I assist you today? If you have any IT-related queries, need information from the company data, or have compliance-related questions, feel free to ask!" } } }
Closing as the fix was merged in the SDK repository.
Describe the bug
When attempting to access the 'data' property from a JSON response in Bot Framework Composer using
turn.results.text
, the path returns empty. Direct access and expressions such as${json(turn.results.text.content.data)}
lead to an "Operation returned an invalid status code 'BadRequest'" error.My web app use to return the response in 'message' field and I was able to retrieve it via : ${turn.results.content.data.message} Recently, I started getting "Operation returned an invalid status code 'BadRequest'". The structure of ${turn.results} has changed to:
{ "lgType": "Activity", "text": { "statusCode": 200, "reasonPhrase": "OK", "headers": { "Date": "Mon, 22 Jan 2024 04:58:15 GMT", "Server": "gunicorn" }, "content": { "data": "How can I assist you today? If you have any IT-related queries, need information from the company data, or have compliance-related questions, feel free to ask!" } } }
Attempts to access the data with ${getProperty(turn.results.text.content, 'data')} and ${turn.results.text.content.data} have been unsuccessful resulting in Operation returned an invalid status code 'BadRequest'
Additionally, ${turn.results.text.content} and ${turn.results.text} are returning empty.
Version
Version: 2.1.2 Electron: 8.2.4 Chrome: 80.0.3987.165 NodeJS: 12.13.0 V8: 8.0.426.27-electron.0
Browser
OS
To Reproduce
Steps to reproduce the behavior:
turn.results
.turn.results.text.content.data
,Expected behavior
Screenshots
Additional context
The exact JSON response structure is as follows: