Documentation
¶
Index ¶
- func AppendSSEEventBytes(out []byte, event string, payload []byte, trailingNewlines int) []byte
- func AppendSSEEventString(out []byte, event, payload string, trailingNewlines int) []byte
- func ClaudeInputTokensJSON(count int64) []byte
- func EchoRequestFields(dest []byte, req gjson.Result, prefix string) []byte
- func GeminiTokenCountJSON(count int64) []byte
- func SSEEventData(event string, payload []byte) []byte
- func WrapGeminiCLIResponse(response []byte) []byte
- type ClaudeBlockState
- type ClaudeSSEEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSSEEventBytes ¶
func AppendSSEEventString ¶
func ClaudeInputTokensJSON ¶
func EchoRequestFields ¶
EchoRequestFields copies known OpenAI Responses API request fields from req into dest under the given key prefix. For streaming response.completed events the prefix is "response." ; for non-streaming responses it is "".
func GeminiTokenCountJSON ¶
func SSEEventData ¶
func WrapGeminiCLIResponse ¶
Types ¶
type ClaudeBlockState ¶
type ClaudeBlockState struct {
ResponseType int // 0=none, 1=text, 2=thinking
ResponseIndex int // Current content block index
HasContent bool // Whether any content has been emitted
}
ClaudeBlockState tracks the state machine for streaming Claude-format content blocks (thinking / text). Callers should persist this across chunks.
type ClaudeSSEEvent ¶
ClaudeSSEEvent is a single SSE event to emit.
func EmitTextOrThinkingBlock ¶
func EmitTextOrThinkingBlock(st *ClaudeBlockState, text string, isThought bool) []ClaudeSSEEvent
EmitTextOrThinkingBlock generates the SSE events needed to stream a Gemini text/thought part as Claude-format content blocks. It mutates st in place.
Click to show internal directories.
Click to hide internal directories.