From 76930eb27a288cd1ec8841afb792282eca8126d7 Mon Sep 17 00:00:00 2001 From: Anushree Kaipa Ramanath Date: Tue, 10 Sep 2024 15:59:29 -0700 Subject: [PATCH] Modify the format for citations field in the promptflow response post processing stage, so that citation shows up in UI.Fixing issue reported: https://portal.microsofticm.com/imp/v5/incidents/details/540126530/summary --- backend/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/utils.py b/backend/utils.py index 2b722dc79d..e0634df85c 100644 --- a/backend/utils.py +++ b/backend/utils.py @@ -166,10 +166,12 @@ def format_pf_non_streaming_response( "content": chatCompletion[response_field_name] }) if citations_field_name in chatCompletion: + citation_content= {"citations": chatCompletion[citations_field_name]} messages.append({ "role": "tool", - "content": chatCompletion[citations_field_name] + "content": json.dumps(citation_content) }) + response_obj = { "id": chatCompletion["id"], "model": "",