#tool call value is invalid type in streaming

5 messages · Page 1 of 1 (latest)

sudden wyvern
#

To my understanding, our company is using the OpenAI interface to utilize the OpenAI SDK.

However, in a streaming scenario, we are receiving values that do not conform to the specification.
When a tool_call ends, the delta value should be empty—like this:

[
  {
    "index": 0,
    "delta": {},
    "logprobs": null,
    "finish_reason": "tool_calls"
  }
]

However, in our current streaming response, the delta value contains an empty string, like this:

[
  {
    "index": 0,
    "delta": {
      "role": "assistant",
      "content": ""
    },
    "finish_reason": "tool_calls",
    "native_finish_reason": "tool_calls",
    "logprobs": null
  }
]

This is the difference between OpenAI and OpenRouter.

sudden wyvern
#

any reaction?

vernal musk
#

@sudden wyvern we are sorry about the inconsistency. However is the empty content causing any issues?

sudden wyvern
#

Most of the issues can be fixed with monkey patching.
However, if you're a developer, I'm sure you understand how controversial monkey patching can be.

#

It’s really disheartening to see that, just like Google, most others don’t seem to care much about aligning with the spec.