Skip to content

Commit 68414ad

Browse files
Added time format HH:mm in the response
1 parent db8941e commit 68414ad

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: ClientAdvisor/App/app.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,7 @@ async def stream_chat_request(request_body, request_headers):
963963
if client_id is None:
964964
return jsonify({"error": "No client ID provided"}), 400
965965
query = request_body.get("messages")[-1].get("content")
966+
query = query.strip()
966967

967968
async def generate():
968969
deltaText = ""
@@ -1546,12 +1547,12 @@ def get_users():
15461547
ClientSummary,
15471548
CAST(LastMeeting AS DATE) AS LastMeetingDate,
15481549
FORMAT(CAST(LastMeeting AS DATE), 'dddd MMMM d, yyyy') AS LastMeetingDateFormatted,
1549-
FORMAT(LastMeeting, 'hh:mm tt') AS LastMeetingStartTime,
1550-
FORMAT(LastMeetingEnd, 'hh:mm tt') AS LastMeetingEndTime,
1550+
FORMAT(LastMeeting, 'HH:mm ') AS LastMeetingStartTime,
1551+
FORMAT(LastMeetingEnd, 'HH:mm') AS LastMeetingEndTime,
15511552
CAST(NextMeeting AS DATE) AS NextMeetingDate,
15521553
FORMAT(CAST(NextMeeting AS DATE), 'dddd MMMM d, yyyy') AS NextMeetingFormatted,
1553-
FORMAT(NextMeeting, 'hh:mm tt') AS NextMeetingStartTime,
1554-
FORMAT(NextMeetingEnd, 'hh:mm tt') AS NextMeetingEndTime
1554+
FORMAT(NextMeeting, 'HH:mm') AS NextMeetingStartTime,
1555+
FORMAT(NextMeetingEnd, 'HH:mm') AS NextMeetingEndTime
15551556
FROM (
15561557
SELECT ca.ClientId, Client, Email, AssetValue, ClientSummary, LastMeeting, LastMeetingEnd, NextMeeting, NextMeetingEnd
15571558
FROM (

Diff for: ClientAdvisor/AzureFunction/function_app.py

+2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def get_SQL_Response(
100100
Do not include assets values unless asked for.
101101
Always use ClientId = {clientid} in the query filter.
102102
Always return client name in the query.
103+
If a question involves date and time, always use FORMAT(YourDateTimeColumn, 'yyyy-MM-dd HH:mm:ss') in the query.
103104
Only return the generated sql query. do not return anything else'''
104105
try:
105106

@@ -265,6 +266,7 @@ async def stream_openai_text(req: Request) -> StreamingResponse:
265266
Only use the client name returned from database in the response.
266267
If you cannot answer the question, always return - I cannot answer this question from the data available. Please rephrase or add more details.
267268
** Remove any client identifiers or ids or numbers or ClientId in the final response.
269+
Always return time in "HH:mm" format for the client in response.
268270
'''
269271

270272
user_query = query.replace('?',' ')

0 commit comments

Comments
 (0)