Documentation
¶
Index ¶
- type AnthropicStreamAssembler
- func (a *AnthropicStreamAssembler) Finish(model string, inputTokens, outputTokens int) *anthropic.Message
- func (a *AnthropicStreamAssembler) RecordV1BetaEvent(event *anthropic.BetaRawMessageStreamEventUnion)
- func (a *AnthropicStreamAssembler) RecordV1Event(event *anthropic.MessageStreamEventUnion)
- func (a *AnthropicStreamAssembler) SetUsage(inputTokens, outputTokens int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnthropicStreamAssembler ¶
type AnthropicStreamAssembler struct {
// contains filtered or unexported fields
}
AnthropicStreamAssembler assembles Anthropic streaming responses It is a pure assembler that doesn't depend on recording logic
func NewAnthropicStreamAssembler ¶
func NewAnthropicStreamAssembler() *AnthropicStreamAssembler
NewAnthropicStreamAssembler creates a new assembler for Anthropic streams
func (*AnthropicStreamAssembler) Finish ¶
func (a *AnthropicStreamAssembler) Finish(model string, inputTokens, outputTokens int) *anthropic.Message
Finish assembles the final response and returns it as anthropic.Message
func (*AnthropicStreamAssembler) RecordV1BetaEvent ¶
func (a *AnthropicStreamAssembler) RecordV1BetaEvent(event *anthropic.BetaRawMessageStreamEventUnion)
RecordV1BetaEvent processes a v1 beta stream event
func (*AnthropicStreamAssembler) RecordV1Event ¶
func (a *AnthropicStreamAssembler) RecordV1Event(event *anthropic.MessageStreamEventUnion)
RecordV1Event processes a v1 stream event
func (*AnthropicStreamAssembler) SetUsage ¶
func (a *AnthropicStreamAssembler) SetUsage(inputTokens, outputTokens int)
SetUsage sets the usage data
Click to show internal directories.
Click to hide internal directories.