Add /context window breakdown

This commit is contained in:
starr-openai
2026-04-02 14:02:03 -07:00
parent 03c07956cf
commit 6469022c20
35 changed files with 2138 additions and 3 deletions

View File

@@ -1153,6 +1153,30 @@
"title": "Thread/readRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"thread/context/read"
],
"title": "Thread/context/readRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/ThreadContextReadParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Thread/context/readRequest",
"type": "object"
},
{
"properties": {
"id": {
@@ -10197,6 +10221,101 @@
"title": "ThreadCompactStartResponse",
"type": "object"
},
"ThreadContextReadParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"threadId": {
"type": "string"
},
"verbose": {
"description": "When true, include every contributing row instead of merging repeated labels.",
"type": "boolean"
}
},
"required": [
"threadId"
],
"title": "ThreadContextReadParams",
"type": "object"
},
"ThreadContextReadResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"context": {
"$ref": "#/definitions/ThreadContextWindowBreakdown"
}
},
"required": [
"context"
],
"title": "ThreadContextReadResponse",
"type": "object"
},
"ThreadContextWindowBreakdown": {
"properties": {
"modelContextWindow": {
"format": "int64",
"type": [
"integer",
"null"
]
},
"sections": {
"items": {
"$ref": "#/definitions/ThreadContextWindowSection"
},
"type": "array"
},
"totalTokens": {
"format": "int64",
"type": "integer"
}
},
"required": [
"sections",
"totalTokens"
],
"type": "object"
},
"ThreadContextWindowDetail": {
"properties": {
"label": {
"type": "string"
},
"tokens": {
"format": "int64",
"type": "integer"
}
},
"required": [
"label",
"tokens"
],
"type": "object"
},
"ThreadContextWindowSection": {
"properties": {
"details": {
"items": {
"$ref": "#/definitions/ThreadContextWindowDetail"
},
"type": "array"
},
"label": {
"type": "string"
},
"tokens": {
"format": "int64",
"type": "integer"
}
},
"required": [
"details",
"label",
"tokens"
],
"type": "object"
},
"ThreadForkParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.",