diff --git a/ClientAdvisor/AzureFunction/function_app.py b/ClientAdvisor/AzureFunction/function_app.py index e2b8cb36..e61e0a13 100644 --- a/ClientAdvisor/AzureFunction/function_app.py +++ b/ClientAdvisor/AzureFunction/function_app.py @@ -173,7 +173,8 @@ def get_answers_from_calltranscripts( You have access to the client’s meeting call transcripts. If requested for call transcript(s), the response for each transcript should be summarized separately and Ensure all transcripts for the specified client are retrieved and format **must** follow as First Call Summary,Second Call Summary etc. First name and Full name of the client mentioned in prompt should give same response for both. - You can use this information to answer questions about the clients''' + You can use this information to answer questions about the clients + ''' completion = client.chat.completions.create( model = deployment, @@ -276,20 +277,21 @@ async def stream_openai_text(req: Request) -> StreamingResponse: # Read the HTML file with open("table.html", "r") as file: - html_content = file.read() - - system_message = '''you are a helpful assistant to a wealth advisor. + html_content = file.read() + + system_message = '''you are a helpful assistant to a wealth advisor. Do not answer any questions not related to wealth advisors queries. - **If the client name in the question does not match the selected client's name**, always return: "Please ask questions only about the selected client." Do not provide any other information. + **If the normalized client name in the question does not match the normalized selected client name or client name and client id do not match**, always return: "Please ask questions only about the selected client." Do not provide any other information. Always consider to give selected client full name only in response and do not use other example names also consider my client means currently selected client. If you cannot answer the question, always return - I cannot answer this question from the data available. Please rephrase or add more details. ** Remove any client identifiers or ids or numbers or ClientId in the final response. Client name **must be** same as retrieved from database. Always return time in "HH:mm" format for the client in response. + If asked, response should **always be** consistent everytime. ''' system_message += html_content - user_query = query.replace('?',' ') + user_query = query.replace('?','') user_query_prompt = f'''{user_query}. Always send clientId as {user_query.split(':::')[-1]} ''' query_prompt = f'''{system_message}{user_query_prompt}'''