Skip to content

Commit 701c353

Browse files
Merge pull request #63 from microsoft/PSL-BUG-5663
fix: Added the system message to ensure consistent and accurate data retrieval for the list of questions.
2 parents a7467e9 + c4f750c commit 701c353

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ClientAdvisor/AzureFunction/function_app.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ def get_SQL_Response(
103103
Always return time in "HH:mm" format for the client meetings in response.
104104
If asked, provide information about client meetings according to the requested timeframe: give details about upcoming meetings if asked for "next" or "upcoming" meetings, and provide details about past meetings if asked for "previous" or "last" meetings, including the scheduled time in the query.
105105
If asked about the number of past meetings with this client, provide the count of records where the ConversationId is neither null nor an empty string and the EndTime is before the current date in the query.
106+
If asked, provide a summary of the most recent meeting with the client from past dates in the query.
107+
If asked, provide information on the client's investment risk tolerance level in the query.
108+
If asked, provide information on the client's portfolio performance in the query.
109+
If asked, provide information about the client's top-performing investments in the query.
110+
If asked, provide information about any recent changes in the client's investment allocations in the query.
111+
If asked about the client's portfolio performance over the last quarter, calculate the total investment by summing the investment amounts where AssetDate is greater than or equal to the date from one quarter ago using DATEADD(QUARTER, -1, GETDATE()) in the query.
112+
If asked about upcoming important dates or deadlines for the client, always ensure that StartTime is greater than the current date. Do not convert the formats of StartTime and EndTime and consistently provide the upcoming dates along with the scheduled times in the query.
106113
To determine the client's portfolio value, provide the total sum of all investments when asked for the asset value. For the current asset value, sum the investment values for the most recent available dates. When asked about the asset types in the portfolio and the total value of each, list each asset type with the total sum of investments for each category. If asked for the asset types in the portfolio and the present value of each, provide a list of each asset type with its most recent investment value.
107114
Only return the generated sql query. do not return anything else'''
108115
try:
@@ -162,6 +169,8 @@ def get_answers_from_calltranscripts(
162169
query = question
163170
system_message = '''You are an assistant who provides wealth advisors with helpful information to prepare for client meetings.
164171
You have access to the client’s meeting call transcripts.
172+
If asked, consistently provide the action items from the last or previous client meeting only for past dates.
173+
If asked, consistently provide the summary of the last meeting with the client only for past dates.
165174
Always return time in "HH:mm" format for the client in response.
166175
You can use this information to answer questions about the clients'''
167176

@@ -268,13 +277,20 @@ async def stream_openai_text(req: Request) -> StreamingResponse:
268277
Do not answer any questions not related to wealth advisors queries.
269278
If asked, provide information about client meetings according to the requested timeframe: give details about upcoming meetings if asked for "next" or "upcoming" meetings, and provide details about past meetings if asked for "previous" or "last" meetings, including the scheduled time.
270279
If asked about the number of past meetings with this client, provide the count of records where the ConversationId is neither null nor an empty string and the EndTime is before the current date.
280+
If asked, provide a summary of the most recent meeting with the client from past dates.
281+
If asked, provide information on the client's investment risk tolerance level.
282+
If asked, provide information on the client's portfolio performance.
283+
If asked, provide the action items from the last or previous client meeting for past dates.
284+
If asked, provide information about the client's top-performing investments.
285+
If asked, provide information about any recent changes in the client's investment allocations.
286+
If asked about the client's portfolio performance over the last quarter, calculate the total investment by summing the investment amounts where AssetDate is greater than or equal to the date from one quarter ago using DATEADD(QUARTER, -1, GETDATE()).
287+
If asked about upcoming important dates or deadlines for the client, always ensure that StartTime is greater than the current date. Do not convert the formats of StartTime and EndTime and consistently provide the upcoming dates along with the scheduled times.
271288
Always recognize and respond to the selected client by their full name or common variations (e.g., "Karen" and "Karen Berg" should be treated as the same client if Karen Berg is selected).
272289
Ensure responses are consistent and up-to-date, clearly stating the date of the data to avoid confusion
273290
If the client name and client id do not match, only return - Please only ask questions about the selected client or select another client to inquire about their details. do not return any other information.
274291
Only use the client name returned from database in the response.
275292
If you cannot answer the question, always return - I cannot answer this question from the data available. Please rephrase or add more details.
276293
** Remove any client identifiers or ids or numbers or ClientId in the final response.
277-
If asked, provide information about client meetings according to the requested timeframe: give details about upcoming meetings if asked for "next" or "upcoming" meetings, and provide details about past meetings if asked for "previous" or "last" meetings, including the scheduled time.
278294
279295
'''
280296

0 commit comments

Comments
 (0)