Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConverters ¶
func InitConverters() error
Types ¶
type ActionBasedOnPattern ¶
type ActionBasedOnPattern struct {
Trim bool `json:"trim"`
Regex bool `json:"is_regex"`
Pattern string `json:"pattern"`
Action string `json:"action"`
// contains filtered or unexported fields
}
ActionBasedOnPattern Sometimes we detect that the content need to be drop or ignored For example, the last [DONE] message in openai event stream It is useless for non openai API clients, and should be dropped It detects the input content and decide whether to drop it
func (*ActionBasedOnPattern) Convert ¶
func (a *ActionBasedOnPattern) Convert(content types.HTTPContent, ctx ConvertContext) (types.HTTPContent, error)
func (*ActionBasedOnPattern) IsReusable ¶
func (a *ActionBasedOnPattern) IsReusable() bool
type ConvertContext ¶
type Converter ¶
type Converter interface {
Convert(types.HTTPContent, ConvertContext) (types.HTTPContent, error)
// IsReusable Whether this converter is reusable. i.e. stateless so can be used
// for multiple conversions without the need to recreate everytime
IsReusable() bool
}
func NewActionBasedOnPattern ¶
func NewHeaderConverter ¶
func NewJsonataConverter ¶
type ConverterPipeline ¶
type ConverterPipeline struct {
// contains filtered or unexported fields
}
ConverterPipeline Itself is a Conveter
func NewConverterPipeline ¶
func NewConverterPipeline(config []types.ConversionStepDef) (*ConverterPipeline, error)
func (*ConverterPipeline) Convert ¶
func (p *ConverterPipeline) Convert(content types.HTTPContent, ctx ConvertContext) (types.HTTPContent, error)
func (*ConverterPipeline) IsReusable ¶
func (p *ConverterPipeline) IsReusable() bool
type HeaderConverter ¶
type HeaderConverter struct {
// contains filtered or unexported fields
}
func (*HeaderConverter) Convert ¶
func (c *HeaderConverter) Convert(content types.HTTPContent, ctx ConvertContext) (types.HTTPContent, error)
func (*HeaderConverter) IsReusable ¶
func (c *HeaderConverter) IsReusable() bool
type JsonataConverter ¶
type JsonataConverter struct {
Expression string
// contains filtered or unexported fields
}
func (*JsonataConverter) Convert ¶
func (c *JsonataConverter) Convert(content types.HTTPContent, ctx ConvertContext) (types.HTTPContent, error)
func (*JsonataConverter) IsReusable ¶
func (c *JsonataConverter) IsReusable() bool
Click to show internal directories.
Click to hide internal directories.