Skip to content

Commit

Permalink
made the company summary card mobile optmised + update prompt to fix …
Browse files Browse the repository at this point in the history
…the repeat emoji issue + updated sonnet model
  • Loading branch information
theishangoswami committed Jan 7, 2025
1 parent 8e00851 commit fee59d0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/api/companymap/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function POST(req: NextRequest) {
});

const { object } = await generateObject({
model: anthropic('claude-3-5-sonnet-latest'),
model: anthropic('claude-3-5-sonnet-20241022'),
schema: mindMapSchema,
output: 'object',
system: "Create clear, concise mind maps that help users quickly understand companies. Use simple English and focus on the most important aspects.",
Expand Down
10 changes: 6 additions & 4 deletions app/api/companysummary/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export async function POST(req: NextRequest) {
});

const { object } = await generateObject({
model: anthropic('claude-3-5-sonnet-latest'),
model: anthropic('claude-3-5-sonnet-20241022'),
schema: summarySchema,
output: 'object',
system: "All the output content should be in simple english. Don't use any difficult words. Keep sentences short and simple.",
system: "All the output content should be in simple english. Don't use any difficult words. Keep sentences short and simple. Use unique emojis for each heading.",
prompt: `You are an expert at writing important points about a company.
Here are the content from a company's website so you can understand about the company in detail.
Expand All @@ -49,9 +49,11 @@ export async function POST(req: NextRequest) {
The text/description should be short, simple and easy to understand.
All the output content should be in simple english. Don't use any difficult words.
All the output content should be in simple english.
Use unique emojis for each heading.
Output the result as valid JSON.`
Output the result as JSON.`
});

// Return the sections array from the response
Expand Down
20 changes: 10 additions & 10 deletions components/companycontent/CompanySummar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ interface CompanySummaryProps {

const CompanySummary: React.FC<CompanySummaryProps> = ({ summary }) => {
return (
<div className="w-full space-y-6">
<div className="w-full space-y-4">

<div className="bg-white border shadow-sm p-8 mt-2">
<div className="space-y-8">
<div className="bg-white border shadow-sm p-4 sm:p-8 mt-2">
<div className="space-y-6">
{summary.map((item, index) => (
<div key={index} className="space-y-3">
<div className="flex items-start gap-3">
<span className="text-2xl flex-shrink-0">{item.heading.split(' ')[0]}</span>
<div className="space-y-3 pt-1 w-full">
<p className="font-semibold text-lg">
<div key={index} className="space-y-2">
<div className="flex items-start gap-2 sm:gap-3">
<span className="text-xl sm:text-2xl flex-shrink-0">{item.heading.split(' ')[0]}</span>
<div className="space-y-2 sm:space-y-3 pt-1 w-full">
<p className="font-semibold text-base sm:text-lg">
{item.heading.split(' ').slice(1).join(' ')}
</p>
<p className="text-gray-700 leading-relaxed">
<p className="text-gray-700 leading-relaxed text-sm sm:text-base">
{item.text}
</p>
</div>
</div>

{index < summary.length - 1 && (
<div className="pt-6">
<div className="pt-4 sm:pt-6">
<div className="border-t border-gray-100"></div>
</div>
)}
Expand Down

0 comments on commit fee59d0

Please sign in to comment.