Skip to content

feat(api): update gpt-4o usage to gpt-4.1#2536

Merged
nickscamara merged 1 commit intomainfrom
tom/gpt-4.1
Dec 10, 2025
Merged

feat(api): update gpt-4o usage to gpt-4.1#2536
nickscamara merged 1 commit intomainfrom
tom/gpt-4.1

Conversation

@amplitudesxd
Copy link
Copy Markdown
Member

@amplitudesxd amplitudesxd commented Dec 10, 2025

Summary by cubic

Switch model usage from gpt-4o to gpt-4.1 across extraction and URL processing. Primary calls still use gpt-4o-mini; gpt-4.1 is now the retry/fallback.

  • Refactors
    • Updated analyzeSchemaAndPrompt (including fire-0) and generateBasicCompletion to use gpt-4.1.
    • Set gpt-4.1 as the retry model in batchExtract, singleAnswer, extractSmartScrape, and llmExtract.

Written for commit 1214cab. Summary will update automatically on new commits.

@amplitudesxd amplitudesxd marked this pull request as ready for review December 10, 2025 21:35
@nickscamara nickscamara merged commit c5e2419 into main Dec 10, 2025
8 checks passed
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/api/src/lib/extract/url-processor.ts">

<violation number="1" location="apps/api/src/lib/extract/url-processor.ts:21">
P2: Model changed to `gpt-4.1` but cost tracking still references `openai/gpt-4o`. The `costTracking.addCall` call (lines 44-58) should use `openai/gpt-4.1` for both the `model` field and `calculateCost` to ensure accurate cost tracking and analytics.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

try {
const result = await generateText({
model: getModel("gpt-4o", "openai"),
model: getModel("gpt-4.1", "openai"),
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Model changed to gpt-4.1 but cost tracking still references openai/gpt-4o. The costTracking.addCall call (lines 44-58) should use openai/gpt-4.1 for both the model field and calculateCost to ensure accurate cost tracking and analytics.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/src/lib/extract/url-processor.ts, line 21:

<comment>Model changed to `gpt-4.1` but cost tracking still references `openai/gpt-4o`. The `costTracking.addCall` call (lines 44-58) should use `openai/gpt-4.1` for both the `model` field and `calculateCost` to ensure accurate cost tracking and analytics.</comment>

<file context>
@@ -18,7 +18,7 @@ export async function generateBasicCompletion(
   try {
     const result = await generateText({
-      model: getModel(&quot;gpt-4o&quot;, &quot;openai&quot;),
+      model: getModel(&quot;gpt-4.1&quot;, &quot;openai&quot;),
       prompt: prompt,
       providerOptions: {
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants