Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract ChatCompletionTokenLogprob schema #144

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 35 additions & 32 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6299,38 +6299,7 @@ components:
description: A list of message content tokens with log probability information.
type: array
items:
type: object
properties:
token: &chat_completion_response_logprobs_token
description: The token.
type: string
logprob: &chat_completion_response_logprobs_token_logprob
description: The log probability of this token.
type: number
bytes: &chat_completion_response_logprobs_bytes
description: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
type: array
items:
type: integer
nullable: true
top_logprobs:
description: List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.
type: array
items:
type: object
properties:
token: *chat_completion_response_logprobs_token
logprob: *chat_completion_response_logprobs_token_logprob
bytes: *chat_completion_response_logprobs_bytes
required:
- token
- logprob
- bytes
required:
- token
- logprob
- bytes
- top_logprobs
$ref: '#/components/schemas/ChatCompletionTokenLogprob'
nullable: true
required:
- content
Expand Down Expand Up @@ -6421,6 +6390,40 @@ components:
group: chat
example: *chat_completion_function_example

ChatCompletionTokenLogprob:
type: object
properties:
token: &chat_completion_response_logprobs_token
description: The token.
type: string
logprob: &chat_completion_response_logprobs_token_logprob
description: The log probability of this token.
type: number
bytes: &chat_completion_response_logprobs_bytes
description: A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token.
type: array
items:
type: integer
nullable: true
top_logprobs:
description: List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned.
type: array
items:
type: object
properties:
token: *chat_completion_response_logprobs_token
logprob: *chat_completion_response_logprobs_token_logprob
bytes: *chat_completion_response_logprobs_bytes
required:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see what you mean. This is at the wrong level right? One deeper is what I intended, inside items

- token
- logprob
- bytes
required:
- token
- logprob
- bytes
- top_logprobs

ListPaginatedFineTuningJobsResponse:
type: object
properties:
Expand Down
Loading