Skip to content

Commit

Permalink
Fix Citation Format for Prompt Flow Endpoint Responses (microsoft#1092)
Browse files Browse the repository at this point in the history
Co-authored-by: Anushree Kaipa Ramanath <[email protected]>
  • Loading branch information
2 people authored and everettsouthwick committed Sep 28, 2024
1 parent 83c1b5b commit 9a86369
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down

0 comments on commit 9a86369

Please sign in to comment.