A sampling knob that keeps only the most likely next tokens.
A sampling setting that limits next-token choices to likely candidates whose combined probability reaches a specified threshold.
💡 Asking a restaurant to choose from the most popular dishes rather than the entire menu.
const res = await openai.chat.completions.create({
model: "gpt-4o",
top_p: 0.9, // only sample the most likely tokens
messages: [{ role: "user", content: "Write a tagline" }],
});It provides another way to control response generation and output diversity.
with tapaScript
By clicking Sign Up you re confirming that you agree with our Terms and Conditions.
