Unverified Commit ce29f695 authored by Parth Sareen's avatar Parth Sareen Committed by GitHub
Browse files

docs: add logprobs to openapi (#13090)

parent 12b174b1
...@@ -111,6 +111,12 @@ components: ...@@ -111,6 +111,12 @@ components:
description: Model keep-alive duration (for example `5m` or `0` to unload immediately) description: Model keep-alive duration (for example `5m` or `0` to unload immediately)
options: options:
$ref: "#/components/schemas/ModelOptions" $ref: "#/components/schemas/ModelOptions"
logprobs:
type: boolean
description: Whether to return log probabilities of the output tokens
top_logprobs:
type: integer
description: Number of most likely tokens to return at each token position when logprobs are enabled
GenerateResponse: GenerateResponse:
type: object type: object
properties: properties:
...@@ -150,6 +156,11 @@ components: ...@@ -150,6 +156,11 @@ components:
eval_duration: eval_duration:
type: integer type: integer
description: Time spent generating tokens in nanoseconds description: Time spent generating tokens in nanoseconds
logprobs:
type: array
items:
$ref: "#/components/schemas/Logprob"
description: Log probability information for the generated tokens when logprobs are enabled
GenerateStreamEvent: GenerateStreamEvent:
type: object type: object
properties: properties:
...@@ -287,6 +298,12 @@ components: ...@@ -287,6 +298,12 @@ components:
- type: string - type: string
- type: number - type: number
description: Model keep-alive duration (for example `5m` or `0` to unload immediately) description: Model keep-alive duration (for example `5m` or `0` to unload immediately)
logprobs:
type: boolean
description: Whether to return log probabilities of the output tokens
top_logprobs:
type: integer
description: Number of most likely tokens to return at each token position when logprobs are enabled
ChatResponse: ChatResponse:
type: object type: object
properties: properties:
...@@ -344,6 +361,11 @@ components: ...@@ -344,6 +361,11 @@ components:
eval_duration: eval_duration:
type: integer type: integer
description: Time spent generating tokens in nanoseconds description: Time spent generating tokens in nanoseconds
logprobs:
type: array
items:
$ref: "#/components/schemas/Logprob"
description: Log probability information for the generated tokens when logprobs are enabled
ChatStreamEvent: ChatStreamEvent:
type: object type: object
properties: properties:
...@@ -706,6 +728,41 @@ components: ...@@ -706,6 +728,41 @@ components:
version: version:
type: string type: string
description: Version of Ollama description: Version of Ollama
TokenLogprob:
type: object
description: Log probability information for a single token alternative
properties:
token:
type: string
description: The text representation of the token
logprob:
type: number
description: The log probability of this token
bytes:
type: array
items:
type: integer
description: The raw byte representation of the token
Logprob:
type: object
description: Log probability information for a generated token
properties:
token:
type: string
description: The text representation of the token
logprob:
type: number
description: The log probability of this token
bytes:
type: array
items:
type: integer
description: The raw byte representation of the token
top_logprobs:
type: array
items:
$ref: "#/components/schemas/TokenLogprob"
description: Most likely tokens and their log probabilities at this position
ErrorResponse: ErrorResponse:
type: object type: object
properties: properties:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment