diff --git a/apps/circuit-compiler/src/app/components/container.tsx b/apps/circuit-compiler/src/app/components/container.tsx index 51cc280594..0b67e6b153 100644 --- a/apps/circuit-compiler/src/app/components/container.tsx +++ b/apps/circuit-compiler/src/app/components/container.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']) } } diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index a0ed7626aa..b29586115e 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -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']) }, }