Skip to content

Commit

Permalink
Merge pull request #37 from Roopan-Microsoft/Bug10335
Browse files Browse the repository at this point in the history
'fix' for inconsistent respose for count of call transcript
  • Loading branch information
Roopan-Microsoft authored Nov 13, 2024
2 parents 7f84184 + 94fa02c commit a5fbf30
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ClientAdvisor/AzureFunction/function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def get_answers_from_calltranscripts(
system_message = '''You are an assistant who provides wealth advisors with helpful information to prepare for client meetings.
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.
if asked related to count of call transcripts,**Always** respond the total number of sourceurid involved for the {ClientId} consistently, Do never change if question is reframed or contains "so far" or if the case is altered or having first name or full name of the client present with so far or case altered with first name of the client or case altered with first name of client and so far.
You can use this information to answer questions about the clients
'''

Expand Down Expand Up @@ -281,21 +281,19 @@ async def stream_openai_text(req: Request) -> StreamingResponse:

system_message = '''you are a helpful assistant to a wealth advisor.
Do not answer any questions not related to wealth advisors queries.
**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_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>'''

sk_response = kernel.invoke_prompt_stream(
function_name="prompt_test",
plugin_name="weather_test",
Expand Down

0 comments on commit a5fbf30

Please sign in to comment.