Skip to content

Non-standard OpenAI-like response format on tool_calls. #160

Open
@enricoros

Description

@enricoros

Hello, opening the bug here despite it being not the best place.

Wanted to let you know about some non-standard answers in the Together API which force special cases in OpenAI-like protocol parsers.

The root is returning null in place of a missing (or undefined) field. Not a big deal, it just forces special cases, as OpenAI-compliant parsers do not treat null and undefined (aka missing) fields equally.

This happens in 3 instances (that I know of):

  • choices[number].delta.tool_calls = null; // for text-only responses
  • choices[number].delta.tool_calls[number].function.arguments = null; // seems to be during the first call when the name is given
  • choices[number].delta.tool_calls[number].function.name = null; // seems to be during the continuation of json tool call arguments

This is nothing major, but imagine that other downstream parsers will break and have to add special cases for Together. Sometimes it can hinder adoption, so I thought you'd appreciate if I'd let you know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions