Skip to content
Merged
Show file tree
Hide file tree
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
69 changes: 69 additions & 0 deletions swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,9 @@ const docTemplate = `{
"index": {
"type": "integer"
},
"logprobs": {
"$ref": "#/definitions/schema.Logprobs"
},
"message": {
"$ref": "#/definitions/schema.Message"
},
Expand Down Expand Up @@ -1419,6 +1422,52 @@ const docTemplate = `{
}
}
},
"schema.LogprobContent": {
"type": "object",
"properties": {
"bytes": {
"type": "array",
"items": {
"type": "integer"
}
},
"id": {
"type": "integer"
},
"logprob": {
"type": "number"
},
"token": {
"type": "string"
},
"top_logprobs": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.LogprobContent"
}
}
}
},
"schema.Logprobs": {
"type": "object",
"properties": {
"content": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.LogprobContent"
}
}
}
},
"schema.LogprobsValue": {
"type": "object",
"properties": {
"enabled": {
"description": "true if logprobs should be returned",
"type": "boolean"
}
}
},
"schema.Message": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1573,6 +1622,22 @@ const docTemplate = `{
"description": "Also part of the OpenAI official spec",
"type": "string"
},
"logit_bias": {
"description": "Map of token IDs to bias values (-100 to 100)",
"type": "object",
"additionalProperties": {
"type": "number",
"format": "float64"
}
},
"logprobs": {
"description": "OpenAI API logprobs parameters\nlogprobs: boolean - if true, returns log probabilities of each output token\ntop_logprobs: integer 0-20 - number of most likely tokens to return at each token position",
"allOf": [
{
"$ref": "#/definitions/schema.LogprobsValue"
}
]
},
"max_tokens": {
"type": "integer"
},
Expand Down Expand Up @@ -1680,6 +1745,10 @@ const docTemplate = `{
"top_k": {
"type": "integer"
},
"top_logprobs": {
"description": "Number of top logprobs per token (0-20)",
"type": "integer"
},
"top_p": {
"description": "Common options between all the API calls, part of the OpenAI spec",
"type": "number"
Expand Down
69 changes: 69 additions & 0 deletions swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,9 @@
"index": {
"type": "integer"
},
"logprobs": {
"$ref": "#/definitions/schema.Logprobs"
},
"message": {
"$ref": "#/definitions/schema.Message"
},
Expand Down Expand Up @@ -1412,6 +1415,52 @@
}
}
},
"schema.LogprobContent": {
"type": "object",
"properties": {
"bytes": {
"type": "array",
"items": {
"type": "integer"
}
},
"id": {
"type": "integer"
},
"logprob": {
"type": "number"
},
"token": {
"type": "string"
},
"top_logprobs": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.LogprobContent"
}
}
}
},
"schema.Logprobs": {
"type": "object",
"properties": {
"content": {
"type": "array",
"items": {
"$ref": "#/definitions/schema.LogprobContent"
}
}
}
},
"schema.LogprobsValue": {
"type": "object",
"properties": {
"enabled": {
"description": "true if logprobs should be returned",
"type": "boolean"
}
}
},
"schema.Message": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1566,6 +1615,22 @@
"description": "Also part of the OpenAI official spec",
"type": "string"
},
"logit_bias": {
"description": "Map of token IDs to bias values (-100 to 100)",
"type": "object",
"additionalProperties": {
"type": "number",
"format": "float64"
}
},
"logprobs": {
"description": "OpenAI API logprobs parameters\nlogprobs: boolean - if true, returns log probabilities of each output token\ntop_logprobs: integer 0-20 - number of most likely tokens to return at each token position",
"allOf": [
{
"$ref": "#/definitions/schema.LogprobsValue"
}
]
},
"max_tokens": {
"type": "integer"
},
Expand Down Expand Up @@ -1673,6 +1738,10 @@
"top_k": {
"type": "integer"
},
"top_logprobs": {
"description": "Number of top logprobs per token (0-20)",
"type": "integer"
},
"top_p": {
"description": "Common options between all the API calls, part of the OpenAI spec",
"type": "number"
Expand Down
48 changes: 48 additions & 0 deletions swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ definitions:
type: string
index:
type: integer
logprobs:
$ref: '#/definitions/schema.Logprobs'
message:
$ref: '#/definitions/schema.Message'
text:
Expand Down Expand Up @@ -381,6 +383,36 @@ definitions:
total_tokens:
type: integer
type: object
schema.LogprobContent:
properties:
bytes:
items:
type: integer
type: array
id:
type: integer
logprob:
type: number
token:
type: string
top_logprobs:
items:
$ref: '#/definitions/schema.LogprobContent'
type: array
type: object
schema.Logprobs:
properties:
content:
items:
$ref: '#/definitions/schema.LogprobContent'
type: array
type: object
schema.LogprobsValue:
properties:
enabled:
description: true if logprobs should be returned
type: boolean
type: object
schema.Message:
properties:
content:
Expand Down Expand Up @@ -484,6 +516,19 @@ definitions:
language:
description: Also part of the OpenAI official spec
type: string
logit_bias:
additionalProperties:
format: float64
type: number
description: Map of token IDs to bias values (-100 to 100)
type: object
logprobs:
allOf:
- $ref: '#/definitions/schema.LogprobsValue'
description: |-
OpenAI API logprobs parameters
logprobs: boolean - if true, returns log probabilities of each output token
top_logprobs: integer 0-20 - number of most likely tokens to return at each token position
max_tokens:
type: integer
messages:
Expand Down Expand Up @@ -559,6 +604,9 @@ definitions:
type: array
top_k:
type: integer
top_logprobs:
description: Number of top logprobs per token (0-20)
type: integer
top_p:
description: Common options between all the API calls, part of the OpenAI
spec
Expand Down
Loading