Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentAccumulator ¶
type ContentAccumulator struct {
Response Response
// contains filtered or unexported fields
}
func NewContentAccumulator ¶ added in v0.0.2
func NewContentAccumulator() ContentAccumulator
func (*ContentAccumulator) AddChunk ¶
func (acc *ContentAccumulator) AddChunk(chunk *Response) error
func (ContentAccumulator) HasFinished ¶
func (acc ContentAccumulator) HasFinished() bool
type ErrChunkAddition ¶
func (ErrChunkAddition) Error ¶
func (e ErrChunkAddition) Error() string
type ErrUnknownRole ¶
type ErrUnknownRole struct {
Role string
}
func (ErrUnknownRole) Error ¶
func (e ErrUnknownRole) Error() string
type Response ¶
type Response struct {
ID string `json:"id"`
Created time.Time `json:"created"`
Content string `json:"content"`
Refusal string `json:"refusal"`
Reasoning string `json:"reasoning"`
ToolCalls []chat.ToolCall `json:"tool_calls"`
FinishReason string `json:"finish_reason"`
Metrics metrics.Metrics `json:"metrics"`
}
type ResponseChannel ¶
type ResponseChannel chan ResponseChunk
func NewResponseChannel ¶
func NewResponseChannel(size ...int) ResponseChannel
func (ResponseChannel) Close ¶
func (rs ResponseChannel) Close()
func (ResponseChannel) Drain ¶ added in v0.0.2
func (rs ResponseChannel) Drain() int
func (ResponseChannel) Next ¶
func (rs ResponseChannel) Next() (*Response, error)
func (ResponseChannel) Send ¶
func (rs ResponseChannel) Send(data *Response)
func (ResponseChannel) SendErr ¶
func (rs ResponseChannel) SendErr(err error)
type ResponseChunk ¶
func (*ResponseChunk) ToMarshalable ¶
func (rc *ResponseChunk) ToMarshalable() ResponseChunkMarshalable
Click to show internal directories.
Click to hide internal directories.