stream

package
v2026.622.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStreamAccumulatorRejected = errors.New("chat completion stream accumulator rejected chunk")

Functions

func AggregateConsecutiveTurnUsage

func AggregateConsecutiveTurnUsage(usages []apitype.UsageStats) apitype.UsageStats

func ParseCursorToolEventFromChunkRawJSON

func ParseCursorToolEventFromChunkRawJSON(raw string) string

func StreamAssistantTurn

func StreamAssistantTurn(ctx context.Context, client openai.Client, params openai.ChatCompletionNewParams, contentOut io.Writer, opts apitype.StreamOpts) (apitype.AssistantTurnResult, error)

func StreamText

func StreamText(ctx context.Context, client openai.Client, params openai.ChatCompletionNewParams, contentOut io.Writer, opts apitype.StreamOpts) (string, apitype.UsageStats, error)

func UsageTokensDisplayParts

func UsageTokensDisplayParts(system string, msgs []chatstore.Message, u apitype.UsageStats, turnCount int) (contextTok, lastUserTok int64, contextEstimated bool, reasoningTok, responseTok, totalTok int64)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL