From ca86b985f1f3add18032bec96a3f304e109a3f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CMark?= <“74402146+TechnoFinch@users.noreply.github.com”> Date: Tue, 21 Apr 2026 18:22:36 -0700 Subject: [PATCH] Add content field to LogprobsPart for per-token logprobs The API returns per-token log probability information in a content array with nested top_logprobs, but the OpenAPI spec did not describe this structure. This caused the generated Python SDK to silently drop the content and per-token top_logprobs data during deserialization. Adds LogprobsToken and LogprobsTokenTopLogprob schema types, and a content field to LogprobsPart. All fields are optional for backwards compatibility. Fixes https://linear.app/together-ai/issue/ENG-86462/fix-logprob-misalignment-with-open-sdk --- openapi.yaml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 8449b9d..c4d13a4 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -9090,6 +9090,45 @@ components: additionalProperties: type: number + LogprobsTokenTopLogprob: + type: object + description: A candidate token and its log probability at a given position. + properties: + token: + type: string + description: The token string + bytes: + type: array + items: + type: integer + description: UTF-8 byte representation of the token + nullable: true + logprob: + type: number + description: The log probability of this token + + LogprobsToken: + type: object + description: Log probability information for a single token in the completion. + properties: + token: + type: string + description: The token string + bytes: + type: array + items: + type: integer + description: UTF-8 byte representation of the token + nullable: true + logprob: + type: number + description: The log probability of this token + top_logprobs: + type: array + items: + $ref: '#/components/schemas/LogprobsTokenTopLogprob' + description: List of the most likely tokens and their log probabilities at this position + LogprobsPart: type: object properties: @@ -9110,6 +9149,12 @@ components: description: List of token log probabilities top_logprobs: $ref: '#/components/schemas/TopLogprobs' + content: + type: array + items: + $ref: '#/components/schemas/LogprobsToken' + description: Per-token log probability information including top alternative tokens + nullable: true PromptPart: type: array