Update ket qua AI
This commit is contained in:
parent
0a9c22268d
commit
9e187d8e89
|
|
@ -616,7 +616,10 @@ export default class LineConnection {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (script?.send_result || script?.sendResult) {
|
if (script?.send_result || script?.sendResult) {
|
||||||
const detectLog = await this.detectLogWithAI(this.outputALLScenario)
|
let detectLog = await this.detectLogWithAI(this.outputALLScenario)
|
||||||
|
if (typeof detectLog === 'string' && detectLog?.includes('[')) {
|
||||||
|
detectLog = [...detectLog.matchAll(/"((?:\\.|[^"\\])*)"/g)].map(m => m[1])
|
||||||
|
}
|
||||||
const result = mapToLineFormat({
|
const result = mapToLineFormat({
|
||||||
lineNumber: this.config.lineNumber,
|
lineNumber: this.config.lineNumber,
|
||||||
inventory: this.config.inventory,
|
inventory: this.config.inventory,
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ type InputData = {
|
||||||
lineNumber: number
|
lineNumber: number
|
||||||
inventory: any
|
inventory: any
|
||||||
latestScenario?: {
|
latestScenario?: {
|
||||||
detectAI?: DetectAI
|
detectAI?: string | string[]
|
||||||
}
|
}
|
||||||
data?: any[]
|
data?: any[]
|
||||||
}
|
}
|
||||||
|
|
@ -223,9 +223,10 @@ export function mapToLineFormat(input: InputData) {
|
||||||
// // Mode (DPEL / DPELP)
|
// // Mode (DPEL / DPELP)
|
||||||
// const dataPlatform = input.data?.find((el) => el.command?.trim() === 'show platform')
|
// const dataPlatform = input.data?.find((el) => el.command?.trim() === 'show platform')
|
||||||
// const mode = dataPlatform && !dataPlatform.output?.includes('Incomplete') ? 'DPELP' : 'DPEL'
|
// const mode = dataPlatform && !dataPlatform.output?.includes('Incomplete') ? 'DPELP' : 'DPEL'
|
||||||
|
const detectAI: string | string[] | undefined = input.latestScenario?.detectAI
|
||||||
// Issues
|
// Issues
|
||||||
const issues = Array.isArray(input.latestScenario?.detectAI) ? input.latestScenario?.detectAI : []
|
const issues = Array.isArray(detectAI) ? detectAI : typeof detectAI === 'string' && detectAI?.includes('[') ? [...detectAI.matchAll(/"((?:\\.|[^"\\])*)"/g)]
|
||||||
|
.map(m => m[1]) : []
|
||||||
|
|
||||||
// Issues
|
// Issues
|
||||||
const summary = ''
|
const summary = ''
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
"extends": "@adonisjs/tsconfig/tsconfig.app.json",
|
"extends": "@adonisjs/tsconfig/tsconfig.app.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./",
|
"rootDir": "./",
|
||||||
"outDir": "./build"
|
"outDir": "./build",
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue