Skip to content

Commit 24c96ab

Browse files
committed
Explictly matching type text instead of shorthand usage
1 parent 1b533a3 commit 24c96ab

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

server/routes/chat/DEagent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ async function validate_DE_response(response: string, ds: any, db_rows: DbRows[]
164164
text,
165165
'For now, the maximum number of filter terms supported through the chatbot is ' + num_filter_cutoff // Remove duplicated statements in error message
166166
)
167-
return { type: 'text', text }
167+
return { type: 'text', text: text }
168168
} else {
169169
const pp_plot_json: any = { childType: 'volcano', termType: 'geneExpression', chartType: 'differentialAnalysis' }
170170
const groups = [group1, group2]

server/routes/chat/matrixagent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function validate_matrix_response(response: string, common_genes: string[], data
133133
}
134134

135135
if (text.length > 0) {
136-
return { type: 'text', text }
136+
return { type: 'text', text: text }
137137
} else {
138138
// Structure as termgroups matching what matrix.js expects:
139139
// termgroups: [{ name: '', lst: [ { term: {...} }, ... ] }]

server/routes/chat/samplescatteragent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function validate_samplescatter_response(response: string, common_genes: string[
159159
}
160160

161161
if (text.length > 0) {
162-
return { type: 'text', text }
162+
return { type: 'text', text: text }
163163
} else {
164164
return { type: 'plot', plot: pp_plot_json }
165165
}

server/routes/chat/summaryagent.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ function validate_summary_response(response: string, common_genes: string[], dat
127127
if (response_type.text) text = response_type.text
128128
if (!response_type.term) {
129129
text += 'term type is not present in summary output'
130-
return { type: 'text', text }
130+
return { type: 'text', text: text }
131131
}
132132
const term1_validation = validate_term(response_type.term, common_genes, dataset_json, ds)
133133
if (term1_validation.text.length > 0) {
134134
text += term1_validation.text
135-
return { type: 'text', text }
135+
return { type: 'text', text: text }
136136
} else {
137137
pp_plot_json.term = term1_validation.term_type
138138
if (term1_validation.category == 'float' || term1_validation.category == 'integer') {
@@ -145,7 +145,7 @@ function validate_summary_response(response: string, common_genes: string[], dat
145145
const term2_validation = validate_term(response_type.term2, common_genes, dataset_json, ds)
146146
if (term2_validation.text.length > 0) {
147147
text += term2_validation.text
148-
return { type: 'text', text }
148+
return { type: 'text', text: text }
149149
} else {
150150
pp_plot_json.term2 = term2_validation.term_type
151151
if (term2_validation.category == 'float' || term2_validation.category == 'integer') {
@@ -165,7 +165,7 @@ function validate_summary_response(response: string, common_genes: string[], dat
165165

166166
if (resolved.error) {
167167
text += resolved.error
168-
return { type: 'text', text }
168+
return { type: 'text', text: text }
169169
} else {
170170
pp_plot_json.childType = resolved.childType
171171
// For two numeric variables displayed as violin/boxplot, discretize term2
@@ -187,7 +187,7 @@ function validate_summary_response(response: string, common_genes: string[], dat
187187
const validated_filters = validate_filter(response_type.simpleFilter, ds, '')
188188
if (validated_filters.text.length > 0) {
189189
text += validated_filters.text
190-
return { type: 'text', text }
190+
return { type: 'text', text: text }
191191
} else {
192192
pp_plot_json.filter = validated_filters.simplefilter
193193
}

0 commit comments

Comments
 (0)