Skip to content

Commit b27a7da

Browse files
fix: Update use case terminology and improve date handling in scripts
2 parents e6b79ae + eb36590 commit b27a7da

File tree

6 files changed

+20
-19
lines changed

6 files changed

+20
-19
lines changed

documents/SampleQuestions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ To help you get started, here are some **Sample Prompts** you can ask in the app
55
> Note: To avoid rate limit errors, pause for 2–3 seconds after a response before submitting the next question. <br>
66
Average response time is 8–14 seconds.
77

8-
For Contact Center use case:
8+
For Contact Center (telecom) use case:
99
1. Ask the following questions:
1010
- Total number of calls by date for last 7 days.
1111
- To view the response data as a graph, just prompt "Generate Chart".

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ param aiServiceLocation string
4646
@minLength(1)
4747
@description('Required. Industry use case for deployment:')
4848
@allowed([
49-
'Contact-center'
49+
'telecom'
5050
'IT_helpdesk'
5151
])
5252
param usecase string

infra/main.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.39.26.7824",
9-
"templateHash": "659660736055225323"
9+
"templateHash": "13745926654098190586"
1010
}
1111
},
1212
"parameters": {
@@ -65,7 +65,7 @@
6565
"usecase": {
6666
"type": "string",
6767
"allowedValues": [
68-
"Contact-center",
68+
"telecom",
6969
"IT_helpdesk"
7070
],
7171
"minLength": 1,
@@ -26216,9 +26216,9 @@
2621626216
}
2621726217
},
2621826218
"dependsOn": [
26219-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
26220-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
2622126219
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
26220+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
26221+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
2622226222
"backendUserAssignedIdentity",
2622326223
"logAnalyticsWorkspace",
2622426224
"userAssignedIdentity",
@@ -28545,9 +28545,9 @@
2854528545
}
2854628546
},
2854728547
"dependsOn": [
28548-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
2854928548
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
2855028549
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
28550+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
2855128551
"logAnalyticsWorkspace",
2855228552
"userAssignedIdentity",
2855328553
"virtualNetwork"
@@ -36917,10 +36917,10 @@
3691736917
}
3691836918
},
3691936919
"dependsOn": [
36920-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]",
36920+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageDfs)]",
3692136921
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
3692236922
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
36923-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageDfs)]",
36923+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]",
3692436924
"userAssignedIdentity",
3692536925
"virtualNetwork"
3692636926
]

infra/scripts/index_scripts/03_cu_process_data_text.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
SAMPLE_IMPORT_FILE = 'infra/data/telecom/sample_search_index_data.json'
5454
SAMPLE_PROCESSED_DATA_FILE = 'infra/data/telecom/sample_processed_data.json'
5555
SAMPLE_PROCESSED_DATA_KEY_PHRASES_FILE = 'infra/data/telecom/sample_processed_data_key_phrases.json'
56-
elif USE_CASE == "IT_helpdesk":
56+
else:
5757
SAMPLE_IMPORT_FILE = 'infra/data/IT_helpdesk/sample_search_index_data.json'
5858
SAMPLE_PROCESSED_DATA_FILE = 'infra/data/IT_helpdesk/sample_processed_data.json'
5959
SAMPLE_PROCESSED_DATA_KEY_PHRASES_FILE = 'infra/data/IT_helpdesk/sample_processed_data_key_phrases.json'
@@ -321,7 +321,7 @@ def create_tables():
321321
timestamp_format = "%Y-%m-%d %H_%M_%S"
322322
else:
323323
start_time = file_name.replace(".json", "")[-16:]
324-
timestamp_format = "%Y-%m-%d %H%M%S"
324+
timestamp_format = "%Y-%m-%d%H%M%S"
325325
start_timestamp = datetime.strptime(start_time, timestamp_format)
326326
conversation_id = file_name.split('convo_', 1)[1].split('_')[0]
327327
conversationIds.append(conversation_id)
@@ -498,11 +498,12 @@ def get_mined_topic_mapping(input_text, list_of_topics):
498498
today = datetime.today()
499499
cursor.execute("SELECT MAX(CAST(StartTime AS DATETIME)) FROM [dbo].[processed_data]")
500500
max_start_time = cursor.fetchone()[0]
501-
days_difference = (today - max_start_time).days - 1 if max_start_time else 0
502-
cursor.execute("UPDATE [dbo].[processed_data] SET StartTime = FORMAT(DATEADD(DAY, ?, StartTime), 'yyyy-MM-dd HH:mm:ss'), EndTime = FORMAT(DATEADD(DAY, ?, EndTime), 'yyyy-MM-dd HH:mm:ss')", (days_difference, days_difference))
503-
cursor.execute("UPDATE [dbo].[km_processed_data] SET StartTime = FORMAT(DATEADD(DAY, ?, StartTime), 'yyyy-MM-dd HH:mm:ss'), EndTime = FORMAT(DATEADD(DAY, ?, EndTime), 'yyyy-MM-dd HH:mm:ss')", (days_difference, days_difference))
504-
cursor.execute("UPDATE [dbo].[processed_data_key_phrases] SET StartTime = FORMAT(DATEADD(DAY, ?, StartTime), 'yyyy-MM-dd HH:mm:ss')", (days_difference,))
505-
conn.commit()
501+
days_difference = (today.date() - max_start_time.date()).days - 1 if max_start_time else 0
502+
if days_difference > 0:
503+
cursor.execute("UPDATE [dbo].[processed_data] SET StartTime = FORMAT(DATEADD(DAY, ?, StartTime), 'yyyy-MM-dd HH:mm:ss'), EndTime = FORMAT(DATEADD(DAY, ?, EndTime), 'yyyy-MM-dd HH:mm:ss')", (days_difference, days_difference))
504+
cursor.execute("UPDATE [dbo].[km_processed_data] SET StartTime = FORMAT(DATEADD(DAY, ?, StartTime), 'yyyy-MM-dd HH:mm:ss'), EndTime = FORMAT(DATEADD(DAY, ?, EndTime), 'yyyy-MM-dd HH:mm:ss')", (days_difference, days_difference))
505+
cursor.execute("UPDATE [dbo].[processed_data_key_phrases] SET StartTime = FORMAT(DATEADD(DAY, ?, StartTime), 'yyyy-MM-dd HH:mm:ss')", (days_difference,))
506+
conn.commit()
506507

507508
cursor.close()
508509
conn.close()

infra/scripts/run_create_index_scripts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ if [ $? -ne 0 ]; then
109109
error_flag=true
110110
fi
111111

112-
if ["$usecase" == "telecom" ]; then
112+
if [ "$usecase" == "telecom" ]; then
113113
echo "✓ Creating CU template for audio"
114114
python ${pythonScriptPath}02_create_cu_template_audio.py --cu_endpoint="$cu_endpoint" --cu_api_version="$cu_api_version"
115115
if [ $? -ne 0 ]; then

src/api/common/database/sqldb_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ async def adjust_processed_data_dates():
8383
max_start_time = (cursor.fetchone())[0]
8484

8585
if max_start_time:
86-
days_difference = (today - max_start_time).days - 1
87-
if days_difference != 0:
86+
days_difference = (today.date() - max_start_time.date()).days - 1
87+
if days_difference > 0:
8888
# Update processed_data table
8989
cursor.execute(
9090
"UPDATE [dbo].[processed_data] SET StartTime = FORMAT(DATEADD(DAY, ?, StartTime), 'yyyy-MM-dd "

0 commit comments

Comments
 (0)