Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BatchConfig ¶
type BatchConfig struct {
MaxBatchSize int `json:"max_batch_size"`
MaxWaitTime time.Duration `json:"max_wait_time"`
QueueSize int `json:"queue_size"`
Workers int `json:"workers"`
RetryOnFailure bool `json:"retry_on_failure"`
}
BatchConfig 配置批处理器。
type BatchHandler ¶
BatchHandler处理一批请求.
type BatchProcessor ¶
type BatchProcessor struct {
// contains filtered or unexported fields
}
批量处理器为高效处理而批出多个LLM请求.
func NewBatchProcessor ¶
func NewBatchProcessor(config BatchConfig, handler BatchHandler) *BatchProcessor
NewBatchProcessor创建了新的分批处理器.
func (*BatchProcessor) Submit ¶
func (bp *BatchProcessor) Submit(ctx context.Context, req *Request) <-chan *Response
提交请求并返回响应的通道 。
func (*BatchProcessor) SubmitSync ¶
SontentSync 提交请求并等待回复.
type BatchStats ¶
type BatchStats struct {
Submitted int64 `json:"submitted"`
Batched int64 `json:"batched"`
Completed int64 `json:"completed"`
Failed int64 `json:"failed"`
Queued int `json:"queued"`
}
BatchStats包含处理器统计.
Click to show internal directories.
Click to hide internal directories.