Skip to content

Commit

Permalink
Merge pull request #34 from Somesh-Microsoft/PSL_BUG_8401
Browse files Browse the repository at this point in the history
fix: Psl bug 8401
  • Loading branch information
Roopan-Microsoft authored Nov 6, 2024
2 parents ab9ba6c + 7250e3d commit ceed905
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ClientAdvisor/AzureFunction/function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'''<message role="system">{system_message}</message><message role="user">{user_query_prompt}</message>'''
Expand Down

0 comments on commit ceed905

Please sign in to comment.