Skip to content

Commit 47757a1

Browse files
committed
fix misc syntax issues
1 parent 6ad4d3d commit 47757a1

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

objectscript/RAGDemo.Invoker.cls

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ ClassMethod InvokeBasicRAG(query As %String, config As %String = "{}") As %Strin
2121
// Use Embedded Python to call the Python bridge
2222
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
2323
Set result = bridge."invoke_basic_rag"(query, config)
24-
Quit result
24+
return result
2525
} Catch ex {
2626
// Return error in standardized format
2727
Set error = {
28-
"success": (false),
28+
"success": false,
2929
"result": null,
3030
"error": (ex.DisplayString()),
3131
"timestamp": ($ZDateTime($Horolog, 3))
3232
}
33-
Quit error.%ToJSON()
33+
return error.%ToJSON()
3434
}
3535
}
3636

@@ -44,16 +44,16 @@ ClassMethod InvokeColBERT(query As %String, config As %String = "{}") As %String
4444
// Use Embedded Python to call the Python bridge
4545
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
4646
Set result = bridge."invoke_colbert"(query, config)
47-
Quit result
47+
return result
4848
} Catch ex {
4949
// Return error in standardized format
5050
Set error = {
51-
"success": (false),
51+
"success": false,
5252
"result": null,
5353
"error": (ex.DisplayString()),
5454
"timestamp": ($ZDateTime($Horolog, 3))
5555
}
56-
Quit error.%ToJSON()
56+
return error.%ToJSON()
5757
}
5858
}
5959

@@ -67,16 +67,16 @@ ClassMethod InvokeGraphRAG(query As %String, config As %String = "{}") As %Strin
6767
// Use Embedded Python to call the Python bridge
6868
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
6969
Set result = bridge."invoke_graphrag"(query, config)
70-
Quit result
70+
return result
7171
} Catch ex {
7272
// Return error in standardized format
7373
Set error = {
74-
"success": (false),
74+
"success": false,
7575
"result": null,
7676
"error": (ex.DisplayString()),
7777
"timestamp": ($ZDateTime($Horolog, 3))
7878
}
79-
Quit error.%ToJSON()
79+
return error.%ToJSON()
8080
}
8181
}
8282

@@ -90,16 +90,16 @@ ClassMethod InvokeHyDE(query As %String, config As %String = "{}") As %String [
9090
// Use Embedded Python to call the Python bridge
9191
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
9292
Set result = bridge."invoke_hyde"(query, config)
93-
Quit result
93+
return result
9494
} Catch ex {
9595
// Return error in standardized format
9696
Set error = {
97-
"success": (false),
97+
"success": false,
9898
"result": null,
9999
"error": (ex.DisplayString()),
100100
"timestamp": ($ZDateTime($Horolog, 3))
101101
}
102-
Quit error.%ToJSON()
102+
return error.%ToJSON()
103103
}
104104
}
105105

@@ -113,16 +113,16 @@ ClassMethod InvokeCRAG(query As %String, config As %String = "{}") As %String [
113113
// Use Embedded Python to call the Python bridge
114114
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
115115
Set result = bridge."invoke_crag"(query, config)
116-
Quit result
116+
return result
117117
} Catch ex {
118118
// Return error in standardized format
119119
Set error = {
120-
"success": (false),
120+
"success": false,
121121
"result": null,
122122
"error": (ex.DisplayString()),
123123
"timestamp": ($ZDateTime($Horolog, 3))
124124
}
125-
Quit error.%ToJSON()
125+
return error.%ToJSON()
126126
}
127127
}
128128

@@ -136,16 +136,16 @@ ClassMethod InvokeNodeRAG(query As %String, config As %String = "{}") As %String
136136
// Use Embedded Python to call the Python bridge
137137
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
138138
Set result = bridge."invoke_noderag"(query, config)
139-
Quit result
139+
return result
140140
} Catch ex {
141141
// Return error in standardized format
142142
Set error = {
143-
"success": (false),
143+
"success": false,
144144
"result": null,
145145
"error": (ex.DisplayString()),
146146
"timestamp": ($ZDateTime($Horolog, 3))
147147
}
148-
Quit error.%ToJSON()
148+
return error.%ToJSON()
149149
}
150150
}
151151

@@ -157,16 +157,16 @@ ClassMethod GetAvailablePipelines() As %String [ SqlProc ]
157157
// Use Embedded Python to call the Python bridge
158158
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
159159
Set result = bridge."get_available_pipelines"()
160-
Quit result
160+
return result
161161
} Catch ex {
162162
// Return error in standardized format
163163
Set error = {
164-
"success": (false),
164+
"success": false,
165165
"result": null,
166166
"error": (ex.DisplayString()),
167167
"timestamp": ($ZDateTime($Horolog, 3))
168168
}
169-
Quit error.%ToJSON()
169+
return error.%ToJSON()
170170
}
171171
}
172172

@@ -179,16 +179,16 @@ ClassMethod ValidateResults(results As %String) As %String [ SqlProc ]
179179
// Use Embedded Python to call the Python bridge
180180
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
181181
Set result = bridge."validate_results"(results)
182-
Quit result
182+
return result
183183
} Catch ex {
184184
// Return error in standardized format
185185
Set error = {
186-
"success": (false),
186+
"success": false,
187187
"result": null,
188188
"error": (ex.DisplayString()),
189189
"timestamp": ($ZDateTime($Horolog, 3))
190190
}
191-
Quit error.%ToJSON()
191+
return error.%ToJSON()
192192
}
193193
}
194194

