Max_completion_tokens not working with openai.beta.threads.runs.stream

const stream = openai.beta.threads.runs.stream(
    threadId,
    { assistant_id: assistantId}, {max_completion_tokens: 50},
    eventHandler,
); This doesn't put any constraints on the length of the answer. What could I be doing wrong ?

You could say 4 chars ~ 1 token or 75 words ~ 100 tokens. You may calculate based of that. Also you can lower top_p value to allow only higher probability tokens for the response which will limit the response. Hope this helps - Cheers!

What I meant to say was that I am able to receive a 1000 word answer even after putting the limit of 50 tokens… what am I doing wrong ?