Fix typescript hints for max_tokens
This commit is contained in:
@@ -56,6 +56,14 @@ modelProperty.type = "string";
|
|||||||
modelProperty.enum = modelProperty.oneOf[1].enum;
|
modelProperty.enum = modelProperty.oneOf[1].enum;
|
||||||
delete modelProperty["oneOf"];
|
delete modelProperty["oneOf"];
|
||||||
|
|
||||||
|
// The default of "inf" confuses the Typescript generator, so can just remove it
|
||||||
|
assert(
|
||||||
|
"max_tokens" in completionRequestSchema.properties &&
|
||||||
|
isObject(completionRequestSchema.properties.max_tokens) &&
|
||||||
|
"default" in completionRequestSchema.properties.max_tokens,
|
||||||
|
);
|
||||||
|
delete completionRequestSchema.properties.max_tokens["default"];
|
||||||
|
|
||||||
// Get the directory of the current script
|
// Get the directory of the current script
|
||||||
const currentDirectory = path.dirname(import.meta.url).replace("file://", "");
|
const currentDirectory = path.dirname(import.meta.url).replace("file://", "");
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,6 @@
|
|||||||
},
|
},
|
||||||
"max_tokens": {
|
"max_tokens": {
|
||||||
"description": "The maximum number of [tokens](/tokenizer) to generate in the chat completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens.\n",
|
"description": "The maximum number of [tokens](/tokenizer) to generate in the chat completion.\n\nThe total length of input tokens and generated tokens is limited by the model's context length. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens.\n",
|
||||||
"default": "inf",
|
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"presence_penalty": {
|
"presence_penalty": {
|
||||||
|
|||||||
Reference in New Issue
Block a user