added support for circom errors and modfied also function explain

pull/4809/head
Stéphane Tetsing 6 months ago committed by Aniket
parent b6dd9261bc
commit b8eae1d74f
  1. 10
      apps/circuit-compiler/src/app/components/container.tsx
  2. 4
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx

@ -11,6 +11,7 @@ import { WitnessToggler } from './witnessToggler'
import { WitnessSection } from './witness'
import { CompilerFeedback } from './feedback'
import { CompilerReport, PrimeValue } from '../types'
const _paq = (window._paq = window._paq || [])
export function Container () {
const circuitApp = useContext(CircuitAppContext)
@ -73,7 +74,8 @@ export function Container () {
explain why the error occurred and how to fix it.
`
// @ts-ignore
await circuitApp.plugin.call('openaigpt', 'message', message)
await circuitApp.plugin.call('solcoder', 'error_explaining', message)
_paq.push(['trackEvent', 'ai', 'solcoder', 'error_explaining_circom'])
} else {
const message = `
error message: ${error}
@ -81,7 +83,8 @@ export function Container () {
explain why the error occurred and how to fix it.
`
// @ts-ignore
await circuitApp.plugin.call('openaigpt', 'message', message)
await circuitApp.plugin.call('solcoder', 'error_explaining', message)
_paq.push(['trackEvent', 'ai', 'solcoder', 'error_explaining_circom'])
}
} else {
const error = report.message
@ -91,7 +94,8 @@ export function Container () {
explain why the error occurred and how to fix it.
`
// @ts-ignore
await circuitApp.plugin.call('openaigpt', 'message', message)
await circuitApp.plugin.call('solcoder', 'error_explaining', message)
_paq.push(['trackEvent', 'ai', 'solcoder', 'error_explaining_circom'])
}
}

@ -739,8 +739,8 @@ export const EditorUI = (props: EditorUIProps) => {
const file = await props.plugin.call('fileManager', 'getCurrentFile')
const content = await props.plugin.call('fileManager', 'readFile', file)
const message = intl.formatMessage({ id: 'editor.explainFunctionByAI' }, { content, currentFunction: currentFunction.current })
await props.plugin.call('openaigpt', 'message', message)
_paq.push(['trackEvent', 'ai', 'openai', 'explainFunction'])
await props.plugin.call('solcoder', 'code_explaining', message, content)
_paq.push(['trackEvent', 'ai', 'solcoder', 'explainFunction'])
},
}

Loading…
Cancel
Save