| 209 | recommended_generate?: boolean | undefined |
| 210 | ) |
| 211 | constructor( |
| 212 | param1?: number | Chat, |
| 213 | create_time?: Date | string, |
| 214 | create_by?: number, |
| 215 | brief?: string, |
| 216 | chat_type?: string, |
| 217 | datasource?: number, |
| 218 | engine_type?: string, |
| 219 | ds_type?: string, |
| 220 | datasource_name?: string, |
| 221 | datasource_exists: boolean = true, |
| 222 | records: Array<ChatRecord> = [], |
| 223 | recommended_question?: string | undefined, |
| 224 | recommended_generate?: boolean | undefined |
| 225 | ) { |
| 226 | super() |
| 227 | if (param1 !== undefined) { |
| 228 | if (param1 instanceof Chat) { |
| 229 | this.id = param1.id |
| 230 | this.create_time = getDate(param1.create_time) |
| 231 | this.create_by = param1.create_by |
| 232 | this.brief = param1.brief |
| 233 | this.chat_type = param1.chat_type |
| 234 | this.datasource = param1.datasource |
| 235 | this.engine_type = param1.engine_type |
| 236 | this.ds_type = param1.ds_type |
| 237 | this.recommended_question = recommended_question |
| 238 | this.recommended_generate = recommended_generate |
| 239 | } else { |
| 240 | this.id = param1 |
| 241 | this.create_time = getDate(create_time) |
| 242 | this.create_by = create_by |
| 243 | this.brief = brief |
| 244 | this.chat_type = chat_type |
| 245 | this.datasource = datasource |
| 246 | this.engine_type = engine_type |
| 247 | this.ds_type = ds_type |
| 248 | this.recommended_question = recommended_question |
| 249 | this.recommended_generate = recommended_generate |
| 250 | } |
| 251 | } |
| 252 | this.datasource_name = datasource_name |
| 253 | this.datasource_exists = datasource_exists |
| 254 | this.records = records |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | const toChatRecord = (data?: any): ChatRecord | undefined => { |