Skip to content

Commit 7621b07

Browse files
use gpt4omini for extracting tags
1 parent 9f66a17 commit 7621b07

4 files changed

Lines changed: 146 additions & 64 deletions

File tree

App/backend-api/Microsoft.GS.DPS/Handlers/KeywordExtractingHandler.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public KeywordExtractingHandler(
3838

3939
//init Semantic Kernel
4040
this._kernel = Kernel.CreateBuilder()
41-
.AddAzureOpenAIChatCompletion(deploymentName: (string)this._config.Services["AzureOpenAIText"]["Deployment"],
41+
.AddAzureOpenAIChatCompletion(deploymentName: (string)this._config.Services["AzureOpenAIText"]["DeploymentTags"],
4242
endpoint: (string)this._config.Services["AzureOpenAIText"]["Endpoint"],
4343
credentials: new DefaultAzureCredential())
4444
.Build();
@@ -89,6 +89,7 @@ TAGS SHOULD BE CATEGORY SPECIFIC
8989
TAGS SHOULD BE A LIST OF STRINGS
9090
TAGS COUNT CAN BE UP TO 10 UNDER A CATEGORY
9191
CATEGORY COUNT CAN BE UP TO 10
92+
ONLY INCLUDE RELEVANT AND IMPORTANT CATEGORIES AND TAGS TO KEEP THE LIST MINIMAL
9293
DON'T ADD ANY MARKDOWN EXPRESSION IN YOUR RESPONSE
9394
STRICTLY RESPOND IN FORMAT SHOWN IN BELOW EXAMPLES
9495
[END RULES]
@@ -107,18 +108,18 @@ [END EXAMPLE 1]
107108
[EXAMPLE 2]
108109
[
109110
{
110-
"Economic Conditions": [
111-
"Nonfarm Payrolls",
112-
"Job Growth",
113-
"GDP Growth"
111+
"Addenda": [
112+
"Addendum Regarding Fixture Leases",
113+
"Loan Assumption Addendum",
114+
"Seller Financing Addendum"
114115
]
115116
},
116117
{
117-
"Home Sales Market": [
118-
"Market Conditions",
119-
"Home Sales Volume",
120-
"Mortgage Rates",
121-
"REO Properties"
118+
"Contract Details": [
119+
"Closing Date",
120+
"Earnest Money",
121+
"Property Condition",
122+
"Sales Price"
122123
]
123124
}
124125
]

Deployment/send-filestoendpoint.psm1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Send-FilesToEndpoint {
2121
$files = Get-ChildItem -Path $DataFolderPath -File
2222

2323
# Create HttpClient with timeout
24-
$timeout = 600000 # Timeout in milliseconds (e.g., 600000 ms = 600 seconds)
24+
$timeout = 720000 # Timeout in milliseconds (e.g., 720000 ms = 720 seconds)
2525
$httpClient = [System.Net.Http.HttpClient]::new()
2626
$httpClient.Timeout = [TimeSpan]::FromMilliseconds($timeout)
2727

@@ -69,8 +69,6 @@ function Send-FilesToEndpoint {
6969
else {
7070
Write-Error "Failed to upload file: $($file.Name). Status code: $($response.StatusCode)"
7171
}
72-
73-
Start-Sleep -Seconds 30
7472
}
7573
catch {
7674
Write-Error "An error occurred while uploading the file: $($file.Name). Error: $_"

infra/main.bicep

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ param gptModelDeploymentType string = 'GlobalStandard'
3535
@description('Optional. Name of the GPT model to deploy:')
3636
@allowed([
3737
'gpt-4.1-mini'
38+
'gpt-4o'
39+
'gpt-4o-mini'
3840
])
3941
param gptModelName string = 'gpt-4.1-mini'
4042

@@ -45,6 +47,18 @@ param gptModelVersion string = '2025-04-14'
4547
@minValue(10)
4648
param gptModelCapacity int = 100
4749

50+
@minLength(1)
51+
@description('Optional. Name of the GPT model to deploy:')
52+
@allowed([
53+
'gpt-4.1-mini'
54+
'gpt-4o'
55+
'gpt-4o-mini'
56+
])
57+
param gptModelNameTags string = 'gpt-4o-mini'
58+
59+
@description('Optional. Version of the GPT model to deploy.')
60+
param gptModelVersionTags string = '2024-07-18'
61+
4862
@minLength(1)
4963
@description('Optional. Name of the Text Embedding model to deploy:')
5064
@allowed([
@@ -95,7 +109,8 @@ param enableScalability bool = false
95109
azd: {
96110
type: 'location'
97111
usageName: [
98-
'OpenAI.GlobalStandard.gpt4.1-mini,150'
112+
'OpenAI.GlobalStandard.gpt4.1-mini,100'
113+
'OpenAI.GlobalStandard.gpt-4o-mini,100'
99114
'OpenAI.GlobalStandard.text-embedding-3-large,100'
100115
]
101116
}
@@ -166,6 +181,13 @@ var gptModelDeployment = {
166181
deploymentCapacity: gptModelCapacity
167182
}
168183

184+
var gptModelDeploymentTags = {
185+
modelName: gptModelNameTags
186+
deploymentName: gptModelNameTags
187+
deploymentVersion: gptModelVersionTags
188+
deploymentCapacity: gptModelCapacity
189+
}
190+
169191
var embeddingModelDeployment = {
170192
modelName: embeddingModelName
171193
deploymentName: embeddingModelName
@@ -186,6 +208,18 @@ var openAiDeployments = [
186208
capacity: gptModelDeployment.deploymentCapacity
187209
}
188210
}
211+
{
212+
name: gptModelDeploymentTags.deploymentName
213+
model: {
214+
format: 'OpenAI'
215+
name: gptModelDeploymentTags.modelName
216+
version: gptModelDeploymentTags.deploymentVersion
217+
}
218+
sku: {
219+
name: gptModelDeploymentType
220+
capacity: gptModelDeploymentTags.deploymentCapacity
221+
}
222+
}
189223
{
190224
name: embeddingModelDeployment.deploymentName
191225
model: {
@@ -528,6 +562,10 @@ module avmAppConfig 'br/public:avm/res/app-configuration/configuration-store:0.6
528562
name: 'KernelMemory:Services:AzureOpenAIText:Deployment'
529563
value: gptModelDeployment.deploymentName
530564
}
565+
{
566+
name: 'KernelMemory:Services:AzureOpenAIText:DeploymentTags'
567+
value: gptModelDeploymentTags.deploymentName
568+
}
531569
{
532570
name: 'KernelMemory:Services:AzureOpenAIText:Endpoint'
533571
value: avmOpenAi.outputs.endpoint

0 commit comments

Comments
 (0)