@@ -200,16 +200,16 @@ ClassMethod HealthCheck() As %String [ SqlProc ]
200200
// Use Embedded Python to call the Python bridge
201201
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
202202
Set result = bridge."health_check"()
203-
Quit result
203+
return result
204204
} Catch ex {
205205
// Return error in standardized format
206206
Set error = {
207-
"success": (false),
207+
"success": false,
208208
"result": null,
209209
"error": (ex.DisplayString()),
210210
"timestamp": ($ZDateTime($Horolog, 3))
211211
}
212-
Quit error.%ToJSON()
212+
return error.%ToJSON()
213213
}
214214
}
215215

objectscript/RAGDemo.TestBed.cls

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ ClassMethod RunAllRAGTests() As %String [ SqlProc ]
5555
Set testResults."test_summary"."end_time" = $ZDateTime($Horolog, 3)
5656
Set testResults."test_summary"."duration_seconds" = endTime - startTime
5757

58-
Quit testResults.%ToJSON()
58+
return testResults.%ToJSON()
5959

6060
} Catch ex {
6161
// Return error in standardized format
6262
Set error = {
63-
"success": (false),
63+
"success": false,
6464
"result": null,
6565
"error": (ex.DisplayString()),
6666
"timestamp": ($ZDateTime($Horolog, 3))
6767
}
68-
Quit error.%ToJSON()
68+
return error.%ToJSON()
6969
}
7070
}
7171

@@ -78,7 +78,7 @@ ClassMethod TestSinglePipeline(pipelineName As %String, pipelineInfo As %Dynamic
7878
Set testResult = {
7979
"pipeline_name": (pipelineName),
8080
"pipeline_class": (pipelineInfo."class"),
81-
"success": (false),
81+
"success": false,
8282
"error": "",
8383
"test_query": "What are the effects of COVID-19?",
8484
"response_time_ms": 0,
@@ -107,7 +107,7 @@ ClassMethod TestSinglePipeline(pipelineName As %String, pipelineInfo As %Dynamic
107107
// Parse and validate result
108108
Set result = ##class(%DynamicObject).%FromJSON(resultJson)
109109
If result."success" {
110-
Set testResult."success" = true
110+
Set testResult."success" = 1
111111

112112
// Validate the result structure
113113
Set validationJson = bridge."validate_results"(result."result".%ToJSON())
@@ -146,17 +146,17 @@ ClassMethod BenchmarkAllPipelines() As %String [ SqlProc ]
146146

147147
// Run benchmarks
148148
Set result = bridge."run_benchmarks"(pipelineNames.%ToJSON())
149-
Quit result
149+
return result
150150

151151
} Catch ex {
152152
// Return error in standardized format
153153
Set error = {
154-
"success": (false),
154+
"success": false,
155155
"result": null,
156156
"error": (ex.DisplayString()),
157157
"timestamp": ($ZDateTime($Horolog, 3))
158158
}
159-
Quit error.%ToJSON()
159+
return error.%ToJSON()
160160
}
161161
}
162162

@@ -169,17 +169,17 @@ ClassMethod ValidatePipelineResults(results As %String) As %String [ SqlProc ]
169169
// Use Embedded Python to validate results
170170
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
171171
Set result = bridge."validate_results"(results)
172-
Quit result
172+
return result
173173

174174
} Catch ex {
175175
// Return error in standardized format
176176
Set error = {
177-
"success": (false),
177+
"success": false,
178178
"result": null,
179179
"error": (ex.DisplayString()),
180180
"timestamp": ($ZDateTime($Horolog, 3))
181181
}
182-
Quit error.%ToJSON()
182+
return error.%ToJSON()
183183
}
184184
}
185185

@@ -215,7 +215,7 @@ ClassMethod RunPerformanceTest(pipelineName As %String, iterations As %Integer =
215215
For i=1:1:iterations {
216216
Set runResult = {
217217
"run_number": (i),
218-
"success": (false),
218+
"success": false,
219219
"time_ms": 0,
220220
"error": ""
221221
}
@@ -230,7 +230,7 @@ ClassMethod RunPerformanceTest(pipelineName As %String, iterations As %Integer =
230230

231231
Set result = ##class(%DynamicObject).%FromJSON(resultJson)
232232
If result."success" {
233-
Set runResult."success" = true
233+
Set runResult."success" = 1
234234
Set performanceResults."results"."successful_runs" = performanceResults."results"."successful_runs" + 1
235235

236236
// Update timing statistics
@@ -260,17 +260,17 @@ ClassMethod RunPerformanceTest(pipelineName As %String, iterations As %Integer =
260260
Set performanceResults."results"."average_time_ms" = performanceResults."results"."total_time_ms" / performanceResults."results"."successful_runs"
261261
}
262262

263-
Quit performanceResults.%ToJSON()
263+
return performanceResults.%ToJSON()
264264

265265
} Catch ex {
266266
// Return error in standardized format
267267
Set error = {
268-
"success": (false),
268+
"success": false,
269269
"result": null,
270270
"error": (ex.DisplayString()),
271271
"timestamp": ($ZDateTime($Horolog, 3))
272272
}
273-
Quit error.%ToJSON()
273+
return error.%ToJSON()
274274
}
275275
}
276276

@@ -282,17 +282,17 @@ ClassMethod GetSystemHealth() As %String [ SqlProc ]
282282
// Use Embedded Python to check health
283283
Set bridge = ##class(%SYS.Python).Import("objectscript.python_bridge")
284284
Set result = bridge."health_check"()
285-
Quit result
285+
return result
286286

287287
} Catch ex {
288288
// Return error in standardized format
289289
Set error = {
290-
"success": (false),
290+
"success": false,
291291
"result": null,
292292
"error": (ex.DisplayString()),
293293
"timestamp": ($ZDateTime($Horolog, 3))
294294
}
295-
Quit error.%ToJSON()
295+
return error.%ToJSON()
296296
}
297297
}
298298

0 commit comments

Comments
 (0)