diff --git a/prompts/00-swot-analysis.txt b/prompts/00-swot-analysis.txt index bff3335..99db6bb 100644 --- a/prompts/00-swot-analysis.txt +++ b/prompts/00-swot-analysis.txt @@ -9,7 +9,11 @@ Based on the following information, please generate a response that outlines the ### Field guidelines -- **strengths** (array of strings): Strengths. -- **weaknesses** (array of strings): Weaknesses. -- **opportunities** (array of strings): Opportunities. -- **threats** (array of strings): Threats. +- **strengths** (array of strings): List the strengths of the product. +- **weaknesses** (array of objects): For each weakness, provide: + - **description** (string): A brief description of the weakness. + - **action** (string): A suggested action to address or mitigate the weakness. +- **opportunities** (array of strings): List the opportunities available. +- **threats** (array of objects): For each threat, provide: + - **description** (string): A brief description of the threat. + - **action** (string): A suggested action to address or mitigate the threat. diff --git a/src/app/ideas/[id]/components/SectionSWOTAnalysis.tsx b/src/app/ideas/[id]/components/SectionSWOTAnalysis.tsx index 9d14762..6a382df 100644 --- a/src/app/ideas/[id]/components/SectionSWOTAnalysis.tsx +++ b/src/app/ideas/[id]/components/SectionSWOTAnalysis.tsx @@ -43,7 +43,7 @@ const SectionSWOTAnalysis: React.FC = ({ {data ? ( -
+

diff --git a/src/idea/adapters/OpenAIService/SWOTAnalysisEvaluator.ts b/src/idea/adapters/OpenAIService/SWOTAnalysisEvaluator.ts index 7bd26e4..326b73f 100644 --- a/src/idea/adapters/OpenAIService/SWOTAnalysisEvaluator.ts +++ b/src/idea/adapters/OpenAIService/SWOTAnalysisEvaluator.ts @@ -26,9 +26,19 @@ interface ValueProposition { const ResponseSchema = z.object({ swot_analysis: z.object({ strengths: z.array(z.string()), - weaknesses: z.array(z.string()), + weaknesses: z.array( + z.object({ + description: z.string(), + action: z.string(), + }) + ), opportunities: z.array(z.string()), - threats: z.array(z.string()), + threats: z.array( + z.object({ + description: z.string(), + action: z.string(), + }) + ), }), }) @@ -146,9 +156,13 @@ And here is my value proposition: return { strengths: swotAnalysis.strengths, - weaknesses: swotAnalysis.weaknesses, + weaknesses: swotAnalysis.weaknesses.map( + (weakness) => `${weakness.description} Action: ${weakness.action}` + ), opportunities: swotAnalysis.opportunities, - threats: swotAnalysis.threats, + threats: swotAnalysis.threats.map( + (threat) => `${threat.description} Action: ${threat.action}` + ), } } catch (e) { Sentry.captureException(e)