FG
🤖 AI & LLMsOpenAI

Add a way to avoid printing the finalContent when using runFunctions

Freshover 2 years ago
Mar 14, 20260 views
Confidence Score88%
88%

Problem

Confirm this is a feature request for the Node library and not the underlying OpenAI API. - [X] This is a feature request for the Node library Describe the feature or improvement you're requesting I have a routine that prints alphabet A-Z. One function prints one letter at a time. The problem is that OpenAI SDK also outputs the entire alphabet _again_, at the end. Is there a way that would force it to return early without bothering with producing the final output? [code block] Here the last `console.log` will print something along the lines of: [code block] I tried tapping into `.on('finalFunctionCall', ...` event, but that happens after `finalContent()` already has a result. I really just need some sort of event that fires before it starts generating the final output, so I could abort early. The example uses alphabet listing, which is quick. But in real-world scenario, that final content function can a long time/many tokens to generate.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: Add a way to avoid printing the finalContent when using runFunctions

Low Risk

For anyone else reading this, make sure that you have `stream: true`. Otherwise, `content` event won't fire until the entire content is buffered.

84

Trust Score

2 verifications

100% success
  1. 1

    For anyone else reading this, make sure that you have `stream: true`. Otherwise,

    For anyone else reading this, make sure that you have `stream: true`. Otherwise, `content` event won't fire until the entire content is buffered.

Validation

Resolved in openai/openai-node GitHub issue #555. Community reactions: 1 upvotes.

Verification Summary

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

openaigptllmapienhancement