Signed-off-by: Yuan Tang <terrytangyuan@gmail.com>
This commit is contained in:
Yuan Tang 2025-03-21 11:30:57 -04:00
parent 98274574f0
commit 9032544b2e
No known key found for this signature in database
2 changed files with 23 additions and 5 deletions

View file

@ -4053,28 +4053,33 @@
"type": "object", "type": "object",
"properties": { "properties": {
"strategy": { "strategy": {
"$ref": "#/components/schemas/SamplingStrategy" "$ref": "#/components/schemas/SamplingStrategy",
"description": "The sampling strategy."
}, },
"max_tokens": { "max_tokens": {
"type": "integer", "type": "integer",
"default": 0 "default": 0,
"description": "The maximum number of tokens that can be generated in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length."
}, },
"repetition_penalty": { "repetition_penalty": {
"type": "number", "type": "number",
"default": 1.0 "default": 1.0,
"description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics."
}, },
"stop": { "stop": {
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
} },
"description": "Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."
} }
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"strategy" "strategy"
], ],
"title": "SamplingParams" "title": "SamplingParams",
"description": "Sampling parameters."
}, },
"SamplingStrategy": { "SamplingStrategy": {
"oneOf": [ "oneOf": [

View file

@ -2787,20 +2787,33 @@ components:
properties: properties:
strategy: strategy:
$ref: '#/components/schemas/SamplingStrategy' $ref: '#/components/schemas/SamplingStrategy'
description: The sampling strategy.
max_tokens: max_tokens:
type: integer type: integer
default: 0 default: 0
description: >-
The maximum number of tokens that can be generated in the completion.
The token count of your prompt plus max_tokens cannot exceed the model's
context length.
repetition_penalty: repetition_penalty:
type: number type: number
default: 1.0 default: 1.0
description: >-
Number between -2.0 and 2.0. Positive values penalize new tokens based
on whether they appear in the text so far, increasing the model's likelihood
to talk about new topics.
stop: stop:
type: array type: array
items: items:
type: string type: string
description: >-
Up to 4 sequences where the API will stop generating further tokens. The
returned text will not contain the stop sequence.
additionalProperties: false additionalProperties: false
required: required:
- strategy - strategy
title: SamplingParams title: SamplingParams
description: Sampling parameters.
SamplingStrategy: SamplingStrategy:
oneOf: oneOf:
- $ref: '#/components/schemas/GreedySamplingStrategy' - $ref: '#/components/schemas/GreedySamplingStrategy'