Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
Revert "feat(agent): default to spark-2 (#4360)"
Rakshith Ramprakash978195f09b26
diff --git a/README.md b/README.mdindex da7ee60a7..764cd5503 100644--- a/README.md+++ b/README.md@@ -384,12 +384,11 @@ result = app.agent(#### Model Selection-Choose a model based on your needs:+Choose between two models based on your needs:| Model | Cost | Best For ||-------|------|----------|-| `spark-2` (default) | See [pricing](https://docs.firecrawl.dev/features/agent) | Most tasks |-| `spark-1-mini` | 60% cheaper than `spark-1-pro` | Cost-sensitive tasks |+| `spark-1-mini` (default) | 60% cheaper | Most tasks || `spark-1-pro` | Standard | Complex research, critical data gathering |```pythonresult = app.agent(diff --git a/apps/api/src/controllers/v2/agent-schema.test.ts b/apps/api/src/controllers/v2/agent-schema.test.tsdeleted file mode 100644index 130800956..000000000--- a/apps/api/src/controllers/v2/agent-schema.test.ts+++ /dev/null@@ -1,28 +0,0 @@-import { describe, expect, it } from "vitest";-import { agentRequestSchema } from "./types";--describe("agentRequestSchema model", () => {- it("defaults to spark-2 when no model is given", () => {- expect(- agentRequestSchema.parse({ prompt: "Find the pricing page" }).model,- ).toBe("spark-2");- });-- it("keeps an explicitly requested model", () => {- for (const model of ["spark-1-pro", "spark-1-mini", "spark-2"] as const) {- expect(- agentRequestSchema.parse({ prompt: "Find the pricing page", model })- .model,- ).toBe(model);- }- });-- it("rejects an unknown model", () => {- expect(() =>- agentRequestSchema.parse({- prompt: "Find the pricing page",- model: "spark-3",- }),- ).toThrow();- });-});diff --git a/apps/api/src/controllers/v2/agent-status.ts b/apps/api/src/controllers/v2/agent-status.tsindex f73bff2cb..dc82300b2 100644--- a/apps/api/src/controllers/v2/agent-status.ts+++ b/apps/api/src/controllers/v2/agent-status.ts@@ -25,9 +25,6 @@ export async function agentStatusController(const agent = await supabaseGetAgentByIdDirect(req.params.jobId);- // Jobs whose stored options carry no model predate the model option and ran- // on spark-1-pro, so the fallback here stays spark-1-pro even though the- // agent request schema now defaults new jobs to spark-2.let model: "spark-1-pro" | "spark-1-mini" | "spark-2";if (agent) {model = (agent.options?.model ?? "spark-1-pro") as@@ -55,7 +52,7 @@ export async function agentStatusController(module: "api/v2",text: await optionsRequest.text(),});- model = "spark-1-pro"; // fall back to the pre-model-option default+ model = "spark-1-pro"; // fall back to this value} else {model = ((await optionsRequest.json()).model ?? "spark-1-pro") as| "spark-1-pro"@@ -69,7 +66,7 @@ export async function agentStatusController(module: "api/v2",extractId: req.params.jobId,});- model = "spark-1-pro"; // fall back to the pre-model-option default+ model = "spark-1-pro"; // fall back to this value}}diff --git a/apps/api/src/controllers/v2/types.ts b/apps/api/src/controllers/v2/types.tsindex 89e9e78a7..2dd98a199 100644--- a/apps/api/src/controllers/v2/types.ts+++ b/apps/api/src/controllers/v2/types.ts@@ -1005,7 +1005,9 @@ export const agentRequestSchema = z.strictObject({webhook: agentWebhookSchema.optional(),overrideWhitelist: z.string().optional(),- model: z.enum(["spark-1-pro", "spark-1-mini", "spark-2"]).default("spark-2"),+ model: z+ .enum(["spark-1-pro", "spark-1-mini", "spark-2"])+ .default("spark-1-pro"),threatProtection: threatProtectionOverrideSchema.optional(),auditMetadata: auditMetadataSchema.optional(),});