mirror of
https://github.com/openai/codex.git
synced 2026-12-05 01:00:54 +00:00
Stream provisional text from thread/sample (#65167)
## Why Clients had to wait for the entire sample before they could display any assistant text. ## What changed Set `stream: true` to receive `thread/sample/textDelta` notifications while a sample is in progress. Each notification goes to the requesting connection and carries the original JSON-RPC `requestId` and a text `delta`. The stream excludes commentary and reasoning. The final RPC response still provides the complete sample and token usage. Discard provisional text if the request fails or the final `text` is null. Omitting `stream` or setting it to `false` returns only the final response. ## Testing Integration tests cover deltas arriving before completion, text supplied only when an output item completes, and custom tool calls producing a null sample even after provisional text has been streamed. GitOrigin-RevId: b2ad960420ce7789722e03f9f283781030cf61fb
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"definitions": {
|
||||
"RequestId": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"delta": {
|
||||
"description": "Provisional text. The final RPC response determines whether the sample is usable.",
|
||||
"type": "string"
|
||||
},
|
||||
"requestId": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/RequestId"
|
||||
}
|
||||
],
|
||||
"description": "The ID of the `thread/sample` request on this connection."
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"delta",
|
||||
"requestId"
|
||||
],
|
||||
"title": "ThreadSampleTextDeltaNotification",
|
||||
"type": "object"
|
||||
}
|
||||
Reference in New Issue
Block a user