#Missing fields in the response - cause errors with strict clients

5 messages · Page 1 of 1 (latest)

warm fog
#

There are 2 missing fields, which OpenAI returns in the response, which are missing from OpenRouter proxy responses:

response.choices.0.index = 0 (1, 2, 3, ... for next choices)
response.choices.0.finish_reason = 'stop' (or any other valid reason)

Because those fields are missing, some clients, which treat OpenAI specification very strictly (namely: openai-php/client) throw error on receiving response from OpenRouter.

This should be a trivial change to make. Is it possible for you guys to correct this?

errant pulsar
#

@warm fog

  1. on index - we're only returning the first one atm (index: 0)
  2. on finish_reason - we do send them down if available. Tho, do you mean we should send down finish_reason: null if there's no data for each diff?
#

Note that we're not supporting n>1 at this time.

#

It seems like it's expecting $result->finishReason; // 'length' or null

#

So a string or null