Skip to content

Commit

Permalink
feat: advanced implementation steps. looks overkill. we need to simpl…
Browse files Browse the repository at this point in the history
…ify this.
  • Loading branch information
shakee93 committed Jan 20, 2025
1 parent 10023f8 commit 50fa3e4
Show file tree
Hide file tree
Showing 5 changed files with 387 additions and 181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,27 @@ const DiagnosticSchema = z.object({
z.object({
issue: z.string(),
description: z.string(),
howToFix: z.array(z.object({
step: z.string(),
description: z.string(),
type: z.enum(['rapidload_fix', 'wordpress_fix', 'theme_fix', 'another_plugin_fix', 'code_fix', 'server_config_fix', 'server_upgrade_fix', 'other']),
substeps: z.array(z.object({
step: z.string(),
description: z.string(),
})).optional().describe('Substeps to fix the issue.'),
rapidload_setting_input: z.object({
name: z.string(),
value: z.string().nullable(),
original_current_value: z.string().nullable(),
}).optional(),
})),
how_to_fix_reasoning_memory: z.string(),
how_to_fix_questions: z.array(z.object({
question: z.string(),
explanation: z.string(),
type: z.enum(['single_choice', 'multiple_choice', 'text', 'number']),
options: z.array(z.object({
value: z.string(),
label: z.string(),
solutions: z.object({
solutions_reasoning: z.array(z.object({
block_type: z.enum(['observation', 'analysis', 'hypothesis', 'validation', 'conclusion']),
thought: z.string(),
reasoning: z.string(),
confidence_level: z.number().min(0).max(100),
supporting_evidence: z.array(z.string()),
related_blocks: z.array(z.string()).optional(),
})),
solutions_list: z.array(z.object({
type: z.enum(['rapidload_fix', 'wordpress_fix', 'theme_fix', 'another_plugin_fix', 'code_fix', 'server_config_fix', 'server_upgrade_fix']),
title: z.string(),
description: z.string(),
steps: z.array(z.object({
step: z.number(),
action: z.string(),
details: z.string(),
verification: z.string().optional()
})),
})),
})),
}),
resources: z.array(z.object({
name: z.string(),
url: z.string(),
Expand Down Expand Up @@ -99,6 +95,8 @@ const Optimizations = ({ }) => {
const { headerUrl, diagnosticLoading } = useCommonDispatch();
const [remainingTime, setRemainingTime] = useState(0);
const [serverDetails, setServerDetails] = useState(null);
const [input, setInput] = useState(null);

useEffect(() => {
console.log('diagnosticLoading', diagnosticLoading)
}, [diagnosticLoading])
Expand Down Expand Up @@ -230,7 +228,7 @@ const Optimizations = ({ }) => {

try {

console.log(input)
setInput(input)
submit(input)
setDiagnosticsProgress(95);

Expand Down Expand Up @@ -612,8 +610,8 @@ const Optimizations = ({ }) => {
</button>
</div>
<iframe
// src={showIframe ? `${optimizerUrl}/?rapidload_preview` : ''}
src={showIframe ? 'http://rapidload.local/?rapidload_preview' : ''}
src={showIframe ? `${optimizerUrl}/?rapidload_preview` : ''}
// src={showIframe ? 'http://rapidload.local/?rapidload_preview' : ''}
className="w-full h-[600px] border-0"
title="Optimization Test"
/>
Expand All @@ -622,7 +620,13 @@ const Optimizations = ({ }) => {
)}
</div>

{diagnosticResults?.AnalysisSummary?.length && <AnalysisResults object={diagnosticResults} relatedAudits={relatedAudits} />}
{diagnosticResults?.AnalysisSummary?.length &&
<AnalysisResults
object={diagnosticResults}
relatedAudits={relatedAudits}
input={input}
/>
}
</m.div>
</AnimatePresence>
)
Expand Down
Loading

0 comments on commit 50fa3e4

Please sign in to comment.