MCPcopy Create free account
hub / github.com/TaskingAI/TaskingAI / handleClickDebug

Function handleClickDebug

frontend/src/components/playground/index.tsx:1283–1316  ·  view source on GitHub ↗
(item: any)

Source from the content-addressed store, hash-verified

1281 getBundleList({ limit: 20 })
1282 }
1283 const handleClickDebug = (item: any) => {
1284 const inputResult: any = debugArray1.length ? debugArray1 : JSON.parse(localStorage.getItem('inputResult') as any)
1285 const outputResult: any = debugArray2.length ? debugArray2 : JSON.parse(localStorage.getItem('outputResult') as any)
1286 if (item.event === 'Error Occurred') {
1287 setContentErrorDrawer(true)
1288 } else {
1289 delete item.color
1290 const event1 = item.event.split('_').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
1291 const event2 = item.event_step?.charAt(0).toUpperCase() + item.event_step?.slice(1)
1292 setCollapseLabel2(`${event1}: ${event2}`)
1293 if (!item.event_id) return
1294
1295 const data1 = inputResult?.find((item1: any) => (item1.event_id === item.event_id))
1296 const data2: any = outputResult?.find((item1: any) => (item1.event_id === item.event_id))
1297 if (data1) {
1298 delete data1.color
1299 const data3 = JSON.stringify(data1, null, 4)
1300 setChatCompletionCall(data3)
1301 const label = data1.event_step?.charAt(0).toUpperCase() + data1.event_step?.slice(1)
1302 const label1 = data1.event.split('_').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
1303 setCollapseLabel1(`${label1}: ${label}`)
1304 } else if (data2) {
1305 delete data2.color
1306 const data4 = JSON.stringify(data2, null, 4)
1307 const label = data2.event_step?.charAt(0).toUpperCase() + data2.event_step?.slice(1)
1308 const label1 = data2.event.split('_').map((word: string) => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
1309 setCollapseLabel1(`${label1}: ${label}`)
1310 setChatCompletionCall(data4)
1311 }
1312 setChatCompletionResult(JSON.stringify(item, null, 4))
1313 setContentDrawer(true)
1314
1315 }
1316 }
1317 const handleCloseContentDrawer = () => {
1318 setContentDrawer(false)
1319 }

Callers 1

PlaygroundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected