Documentation ¶
Index ¶
- func GenRequestId() string
- func Retry(ctx context.Context, rp RetryPolicy, isNeedRetry func() bool, ...) error
- type BatchTask
- type BatchTaskResult
- type BatchWorkerPool
- func (p *BatchWorkerPool) AddAfter(task BatchTask, duration time.Duration)
- func (p *BatchWorkerPool) Close()
- func (p *BatchWorkerPool) GetOrCreateBreaker(model string) *Breaker
- func (p *BatchWorkerPool) Run()
- func (p *BatchWorkerPool) Submit(ctx context.Context, model string, taskFunc func() (BatchTaskResult, error), ...)
- type BotChatCompletionStreamReader
- type Breaker
- type ChatCompletionStreamReader
- type DefaultErrorAccumulator
- type ErrorAccumulator
- type HTTPRequestBuilder
- type JSONMarshaller
- type JSONUnmarshaler
- type Marshaller
- type RequestBuilder
- type RetryPolicy
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenRequestId ¶
func GenRequestId() string
Types ¶
type BatchTaskResult ¶ added in v1.0.172
type BatchTaskResult struct {
RequeueAfter int64
}
type BatchWorkerPool ¶ added in v1.0.172
type BatchWorkerPool struct {
// contains filtered or unexported fields
}
func NewBatchWorkerPool ¶ added in v1.0.172
func NewBatchWorkerPool(workerNum int) *BatchWorkerPool
func (*BatchWorkerPool) AddAfter ¶ added in v1.0.172
func (p *BatchWorkerPool) AddAfter(task BatchTask, duration time.Duration)
func (*BatchWorkerPool) Close ¶ added in v1.0.172
func (p *BatchWorkerPool) Close()
func (*BatchWorkerPool) GetOrCreateBreaker ¶ added in v1.0.172
func (p *BatchWorkerPool) GetOrCreateBreaker(model string) *Breaker
func (*BatchWorkerPool) Run ¶ added in v1.0.172
func (p *BatchWorkerPool) Run()
func (*BatchWorkerPool) Submit ¶ added in v1.0.172
func (p *BatchWorkerPool) Submit(ctx context.Context, model string, taskFunc func() (BatchTaskResult, error), doneChan chan error)
type BotChatCompletionStreamReader ¶ added in v1.0.146
type BotChatCompletionStreamReader struct {
ChatCompletionStreamReader
}
func (*BotChatCompletionStreamReader) Close ¶ added in v1.0.146
func (stream *BotChatCompletionStreamReader) Close() error
func (*BotChatCompletionStreamReader) Recv ¶ added in v1.0.146
func (stream *BotChatCompletionStreamReader) Recv() (response model.BotChatCompletionStreamResponse, err error)
type Breaker ¶ added in v1.0.172
func NewBreaker ¶ added in v1.0.172
func NewBreaker() *Breaker
func (*Breaker) GetAllowedDuration ¶ added in v1.0.172
type ChatCompletionStreamReader ¶
type ChatCompletionStreamReader struct { EmptyMessagesLimit uint IsFinished bool Reader *bufio.Reader Response *http.Response ErrAccumulator ErrorAccumulator Unmarshaler Unmarshaler model.HttpHeader }
func (*ChatCompletionStreamReader) Close ¶
func (stream *ChatCompletionStreamReader) Close() error
func (*ChatCompletionStreamReader) Recv ¶
func (stream *ChatCompletionStreamReader) Recv() (response model.ChatCompletionStreamResponse, err error)
type DefaultErrorAccumulator ¶
type DefaultErrorAccumulator struct {
Buffer errorBuffer
}
func (*DefaultErrorAccumulator) Bytes ¶
func (e *DefaultErrorAccumulator) Bytes() (errBytes []byte)
func (*DefaultErrorAccumulator) Write ¶
func (e *DefaultErrorAccumulator) Write(p []byte) error
type ErrorAccumulator ¶
func NewErrorAccumulator ¶
func NewErrorAccumulator() ErrorAccumulator
type HTTPRequestBuilder ¶
type HTTPRequestBuilder struct {
// contains filtered or unexported fields
}
func NewRequestBuilder ¶
func NewRequestBuilder() *HTTPRequestBuilder
type JSONMarshaller ¶
type JSONMarshaller struct{}
func (*JSONMarshaller) Marshal ¶
func (jm *JSONMarshaller) Marshal(value interface{}) ([]byte, error)
type JSONUnmarshaler ¶
type JSONUnmarshaler struct{}
func (*JSONUnmarshaler) Unmarshal ¶
func (jm *JSONUnmarshaler) Unmarshal(data []byte, v interface{}) error
type Marshaller ¶
type RequestBuilder ¶
type RetryPolicy ¶ added in v1.0.143
type Unmarshaler ¶
Click to show internal directories.
Click to hide internal directories.