@@ -882,10 +882,18 @@ async def generate_title(conversation_messages):
882882
883883
884884async def get_section_content (request_body , request_headers ):
885- prompt = f"""{ app_settings .azure_openai .generate_section_content_prompt }
886- Section Title: { request_body ['sectionTitle' ]}
887- Section Description: { request_body ['sectionDescription' ]}
888- """
885+ prompt = f'''Generate content for the sections below: { request_body } .
886+ For eacth section, use the SectionTitle and SectionDescription to
887+ create a new attributed called 'content' that contains the generated content,
888+ Do not include any other commentary or description.
889+ Always format the sections for better readability.
890+ Leave placeholders for names and amounts etc.
891+ Do not use markdown syntax.
892+ '''
893+ # prompt = f"""{app_settings.azure_openai.generate_section_content_prompt}
894+ # Section Title: {request_body['sectionTitle']}
895+ # Section Description: {request_body['sectionDescription']}
896+ # """
889897
890898 messages = [{"role" : "system" , "content" : app_settings .azure_openai .system_message }]
891899 messages .append ({"role" : "user" , "content" : prompt })
@@ -895,12 +903,8 @@ async def get_section_content(request_body, request_headers):
895903
896904 try :
897905 azure_openai_client = init_openai_client ()
898- raw_response = (
899- await azure_openai_client .chat .completions .with_raw_response .create (
900- ** model_args
901- )
902- )
903- response = raw_response .parse ()
906+ response = await azure_openai_client .chat .completions .create (** model_args )
907+ # response = raw_response.parse()
904908
905909 except Exception as e :
906910 logging .exception ("Exception in send_chat_request" )
0 commit comments