Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Bug 5579 & 7289 | Time Format to use HH:mm across | Added strip functionalities to remove leading and trailing whitespace characters from a "query" string #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ClientAdvisor/App/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ async def stream_chat_request(request_body, request_headers):
if client_id is None:
return jsonify({"error": "No client ID provided"}), 400
query = request_body.get("messages")[-1].get("content")
query = query.strip()

async def generate():
deltaText = ""
Expand Down Expand Up @@ -1546,12 +1547,12 @@ def get_users():
ClientSummary,
CAST(LastMeeting AS DATE) AS LastMeetingDate,
FORMAT(CAST(LastMeeting AS DATE), 'dddd MMMM d, yyyy') AS LastMeetingDateFormatted,
FORMAT(LastMeeting, 'hh:mm tt') AS LastMeetingStartTime,
FORMAT(LastMeetingEnd, 'hh:mm tt') AS LastMeetingEndTime,
FORMAT(LastMeeting, 'HH:mm ') AS LastMeetingStartTime,
FORMAT(LastMeetingEnd, 'HH:mm') AS LastMeetingEndTime,
CAST(NextMeeting AS DATE) AS NextMeetingDate,
FORMAT(CAST(NextMeeting AS DATE), 'dddd MMMM d, yyyy') AS NextMeetingFormatted,
FORMAT(NextMeeting, 'hh:mm tt') AS NextMeetingStartTime,
FORMAT(NextMeetingEnd, 'hh:mm tt') AS NextMeetingEndTime
FORMAT(NextMeeting, 'HH:mm') AS NextMeetingStartTime,
FORMAT(NextMeetingEnd, 'HH:mm') AS NextMeetingEndTime
FROM (
SELECT ca.ClientId, Client, Email, AssetValue, ClientSummary, LastMeeting, LastMeetingEnd, NextMeeting, NextMeetingEnd
FROM (
Expand Down
2 changes: 2 additions & 0 deletions ClientAdvisor/AzureFunction/function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_SQL_Response(
Do not include assets values unless asked for.
Always use ClientId = {clientid} in the query filter.
Always return client name in the query.
If a question involves date and time, always use FORMAT(YourDateTimeColumn, 'yyyy-MM-dd HH:mm:ss') in the query.
Only return the generated sql query. do not return anything else'''
try:

Expand Down Expand Up @@ -265,6 +266,7 @@ async def stream_openai_text(req: Request) -> StreamingResponse:
Only use the client name returned from database in the response.
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.
Always return time in "HH:mm" format for the client in response.
'''

user_query = query.replace('?',' ')
Expand Down