Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

Fix streamObject deprecation

Khuram Niaz2e1a6573604a
diff --git a/src/app/api/ai/resume/match/route.ts b/src/app/api/ai/resume/match/route.ts
index a9e2da3..b0836b8 100644
--- a/src/app/api/ai/resume/match/route.ts
+++ b/src/app/api/ai/resume/match/route.ts
@@ -2,7 +2,7 @@ import "server-only";
import { auth } from "@/auth";
import { NextRequest, NextResponse } from "next/server";
-import { streamObject } from "ai";
+import { streamText, Output } from "ai";
import { getModel } from "@/lib/ai/providers";
import { checkRateLimit } from "@/lib/ai/rate-limiter";
import {
@@ -102,9 +102,11 @@ Use these results in your scoring decisions.`;
selectedModel.model || "llama3.2"
);
- const result = streamObject({
+ const result = streamText({
model,
- schema: JobMatchSchema,
+ output: Output.object({
+ schema: JobMatchSchema,
+ }),
system: JOB_MATCH_SYSTEM_PROMPT,
prompt: fullPrompt,
temperature: 0.3,
@@ -115,10 +117,7 @@ Use these results in your scoring decisions.`;
console.error("Job match error:", error);
if (error instanceof AIUnavailableError) {
- return NextResponse.json(
- { error: error.message },
- { status: 503 }
- );
+ return NextResponse.json({ error: error.message }, { status: 503 });
}
const message =
diff --git a/src/app/api/ai/resume/review/route.ts b/src/app/api/ai/resume/review/route.ts
index 601b7fb..d124e5c 100644
--- a/src/app/api/ai/resume/review/route.ts
+++ b/src/app/api/ai/resume/review/route.ts
@@ -2,7 +2,7 @@ import "server-only";
import { auth } from "@/auth";
import { NextRequest, NextResponse } from "next/server";
-import { streamObject } from "ai";
+import { streamText, Output } from "ai";
import { getModel } from "@/lib/ai/providers";
import { checkRateLimit } from "@/lib/ai/rate-limiter";
import {
@@ -97,7 +97,9 @@ TOOL ANALYSIS RESULTS (use these in your evaluation):
- Technical keywords found: ${keywordCount} (${
allKeywords.slice(0, 10).join(", ") || "none"
})
-- Action verbs found: ${verbCount} (${allVerbs.slice(0, 10).join(", ") || "none"})
+- Action verbs found: ${verbCount} (${
+ allVerbs.slice(0, 10).join(", ") || "none"
+ })
- Formatting quality: ${
formatting.hasBulletPoints ? "Has bullet points" : "No bullets"
}, ${formatting.sectionCount} sections detected
@@ -109,9 +111,11 @@ Use these concrete counts in your Step 1 (SCAN & COUNT) and scoring decisions.`;
selectedModel.model || "llama3.2"
);
- const result = streamObject({
+ const result = streamText({
model,
- schema: ResumeReviewSchema,
+ output: Output.object({
+ schema: ResumeReviewSchema,
+ }),
system: RESUME_REVIEW_SYSTEM_PROMPT,
prompt: fullPrompt,
temperature: 0.3,
@@ -122,10 +126,7 @@ Use these concrete counts in your Step 1 (SCAN & COUNT) and scoring decisions.`;
console.error("Resume review error:", error);
if (error instanceof AIUnavailableError) {
- return NextResponse.json(
- { error: error.message },
- { status: 503 }
- );
+ return NextResponse.json({ error: error.message }, { status: 503 });
}
const message =
diff --git a/src/components/profile/AiJobMatchSection.tsx b/src/components/profile/AiJobMatchSection.tsx
index 6ae350f..8e8cca7 100644
--- a/src/components/profile/AiJobMatchSection.tsx
+++ b/src/components/profile/AiJobMatchSection.tsx
@@ -225,18 +225,14 @@ export const AiJobMatchSection = ({
<Info className="h-4 w-4 text-muted-foreground" />
</TooltipTrigger>
<TooltipContent className="max-w-xs">
- <p className="font-semibold mb-1">
- Phase 3: Multi-Agent System
- </p>
+ <p className="font-semibold mb-1">Multi-Agent System</p>
<p className="text-xs mb-2">
- Uses 5 specialized AI agents working together:
+ Uses 3 specialized AI agents working together:
</p>
<ul className="text-xs space-y-1">
- <li>• Data Analyzer (extracts metrics)</li>
- <li>• Keyword Expert (ATS optimization)</li>
- <li>• Scoring Specialist (fair scoring)</li>
+ <li>• Tool Extraction (extracts metrics)</li>
+ <li>• Data Analyzer (combines insights)</li>
<li>• Feedback Expert (actionable advice)</li>
- <li>• Synthesis Coordinator (combines insights)</li>
</ul>
<p className="text-xs mt-2 text-yellow-500">
⚠️ Slower but significantly more accurate