processors

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnthropicChunkProcessor

type AnthropicChunkProcessor struct {
	// contains filtered or unexported fields
}

AnthropicChunkProcessor handles Anthropic-specific format conversion

func NewAnthropicChunkProcessor

func NewAnthropicChunkProcessor(provider, cacheSource, requestID, model, endpoint string, usageService *usage.Service, apiKey *models.APIKey, usageWorker *usage.Worker, isCustomConfig bool) *AnthropicChunkProcessor

NewAnthropicChunkProcessor creates a new Anthropic chunk processor

func (*AnthropicChunkProcessor) Process

func (p *AnthropicChunkProcessor) Process(ctx context.Context, data []byte) ([]byte, error)

Process converts Anthropic chunk data using existing format adapter

func (*AnthropicChunkProcessor) Provider

func (p *AnthropicChunkProcessor) Provider() string

Provider returns the provider name

type GeminiChunkProcessor

type GeminiChunkProcessor struct {
	// contains filtered or unexported fields
}

GeminiChunkProcessor handles processing of Gemini stream chunks Converts between formats and adds provider metadata

func NewGeminiChunkProcessor

func NewGeminiChunkProcessor(provider, cacheSource, requestID, model, endpoint string, usageService *usage.Service, apiKey *models.APIKey, usageWorker *usage.Worker, isCustomConfig bool) *GeminiChunkProcessor

NewGeminiChunkProcessor creates a new Gemini chunk processor

func (*GeminiChunkProcessor) Process

func (p *GeminiChunkProcessor) Process(ctx context.Context, data []byte) ([]byte, error)

Process processes raw Gemini chunk data and converts it to our adaptive format

func (*GeminiChunkProcessor) Provider

func (p *GeminiChunkProcessor) Provider() string

Provider returns the provider name

type OpenAIChunkProcessor

type OpenAIChunkProcessor struct {
	// contains filtered or unexported fields
}

OpenAIChunkProcessor handles OpenAI-specific format conversion

func NewOpenAIChunkProcessor

func NewOpenAIChunkProcessor(provider, cacheSource, requestID, model, endpoint string, usageService *usage.Service, apiKey *models.APIKey, usageWorker *usage.Worker, isCustomConfig bool) *OpenAIChunkProcessor

NewOpenAIChunkProcessor creates a new OpenAI chunk processor

func (*OpenAIChunkProcessor) Process

func (p *OpenAIChunkProcessor) Process(ctx context.Context, data []byte) ([]byte, error)

Process converts OpenAI chunk data using existing format adapter

func (*OpenAIChunkProcessor) Provider

func (p *OpenAIChunkProcessor) Provider() string

Provider returns the provider name

type PassthroughProcessor

type PassthroughProcessor struct {
	// contains filtered or unexported fields
}

PassthroughProcessor passes data through without any modification Used when no format conversion is needed

func NewPassthroughProcessor

func NewPassthroughProcessor(provider, requestID string) *PassthroughProcessor

NewPassthroughProcessor creates a new passthrough processor

func (*PassthroughProcessor) Process

func (p *PassthroughProcessor) Process(ctx context.Context, data []byte) ([]byte, error)

Process passes data through without any modification

func (*PassthroughProcessor) Provider

func (p *PassthroughProcessor) Provider() string

Provider returns the provider name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL