vibe-proxy/backend/sdk/translator/plugin_hooks.go
2026-08-24 00:10:41 +02:00

12 lines
814 B
Go

package translator
import "context"
// PluginHooks defines optional translator extension hooks provided by plugins.
type PluginHooks interface {
NormalizeRequest(ctx context.Context, from, to Format, model string, body []byte, stream bool) []byte
TranslateRequest(ctx context.Context, from, to Format, model string, body []byte, stream bool) ([]byte, bool)
NormalizeResponseBefore(ctx context.Context, from, to Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) []byte
TranslateResponse(ctx context.Context, from, to Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) ([]byte, bool)
NormalizeResponseAfter(ctx context.Context, from, to Format, model string, originalRequestRawJSON, requestRawJSON, body []byte, stream bool) []byte
}