Skip to content

Commit

Permalink
fixed response for section API
Browse files Browse the repository at this point in the history
  • Loading branch information
AjitPadhi-Microsoft committed Dec 16, 2024
1 parent 1319aaf commit 353a4d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,16 @@ async def generate_section_content(request_body, request_headers):
return response_content

# Split the response content into individual sections
response_content = response_content.strip().split("\n\n")
if len(request_body) == 1:
return [
{
"sectionTitle": request_body[0]["sectionTitle"],
"content": response.choices[0].message.content,
}
]
else:
response_content = response_content.strip().split("\n\n")

results = []
for i, section in enumerate(request_body):
results.append(
Expand Down

0 comments on commit 353a4d0

Please sign in to comment.