Resolved multiple issues preventing the 'competitor-analysis' app from running and serving its frontend:
1. **Fixed Python SyntaxError in Prompts:** Corrected unterminated string literals and ensure proper multi-line string formatting (using .format() instead of f-strings for complex prompts) in .
2. **Addressed Python SDK Compatibility (google-generativeai==0.3.0):**
* Removed for and by adapting the orchestrator to pass JSON schemas as direct Python dictionaries, as required by the older SDK version.
* Updated with detailed guidance on handling / imports and dictionary-based schema definitions for older SDKs.
3. **Corrected Frontend Build Dependencies:** Moved critical build dependencies (like , , ) from to in .
* Updated to include this pitfall, ensuring frontend build tools are installed in Docker.
4. **Updated Documentation:**
* : Added comprehensive lessons learned regarding dependencies, Python SDK versioning (specifically and imports for ), and robust multi-line prompt handling.
* : Integrated specific details of the encountered errors and their solutions, making the migration report a more complete historical record and guide.
These changes collectively fix the 404 error by ensuring the Python backend starts correctly and serves the frontend assets after a successful build.
120 lines
2.5 KiB
TypeScript
120 lines
2.5 KiB
TypeScript
|
|
|
|
export interface Evidence {
|
|
url: string;
|
|
snippet: string;
|
|
}
|
|
|
|
export interface Product {
|
|
name: string;
|
|
purpose: string;
|
|
evidence: Evidence[];
|
|
}
|
|
|
|
export interface TargetIndustry {
|
|
name: string;
|
|
evidence: Evidence[];
|
|
}
|
|
|
|
export interface Keyword {
|
|
term: string;
|
|
rationale: string;
|
|
}
|
|
|
|
export interface CompetitorCandidate {
|
|
name: string;
|
|
url: string;
|
|
confidence: number;
|
|
why: string;
|
|
evidence: Evidence[];
|
|
}
|
|
|
|
export interface ShortlistedCompetitor {
|
|
name: string;
|
|
url: string;
|
|
}
|
|
|
|
export interface Analysis {
|
|
competitor: {
|
|
name: string;
|
|
url: string;
|
|
};
|
|
portfolio: {
|
|
product: string;
|
|
purpose: string;
|
|
}[];
|
|
target_industries: string[];
|
|
delivery_model: string;
|
|
overlap_score: number;
|
|
differentiators: string[];
|
|
evidence: Evidence[];
|
|
}
|
|
|
|
export interface SilverBullet {
|
|
competitor_name: string;
|
|
statement: string;
|
|
}
|
|
|
|
export interface Conclusion {
|
|
product_matrix: {
|
|
product: string;
|
|
availability: { competitor: string; has_offering: boolean; }[];
|
|
}[];
|
|
industry_matrix: {
|
|
industry: string;
|
|
availability: { competitor: string; has_offering: boolean; }[];
|
|
}[];
|
|
overlap_scores: { competitor: string; score: number }[];
|
|
summary: string;
|
|
opportunities: string;
|
|
next_questions: string[];
|
|
}
|
|
|
|
export interface Battlecard {
|
|
competitor_name: string;
|
|
competitor_profile: {
|
|
focus: string;
|
|
positioning: string;
|
|
};
|
|
strengths_vs_weaknesses: string[];
|
|
landmine_questions: string[];
|
|
silver_bullet: string;
|
|
}
|
|
|
|
export interface ReferenceCustomer {
|
|
name: string;
|
|
industry: string;
|
|
testimonial_snippet: string;
|
|
case_study_url: string;
|
|
}
|
|
|
|
export interface ReferenceAnalysis {
|
|
competitor_name: string;
|
|
references: ReferenceCustomer[];
|
|
}
|
|
|
|
|
|
export interface AppState {
|
|
step: number;
|
|
initial_params: {
|
|
start_url: string;
|
|
max_competitors: number;
|
|
market_scope: string;
|
|
language: 'de' | 'en';
|
|
};
|
|
company: {
|
|
name: string;
|
|
start_url: string;
|
|
};
|
|
products: Product[];
|
|
target_industries: TargetIndustry[];
|
|
keywords: Keyword[];
|
|
competitor_candidates: CompetitorCandidate[];
|
|
competitors_shortlist: ShortlistedCompetitor[];
|
|
analyses: Analysis[];
|
|
silver_bullets: SilverBullet[];
|
|
conclusion: Conclusion | null;
|
|
battlecards: Battlecard[];
|
|
reference_analysis: ReferenceAnalysis[];
|
|
reference_analysis_grounding: any[];
|
|
} |