diff --git a/components/MarketResearcher.tsx b/components/MarketResearcher.tsx index a08d8b4..058e39c 100644 --- a/components/MarketResearcher.tsx +++ b/components/MarketResearcher.tsx @@ -10,7 +10,7 @@ import { Badge } from "@/components/ui/badge"; import useStore from "@/lib/store"; import { translations } from "@/lib/i18n/translations"; import modelAdapter from "@/lib/services/adapter-instance"; -import { Search, Globe, Plus, Trash2, ShieldAlert, BarChart3, TrendingUp, Target, Rocket, Lightbulb, CheckCircle2, AlertCircle, Loader2, X } from "lucide-react"; +import { Search, Globe, Plus, Trash2, ShieldAlert, BarChart3, TrendingUp, Target, Rocket, Lightbulb, CheckCircle2, AlertCircle, Loader2, X, ExternalLink } from "lucide-react"; import { cn } from "@/lib/utils"; const MarketResearcher = () => { @@ -170,8 +170,21 @@ const MarketResearcher = () => { {marketResearchResult.competitors.map((comp) => { const compPrice = item.competitorPrices.find(cp => cp.competitor === comp || comp.includes(cp.competitor)); return ( - - {compPrice ? compPrice.price : "N/A"} + +
+ {compPrice ? compPrice.price : "N/A"} + {compPrice?.url && ( + + + View Product + + )} +
); })} diff --git a/lib/services/ollama-cloud.ts b/lib/services/ollama-cloud.ts index a84b858..c51a22d 100644 --- a/lib/services/ollama-cloud.ts +++ b/lib/services/ollama-cloud.ts @@ -632,7 +632,7 @@ OUTPUT FORMAT - Return ONLY valid JSON with this structure: "product": "Product Name", "userPrice": "$XX.XX", "competitorPrices": [ - { "competitor": "Competitor Name", "price": "$XX.XX" } + { "competitor": "Competitor Name", "price": "$XX.XX", "url": "https://competitor.com/product-page" } ] } ], diff --git a/lib/services/qwen-oauth.ts b/lib/services/qwen-oauth.ts index a96e37a..3adb99b 100644 --- a/lib/services/qwen-oauth.ts +++ b/lib/services/qwen-oauth.ts @@ -954,7 +954,7 @@ OUTPUT FORMAT - JSON: { "executiveSummary": "findings", "priceComparisonMatrix": [ - { "product": "P", "userPrice": "$", "competitorPrices": [{ "competitor": "C", "price": "$" }] } + { "product": "P", "userPrice": "$", "competitorPrices": [{ "competitor": "C", "price": "$", "url": "link" }] } ], "featureComparisonTable": [ { "feature": "F", "userStatus": "status", "competitorStatus": [{ "competitor": "C", "status": "status" }] } diff --git a/lib/services/zai-plan.ts b/lib/services/zai-plan.ts index 2abeccb..9b0b7e7 100644 --- a/lib/services/zai-plan.ts +++ b/lib/services/zai-plan.ts @@ -713,7 +713,7 @@ OUTPUT FORMAT - Return ONLY valid JSON with this structure: "product": "Product Name", "userPrice": "$XX.XX", "competitorPrices": [ - { "competitor": "Competitor Name", "price": "$XX.XX" } + { "competitor": "Competitor Name", "price": "$XX.XX", "url": "https://competitor.com/product-page" } ] } ], diff --git a/types/index.ts b/types/index.ts index c742f17..59abab3 100644 --- a/types/index.ts +++ b/types/index.ts @@ -272,7 +272,7 @@ export interface MarketResearchResult { priceComparisonMatrix: { product: string; userPrice: string; - competitorPrices: { competitor: string; price: string }[]; + competitorPrices: { competitor: string; price: string; url?: string }[]; }[]; featureComparisonTable: { feature: string;