How to limit 2 responses to 50 tokens each?

Hi there,

I’m trying to limit the output to 100 tokens (2 responses, 50 tokens each). Token limit of 100 works fine, but it doesn’t split the limit equally between multiple responses.

Any idea on how I can accomplish this?

1 Like

Hello,

One way you could do this would be to leverage the “n” parameter via an API request, where n=2, and use a limit of 50 tokens. This would generate two completions with a maximum token value of 50.

4 Likes

@Adam-OpenAI - I already have this in place (unless I missed something).

n=2
max_tokens=100

But that just limits both outputs to 100 tokens in total, so one can be 70 and the other one 30. I need to split that 50/50.

2 Likes

What a dummy mistake I made :slight_smile: I thought max_tokens includes both outputs and was frustrated I couldn’t make it to work. Never thought I could just try 50 instead :slight_smile:
Thanks!

3 Likes