Help us shape the future of Go! Take the 2026 Go Developer Survey

chatstream

package
v4.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package chatstream provides helpers for working with streamed chat responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ToolCallAccumulator

type ToolCallAccumulator struct {
	// contains filtered or unexported fields
}

ToolCallAccumulator tracks the last known metadata for a streamed tool call. It fills in missing id/type/function-name fields across incremental deltas so callers always observe complete tool-call identifiers.

func (*ToolCallAccumulator) Merge

func (a *ToolCallAccumulator) Merge(
	choiceIndex int,
	callIndex int,
	toolID string,
	toolType string,
	functionName string,
) (finalID, finalType, finalName string)

Merge records any provided metadata for a tool call and returns the accumulated values for that (choice, call) pair.

Jump to

Keyboard shortcuts

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